![]() |
|
|
#1 (permalink) |
|
Sharp MM10 Lover
Join Date: Aug 2004
Location: Wales
Posts: 58
|
Range Sounder
hi guys
im trying to create a script that when an access point is in range i here audiable beeps deepending on the current SNR. I rarely have more then 1 ap active at anyone time. im new to net stumbler so im not sure the functions that i can use i want there to be a pause inbetween the beeps relating to the current SNR instead of OnScanResult will need to use something like OnAPActive i will want this to run constantly whilst im running ns, in a way it will help me to locate the best snr quickly and easily Sub OnScanResult(BestSNR) If BestSNR >= 60 Then PlaySound "beep.WAV" ElseIf BestSNR >= 50 Then WAIT(NOW()+"00:00:00.2") PlaySound "beep.WAV" ElseIf BestSNR >= 40 Then WAIT(NOW()+"00:00:00.4") PlaySound "beep.WAV" ElseIf BestSNR >= 30 Then WAIT(NOW()+"00:00:00.6") PlaySound "beep.WAV" ElseIf BestSNR >= 20 Then WAIT(NOW()+"00:00:00.8") PlaySound "beep.WAV" ElseIf BestSNR >= 10 Then WAIT(NOW()+"00:00:01") PlaySound "beep.WAV" Else End If End Sub p.s. do i simply put paste this into notepad and save as *.txt
__________________
Why play deathmatch when you can play dominoes? |
|
|
|
|
|
#3 (permalink) | |
|
Did you do the math?
Join Date: Apr 2002
Location: Villa Straylight
Posts: 10,000
|
Quote:
__________________
Thorn Sex and Violence. You can't enjoy one, if you don't survive the other. (And that works both ways...) |
|
|
|
|
|
|
#4 (permalink) |
|
Sharp MM10 Lover
Join Date: Aug 2004
Location: Wales
Posts: 58
|
but where do i adjust this default script?
i cant find it anywhere in the ns program folder by finding the default script i could learn how it works and slowly make adjustments to suit my preferences
__________________
Why play deathmatch when you can play dominoes? |
|
|
|
|
|
#5 (permalink) | ||
|
Did you do the math?
Join Date: Apr 2002
Location: Villa Straylight
Posts: 10,000
|
Quote:
Quote:
The first time is a freebie. After this, you'll need to figure out how to do your own searches, or you'll get flamed to death. Code:
' Default event handler script 'Sub OnEnableScan ' PlaySound "SSROAM.WAV" 'End Sub 'Sub OnDisableScan ' PlaySound "SSROAM.WAV" 'End Sub 'Sub OnScanStart ' PlaySound "Windows XP Balloon.WAV" 'End Sub 'Sub OnScanResult(SSID, BSSID, CapFlags, Signal, Noise, LastSeen) ' NOT YET ' SSID : String : SSID (Network name) ' BSSID : String : BSSID (MAC address) ' CapFlags : Integer : 802.11 capability flags ' Signal : Integer : signal level (dBm) ' Noise : Integer : noise level(dBm) ' LastSeen : Time : When this BSSID was last seen 'End Sub Sub OnScanComplete(FoundNew, SeenBefore, LostContact, BestSNR) ' NOT YET ' FoundNew : Integer : Count of new BSSIDs ' SeenBefore : Integer : Count of not-new BSSIDs ' LostContact : Integer : Count of BSSIDs missed since last scan ' BestSNR : Integer : SNR of strongest signal (dBm) ' MsgBox "OnScanComplete " & FoundNew & " " & SeenBefore & " " & LostContact & " " & BestSNR If FoundNew>0 Then PlaySound "ns-aos-new.WAV" ElseIf LostContact>0 Then PlaySound "ns-los.WAV" ElseIf SeenBefore>0 Then ' Still seeing some If BestSNR >= 60 Then PlaySound "ns-signal-6.WAV" ElseIf BestSNR >= 50 Then PlaySound "ns-signal-5.WAV" ElseIf BestSNR >= 40 Then PlaySound "ns-signal-4.WAV" ElseIf BestSNR >= 30 Then PlaySound "ns-signal-3.WAV" ElseIf BestSNR >= 20 Then PlaySound "ns-signal-2.WAV" ElseIf BestSNR >= 10 Then PlaySound "ns-signal-1.WAV" Else PlaySound "ns-signal-0.WAV" End If Else ' Nothing seen ' PlaySound "ns-tick.WAV" End If End Sub Dim GPSOk GPSOk = True Sub OnGPSTimeout If GPSOk Then GPSOk = False PlaySound "ns-gps-err.WAV" End If End Sub Sub OnGPSNoFix If GPSOk Then GPSOk = False PlaySound "ns-gps-err.WAV" End If End Sub Sub OnGPSPosition (Lat, Lon, Alt) ' Lat : double : Latitude, degrees east ' Lon : double : Longitude, degrees north ' Alt : double : Altitude above sea level, meters GPSOk = True End Sub 'Sub OnGPSSpeed (Speed) ' Speed : double : Speed, knots 'End Sub
__________________
Thorn Sex and Violence. You can't enjoy one, if you don't survive the other. (And that works both ways...) |
||
|
|
|
|
|
#6 (permalink) |
|
Knight Tooth Puller
Join Date: Aug 2004
Location: Bellevue, WA, USA
Posts: 182
|
Another (arguably better) alternative would be to enable MIDI (last tab of Options). Many modern sound cards support it, and the pitch will change depending on how near/far you are, and it's quicker than playing a sound file - check it out!
|
|
|
|