Master script for NetStumbler 0.4 (Filter, MapPoint, Roadnav, Speech, DB, Log, more!)
Posted: Thu Sep 16, 2004 8:44 pm
Attached is a refined version of my overhaul of the [thread=10364]MapPoint+Speech[/thread] script. I don't have MapPoint, so I'm unable to test with it, but so far it remains better (at least no worse) than the original's MapPoint-specific code. As time goes on, I hope to continue updating this message and attach further updates, moderators-willing.
If you're downloading from here, check for the last date - "ns04master.zip" should actually be named "20040918.zip". I'm keeping the old versions available in case anyone wants to perform comparisons.
Changes thus far:
To-do list:
I've run it a lot (I'm now on WiGLE's top 10, although the rise above #35 is mostly due to Kismet), it was nice knowing when my DigiTraveler stopped sending updates (although now I use a Holux GPSlim236).
While it pays to have backups of data, after over 2100 downloads there have been few complaints.
Oh, these .ZIPs don't include any icons. I'm sure you can grab some from the [thread=10364]MapPoint+Speech thread[/thread].
If you want support for your mapping program, you MUST BE WILLING TO WORK FOR IT. Saying support of this or that would be nice - well, duh. On the positive side, ns04logger (introduced 2007-01) can be really helpful for testing.
Updated: [post=93046]2004-09-18[/post] ("ns04master", 13.8kB); previous (2004-09-16) had 16+2=18 views
Updated: [post=96888]2004-10-30[/post], new zip file (17.8kB) (removed after 500 downloads due to limit of five attachments, attached to [post=167656]post #100[/post])
Updated: [post=98971]2004-11-24[/post], new zip file (20.7kB); still haven't renamed old zip file (removed after 973 downloads due to limit of five attachments, attached to [post=184798]post #107[/post])
Updated: [post=126011]2005-06-30[/post], new zip file (24.8kB)
Updated: [post=154283]2006-02-28[/post], new zip file (32.4kB)
Updated: [post=167656]2006-06-29[/post], new zip file (37.4kB)
Updated: [post=184798]2007-01-20[/post], new zip file (46.7kB) (removed after 9 downloads due to five attachment limit and errata, attached to [post=185143]post #109[/post])
Updated: [post=185143]2007-01-25[/post], new zip file (48.7kB)
If you're downloading from here, check for the last date - "ns04master.zip" should actually be named "20040918.zip". I'm keeping the old versions available in case anyone wants to perform comparisons.
Changes thus far:
- Separated Mappoint, Speech, and settings into their own scripts, for easier maintenance.
- Theoretically, you shouldn't have to overwrite the settings file, just keep it constant.
- I might have introduced a bug; if so I apologize and will be happy to fix it. The speech code I heavily analyzed, but I don't have MapPoint so I wasn't able to do much scrutiny there.
- If you don't want to use MapPoint functionality or Speech functionality, those parts of the code don't reside in memory. It might run slightly faster due to fewer checks, but there will be increased function call overhead.
- I didn't separate the history, although I did change the dates to ISO-8601 (rather than some nationalistic schemes).
- Localized variables, made constants where appropriate.
- Optimized some flow logic, fixed some bugs.
- Removed numerous comments that consisted solely of things like start of _____, end of _____ - is anyone actually lacking a diff utility?
- Added DiGLE mapping; no need to have MapPoint folks have all the fun! Again, if you don't use it, it won't be in memory.
- For speech, check NetStumbler folder for WAVs that match the strings, so you can have custom sound effects for things like "GPS Timeout", just have a "GPS Timeout.wav" and it should substitute automatically. It gets a list at startup (if speech is enabled), so disk activity is relatively minimized.
- For speech, there's a bit of stub code that converts SSIDs (e.g. NETGEAR becomes netgear, ACTIONTEC becomes ActionTec).
(New as of [post=93046]2004-09-18[/post], all files except DiGLE improved) - Added speed speech: if enabled, tells when speeding, going slowly, speed in preferred units with granularity for easier WAV matching, how often to say so. Avoids telling speed while actively detecting (gotta have priorities). Introduced many new options in the Settings file.
- If you don't want to hear particular types (e.g. WEP-enabled peers) enunciated, you can substitute a particular string (e.g. "ns-aos-new" or " ") for effects or silence.
- If NetStumbler doesn't detect that your GPS receiver doesn't have a fix (the Lat/Lon stay constant, e.g. DigiTraveler and some Deluo), this script will notify you.
- Converted spaces to tabs, beautified, func-ified some duplicated code, optimized some code (e.g. bitwise AND's), no more script import dialogs.
(New as of [post=96888]2004-10-30[/post], all files except DiGLE improved) - Split appended speech (AddWep/strYesWep/strNonWep) to separate pronunciation
- Added option for speed callouts during scanning - if you are detecting APs, you might not want to hear the speed and wait to hear more APs or otherwise interfere with scanning
- Added option to say speed as two numbers (e.g. "55" becomes "50", pause, "5"), better for WAVs
- Added option for speech of null/empty SSIDs (so you don't completely miss them)
- Added option to shorten some default SSIDs (currently just "Apple Network" and "2WIRE" - if there are others that have defaults that include part of the SSID, please post about it!)
- Added option for a specific folder for WAVs - if you are using pregenerated ones, you could easily have over 60, polluting a program folder
- Bugfix: check that custom icons actually exist before using
- Bugfix: use pushpin set names rather than hardcoded names
(New as of [post=98971]2004-11-24[/post], all files except MapPoint improved) - Threaded speech!!!
- Bugfix: DiGLE didn't have OnGPSPosition call
- Option to check for constant coordinates split out from the No GPS reporting option
(New as of [post=126011]2005-06-30[/post], all files except DiGLE improved) - Use SCBLIB for sounds if available; any work-alikes?
- Bugfix for bad WAV folder setting - if invalid, use script's folder
- Bugfix for script location bug - locate the set of scripts wherever you'd like
- Option for speaking directions after speed (if enabled)
- Improve thread start/exit - alas, OnEnableScan and OnDisableScan are only for green triangle (as of 0.4.0)
- Option to run thread forever, in case you're disabling/enabling scan (^B) for bad GPS unit
- Flexible MapPoint centering, with code from ragmanii (untested)
- More code optimization, cruft removal, and commentary
(New as of [post=154283]2006-02-28[/post], all files except DiGLE and MapPoint improved) - Fix for fix for bad WAV folder setting - was still referring to WavFolder even if it didn't exist
- Reverted MapPoint code (per TPEER) to not change parameters passed to Distance() function
- Added really simple how-to instructions at the top of ns04master.vbs (for the tards)
- Added UseDatabase (code based on [thread=18601]Chris H's[/thread])
- UseDatabase can create a new database - note that Chris H's "DateTime" field is renamed to "DT"
- UseThreading can use appended files as an alternative to registry keys
- Added UseFiltering (get only the info you want or avoid cruft)
- Added UseSubstation (code based on [thread=17773]Xarth's[/thread])
- UseSubstation has reduced file size: styles, combined durations
- UseDatabase can do a Position Summary or Individual Readings or both, and also GPS readings
- More code optimization, cruft removal, and commentary
(New as of [post=167656]2006-06-29[/post], all files improved) - Separated ns04master vs ns04events so events don't spend time checking disabled modules
- Cleaned up MapPoint code - hopefully nothing got broken in the conversion
- Module deactivation error dialogs formatted consistently (via DisableModule)
- Fixed SSID cleanliness bugs in UseDatabase (thanks to valic's comment in posts 84 and 87)
- UseThread can use SAPI.SpFileStream if SCBLIB is unavailable - arguably better than calling sndrec32
- Added UseGPX (loosely[!] based on crschmidt's code)
- UseGPX can append to an existing file and has track start/stop if GPS reception is lost
- Added UseGPS setting, for those who will NEVER connect a GPS and don't want the overhead
- More code optimization (global Lat/Lon/Alt, no unused args), cruft removal, and commentary
(New as of [post=184798]2007-01-20[/post], most files improved) - Added UseLogging: Logging facility (record and playback)
- Removed UseGPS setting - the GPS functions aren't called when GPS is disabled, nobody defended it
- Modified DisableModule to bomb out if called with "Main" as the module
- Added UseStatus (code inspired by [thread=8280]supadave's[/thread])
- Added logMultiple for using multiple instances of NetStumbler (see instructions at top of ns04master.vbs; [thread=21863]NetStumbler 0.4 Helper[/thread] is recommended)
- FormatMP from MapPoint becomes ReducedPrecision; fewer calls, only for text
- Added UseRoadnav: Free realtime mapping of Detections and Crumb trail; best with 0.17 or later
- Added Winsock code (using OstroSoft Winsock Component) so Roadnav 0.16 is sufficient (but not ideal)
- BugFix for scripts running from path other than NetStumbler's (see posts [post=155486]80[/post],[post=155724]83[/post],[post=156917]96[/post])
(New as of [post=185143]2007-01-25[/post], minor errata and...) - Check variable settings, make sure (to some extent) that they're valid
- If ns04immed.vbs exists, read in when Scanning is enabled or disabled
To-do list:
- More error checking (if needed).
- Add support for more mapping programs. See ns04settings.vbs's Mapping section for some possibilities.
I've run it a lot (I'm now on WiGLE's top 10, although the rise above #35 is mostly due to Kismet), it was nice knowing when my DigiTraveler stopped sending updates (although now I use a Holux GPSlim236).
While it pays to have backups of data, after over 2100 downloads there have been few complaints.
Oh, these .ZIPs don't include any icons. I'm sure you can grab some from the [thread=10364]MapPoint+Speech thread[/thread].
If you want support for your mapping program, you MUST BE WILLING TO WORK FOR IT. Saying support of this or that would be nice - well, duh. On the positive side, ns04logger (introduced 2007-01) can be really helpful for testing.
Updated: [post=93046]2004-09-18[/post] ("ns04master", 13.8kB); previous (2004-09-16) had 16+2=18 views
Updated: [post=96888]2004-10-30[/post], new zip file (17.8kB) (removed after 500 downloads due to limit of five attachments, attached to [post=167656]post #100[/post])
Updated: [post=98971]2004-11-24[/post], new zip file (20.7kB); still haven't renamed old zip file (removed after 973 downloads due to limit of five attachments, attached to [post=184798]post #107[/post])
Updated: [post=126011]2005-06-30[/post], new zip file (24.8kB)
Updated: [post=154283]2006-02-28[/post], new zip file (32.4kB)
Updated: [post=167656]2006-06-29[/post], new zip file (37.4kB)
Updated: [post=184798]2007-01-20[/post], new zip file (46.7kB) (removed after 9 downloads due to five attachment limit and errata, attached to [post=185143]post #109[/post])
Updated: [post=185143]2007-01-25[/post], new zip file (48.7kB)