Script to export data from NS

Take a script, leave a script - Like the penny tray only different

Script to export data from NS

Postby Garfield » Mon Jul 17, 2006 8:06 am

[font="Arial"][SIZE="2"]I was searching for a script to export data from NS automatically. As I didn't find anything that was right for me, I wrote this script on my own.


Option Explicit

const milliseconds = 10000

Dim WSH

Set WSH = WScript.CreateObject("WScript.Shell")

'Starting netstumbler
WSH.Run("netstumbler.exe")
WScript.Sleep(milliseconds)
'Exporting data
WSH.SendKeys("%F")
WSH.SendKeys("p")
WSH.SendKeys("T")
WSH.SendKeys("data.txt")
WSH.SendKeys("~")
'Closing netstumbler
WSH.SendKeys("%F")
WSH.SendKeys("x")
WSH.SendKeys("N")


Be aware: I'm new in writing scripts, therefore this code is NOT optimal, but it works :D .

I'm currently working on the script (to hopefully, improve it :) ), therefore I haven't commented the script perfectly yet. After I have finished the script, I'll update it.

As I already mentioned, I'm new in scripting and I have only little experience with NS, therefore I'm open for any help and advice.

Is there another way to get the channel, other than exporting the data? The functions that NS provide (mentioned in the scripting guide) do not have any parameter "channel" :( .

I'd like to access data on the used channel, signal strength, ... from a program written in C#. Is there a better way to get the data?

Thanks for any help in advance.[/SIZE][/font]
User avatar
Garfield
Mini Stumbler
 
Posts: 3
Joined: Mon Jul 17, 2006 3:53 am

Postby Garfield » Wed Jul 26, 2006 11:42 pm

[font="Arial"][SIZE="2"]This is the final version of the script (as I am using it).


Option Explicit

Const path = "C:\netstumbler\"
Const milliseconds = 10000

Dim FSO, WSH

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = WScript.CreateObject("WScript.Shell")

'Deleting old data
If FSO.FileExists(path + "exportedData.txt") Then
FSO.DeleteFile(path + "exportedData.txt")
End If

'Starting netstumbler
WSH.Run(path + "netstumbler.lnk")

'Netstumbler has to gather data before any data can be exported
WScript.Sleep(milliseconds)

'Exporting data
WSH.SendKeys("%F")
WSH.SendKeys("p")
WSH.SendKeys("S")
WSH.SendKeys(path + "exportedData.txt")
WSH.SendKeys("~")

'Closing netstumbler
WSH.SendKeys("%F")
WSH.SendKeys("x")
WSH.SendKeys("N")


I am open for any comments or advice, how to improve the script.[/SIZE][/font]
User avatar
Garfield
Mini Stumbler
 
Posts: 3
Joined: Mon Jul 17, 2006 3:53 am

Postby beakmyn » Thu Jul 27, 2006 2:46 am

Garfield wrote:[font="Arial"][SIZE="2"]This is the final version of the script (as I am using it).


Option Explicit

Const path = "C:\netstumbler\"
Const milliseconds = 10000

Dim FSO, WSH

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = WScript.CreateObject("WScript.Shell")

'Deleting old data
If FSO.FileExists(path + "exportedData.txt") Then
FSO.DeleteFile(path + "exportedData.txt")
End If

'Starting netstumbler
WSH.Run(path + "netstumbler.lnk")

'Netstumbler has to gather data before any data can be exported
WScript.Sleep(milliseconds)

'Exporting data
WSH.SendKeys("%F")
WSH.SendKeys("p")
WSH.SendKeys("S")
WSH.SendKeys(path + "exportedData.txt")
WSH.SendKeys("~")

'Closing netstumbler
WSH.SendKeys("%F")
WSH.SendKeys("x")
WSH.SendKeys("N")


I am open for any comments or advice, how to improve the script.[/SIZE][/font]


Get rid of the constant. As is stands I wouldn't be able to run it out without modifying the script, not usually a good thing. You should be able to determine your current directory and work from there. Even then you're relying on having a shortcut to the application in that directory. You should be able to determine where Netstumbler is and shell it directly.
beakmyn
 
Posts: 4858
Joined: Sun Aug 03, 2003 1:53 pm

Postby blade_pan » Fri Oct 27, 2006 1:46 am

So does this script works fine?

Specifically what does this script do exactly?

It takes SNR and signal and exports them to a txt in real time?

Can i measure the wireless signal of a building with this script more easily?


sorry for questioning so much...:p
blade_pan
Mini Stumbler
 
Posts: 1
Joined: Fri Oct 27, 2006 1:16 am

Postby streaker69 » Fri Oct 27, 2006 1:51 am

blade_pan wrote:So does this script works fine?

Specifically what does this script do exactly?

It takes SNR and signal and exports them to a txt in real time?

Can i measure the wireless signal of a building with this script more easily?


sorry for questioning so much...:p


Only if you have a card that properly measures SNR.
Treat your gun like your genitals, only whip it out when it's absolutely necessary.
User avatar
streaker69
 
Posts: 11867
Joined: Thu Jul 08, 2004 10:09 am
Location: Virginville, BlueBall, Bird In Hand, Intercourse, Paradise, PA

Postby G8tK33per » Fri Oct 27, 2006 2:30 am

streaker69 wrote:Only if you have a card that properly measures SNR.

Here we go....
"Make yourselves sheep and the wolves will eat you." ~ Benjamin Franklin

Sons of Confederate Veterans
User avatar
G8tK33per
 
Posts: 6078
Joined: Fri May 09, 2003 4:00 am
Location: Goomba's Booty Boardwalk

Postby streaker69 » Fri Oct 27, 2006 3:50 am

G8tK33per wrote:Here we go....


Yes, much like the "clack clack clack" of a RollerCoaster.
Treat your gun like your genitals, only whip it out when it's absolutely necessary.
User avatar
streaker69
 
Posts: 11867
Joined: Thu Jul 08, 2004 10:09 am
Location: Virginville, BlueBall, Bird In Hand, Intercourse, Paradise, PA

Postby Airstreamer » Fri Oct 27, 2006 6:30 am

Damn, now buildings radiate RF? Whaddid I miss? :rolleyes:
"But when we disarmed They sold us and delivered us bound to our foe,
And the Gods of the Copybook Headings said: "Stick to the Devil you know.""

- Rudyard Kipling
User avatar
Airstreamer
 
Posts: 2703
Joined: Sun Nov 07, 2004 9:26 pm
Location: A little North of Reason

Postby princedag » Sat Oct 28, 2006 11:20 pm

how do i get this script to work? sorry but i dont know nothing about scripts:) so can u get the script ready to download and install maybe:) plsssssssssssssssss
princedag
Mini Stumbler
 
Posts: 3
Joined: Sat Oct 28, 2006 11:08 pm

Postby Airstreamer » Sat Oct 28, 2006 11:27 pm

princedag wrote:how do i get this script to work? sorry but i dont know nothing about scripts:) so can u get the script ready to download and install maybe:) plsssssssssssssssss

Well, for starters, for proper script operation, an uppercase function is required. It is generally included on your keyboard in two places, one on the left usually next the 'z' key, and on the right, next to the "/" key. Your keyboard apparently lacks this function, plus it appears to have a stuck 's' key.

Read the Welcome Desk posts, NOW.
"But when we disarmed They sold us and delivered us bound to our foe,
And the Gods of the Copybook Headings said: "Stick to the Devil you know.""

- Rudyard Kipling
User avatar
Airstreamer
 
Posts: 2703
Joined: Sun Nov 07, 2004 9:26 pm
Location: A little North of Reason

Postby theprez98 » Sun Oct 29, 2006 4:39 am

princedag wrote:how do i get this script to work? sorry but i dont know nothing about scripts:) so can u get the script ready to download and install maybe:) plsssssssssssssssss

Some spoonfeeding may be required...
Attachments
shift.gif
shift.gif (17.38 KiB) Viewed 2429 times
[font="Courier New"]"\x74\x68\x65\x70\x72\x65\x7a\x39\x38";[/font]
User avatar
theprez98
 
Posts: 3638
Joined: Tue Jan 11, 2005 8:23 pm
Location: Maryland

Postby MikeP928 » Sun Oct 29, 2006 7:19 am

princedog wrote:how do i get this script to work? sorry but i dont know nothing about scripts:) so can u get the script ready to download and install maybe:) plsssssssssssssssss


I'll second that comment. It pretty much covers the issue.

MikeP
Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote.
-- Benjamin Franklin, 1759
User avatar
MikeP928
 
Posts: 1122
Joined: Wed May 01, 2002 8:09 pm
Location: Florida Panhandle

Postby Garfield » Tue Nov 07, 2006 7:51 am

Originally Posted by princedag
how do i get this script to work? sorry but i dont know nothing about scripts so can u get the script ready to download and install maybe plsssssssssssssssss


Hi princedag,

I was and still am new in scripting and it took me less than a day to figure out how to run a script and less than a week to write the script. So if you would just try to figure it out, I think you would succeed.

But
I would have also been very glad, if I didn't have had to figure it out on my own. So here is an explanation how to get the script to work.:D

1. Create (in Windows) a new text file and save it as ExportData.vbs. => Windows knows, hey it's a script.

2. Copy and paste the code into the vbs-file and save it.

3. Create a folder netstumbler.

4. Create a link to netstumbler and save it in the folder netstumbler.

5. Double-click the vbs-file and it will work. Or execute the vbs-file somehow else.

If it still doesn't work, hmmmmm..................
(try to figure it out)

Cheers!
User avatar
Garfield
Mini Stumbler
 
Posts: 3
Joined: Mon Jul 17, 2006 3:53 am

exporting data

Postby suemy » Thu Nov 23, 2006 6:40 pm

hi all
I don't know much abt scripting so I would like to know what does this script really do? Does it convert ns file to a text file? And could it be used to periodically export real-time data from netstumbler to be used in an application?:confused:
suemy
Mini Stumbler
 
Posts: 5
Joined: Tue Nov 14, 2006 4:55 am


Return to Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

cron