 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
If statements and loops Guest
|
Posted: Fri Oct 09, 2009 4:46 am Post subject: Don't seem to work well together? |
|
|
Let me give you some background information on what I am trying to do here.
What my goal is with this script is for it to check my system clock, if the time in the clock = 09:00, then it should run the program in the directory I have selected.
Everything works fine, just one issue. The script will work if I set the time to load the program equal to the time it currently is then run it. However, if I set the time to run the program a few (I am using 1 just to speed things up) minutes ahead of when I execute the script, it will never run the program.
My if statement is in a loop, this does not solve the issue. The console is checking for the time but for some reason the if will not return true, even if it is.
I'm having a sort of difficult time explaining this..bottom line is..how can I get the script to keep refreshing the if statement? And when the requirements are met..do whats in the {}?
| Code: |
FormatTime, TimeString, HH:mm, HH:mm
Loop{
If TimeString = 00:45 ;Its 12:45 here
{
Run C:\Program FIles\Program\Program.exe
exit
}
}
|
|
|
| Back to top |
|
 |
Z_Gecko Guest
|
Posted: Fri Oct 09, 2009 5:05 am Post subject: |
|
|
| Code: | Loop
{
FormatTime, TimeString, HH:mm, HH:mm
If TimeString = 00:45 ;Its 12:45 here
{
Run C:\Program FIles\Program\Program.exe
break
}
} |
|
|
| Back to top |
|
 |
OP Guest
|
Posted: Fri Oct 09, 2009 5:11 am Post subject: |
|
|
| Z_Gecko wrote: | | Code: | Loop
{
FormatTime, TimeString, HH:mm, HH:mm
If TimeString = 00:45 ;Its 12:45 here
{
Run C:\Program FIles\Program\Program.exe
break
}
} |
|
Thanks |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|