AutoHotkey Community

It is currently May 27th, 2012, 11:24 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: July 14th, 2009, 7:39 pm 
Offline

Joined: July 14th, 2009, 7:38 pm
Posts: 1
Hey,
I've coded in different languages before, but I'm just starting out with autohotkey. I've written a script (I think they're called scripts) that essentially does three things, it reads a document for a number, then uses that number to derive an amount of time that it should wait before looping another script I wrote (not shown below, but that's what's set off by the "send, #h")

I posted the relevant part of the code below:

Code:
Run C:\Documents and Settings\xefi\Desktop\AutoHotKey Scripts\Robert1.ahk
{

FileRead, Contents, C:\Documents and Settings\xefi\Desktop\Variable.txt
if not ErrorLevel  ; Successfully loaded.

{
NumListAcc1 = %Contents%
}
}

RepostTime = (80000+(22000*NumListAcc1))

loop 10
{
send, #h
sleep %RepostTime%
}


Because the number that is being read from the document is subject to change, I set it equal to a variable (NumListAcc1), and then try to multiply that variable by 22000 and add 80000 to make a new variable which I can tell the computer to "sleep" for between running #h. I'm sure this is just a syntax error, but if somebody could point me in the right direction, I'd be very very grateful. Thank you.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 14th, 2009, 7:45 pm 
Offline

Joined: March 24th, 2005, 11:50 am
Posts: 398
Location: germany
You are working with an expression, so you have to use :=

read about expressions in the Helpfile

RepostTime := (80000+(22000*NumListAcc1))


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group