FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister   ProfileProfile    Log inLog in   RSS Feed

help needed with script

 
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows
View previous topic :: View next topic  
Author Message
woodrave
Newbie


Joined: 18 Apr 2008
Posts: 4

PostPosted: Sun Apr 20, 2008 2:40 pm    Post subject: help needed with script Reply with quote

Hello,
I'm a last year student engineering and I'm working on my thesis.
I have to build a sensor network with IEEE 802.15.4 ( that's done yet ) and I made a connection to my computer from the coordinator module trough USB.
Thanks to a little visual basic program I wrote, I managed to get some values, like temperature and field strength and acceleration from my module, and show them on the screen in a GUI. That is al done, but now I thought it would be a very nice extra if I could send some of those values to my telephone using bluetooth. Salling Clicker looks really interesting to me if I am able to write a little script for this. The only problem is, I am not used to write Jscript, and I don't have very much time left... On the other hand I don't think this application is very difficult. I could for instance write the values to a file, and let salling clicker read the file and send those values to the phone. It's enough if i can get just 4 values on my screen, without much more.
I would love to learn working with Jscripts and salling clicker, but I'm affraid I don't have the time now to learn it all, so I would really appreciate it if someone could help me out or tell me how to get started!

Thanks a lot,

Bert
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Sun Apr 20, 2008 4:18 pm    Post subject: Reply with quote

Hey

If you can write the values to a file, it's no problem at all. Just provide some information [absolute path to file, rows you want to view on phone ..].

I can write the script in a few minutes.

<Edit>
I've attached a sample script. All you have to do is put Textfile.txt to C:\ , move the folder to My Clicker Scripts and add 'ReadFile' to Items.

When the txtfile is altered, it should also update on the phone.



ReadFile.zip
 Description:

Download
 Filename:  ReadFile.zip
 Filesize:  1.1 KB
 Downloaded:  725 Time(s)

Back to top
View user's profile Send private message
woodrave
Newbie


Joined: 18 Apr 2008
Posts: 4

PostPosted: Sun Apr 20, 2008 5:05 pm    Post subject: Reply with quote

Thanks a lot man!

I was just typing some information for you, but you where to quick :wink:

Really appreciate it!

Bert
Back to top
View user's profile Send private message
woodrave
Newbie


Joined: 18 Apr 2008
Posts: 4

PostPosted: Sun Apr 20, 2008 5:07 pm    Post subject: Reply with quote

Oh just another question, can I just change the textfile while the program is running, or will I get errors?

Just tried it, and it works just fine,

thanks a lot
Back to top
View user's profile Send private message
joeker
Junior Member


Joined: 31 Mar 2007
Posts: 58

PostPosted: Sun Apr 20, 2008 6:28 pm    Post subject: Reply with quote

yeah, you can change the file while running ..
I wouldn't recommend deleting it because there's no error checking for that case .. but you can add this code to make sure:

//edit callquerylist function

function callquerylist() {
check();
...

//------------------------
//append to end

function check() {
var verify = fso.FileExists(file);
if( verify == false ) {
create();
}
}

function create() {
fso.CreateTextFile( file );
var ForAppending ="8";
var ts = fso.OpenTextFile( file , ForAppending);
ts.WriteLine( "nothing" );
ts.Close();
}
Back to top
View user's profile Send private message
simbo
Senior Member


Joined: 28 Jul 2006
Posts: 78
Location: UK

PostPosted: Tue Apr 22, 2008 11:51 am    Post subject: Reply with quote

A couple of years ago I wrote a proof-of-concept of a script to view SpeedFan data (a tool that monitors PC temp sensors) via Clicker. Seems a close fit (and reads text files) - might want to take a look here: http://www.salling.com/forums/viewtopic.php?t=5113
Back to top
View user's profile Send private message
woodrave
Newbie


Joined: 18 Apr 2008
Posts: 4

PostPosted: Mon Apr 28, 2008 2:52 pm    Post subject: Reply with quote

Hello,

sorry for the late reply, but i've been busy programming :wink:

thanks to simbo and joeker for your help, it's working now :D

grtz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Salling Software Forums Forum Index -> Scripting Salling Clicker for Windows All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group