| View previous topic :: View next topic |
| Author |
Message |
LuckyPimp
Joined: 12 Jan 2009 Posts: 1
|
Posted: Mon Jan 12, 2009 8:38 pm Post subject: Most simple script |
|
|
I want to create a script that clicks once at a specified time
So far all I have is this:
Click 1580 , 62
I can't seem to find the time function.
Thanks in advance |
|
| Back to top |
|
 |
DataLife
Joined: 27 Apr 2008 Posts: 369
|
|
| Back to top |
|
 |
niwi
Joined: 27 Feb 2005 Posts: 139 Location: Heidelberg, Germany
|
Posted: Tue Jan 13, 2009 10:47 am Post subject: |
|
|
Hi,
have a look at SetTimer.
Or, the easy way: use the task scheduler from Windows and call your script.
Regards, Nils. |
|
| Back to top |
|
 |
Tseik
Joined: 09 Oct 2008 Posts: 180 Location: Finland
|
Posted: Tue Jan 13, 2009 11:09 am Post subject: |
|
|
| Code: | SetTimer, TODO, 3000 ; run every third second
Return
TODO:
Click 1580 , 62
Return |
|
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 936 Location: Canada
|
Posted: Tue Jan 13, 2009 3:21 pm Post subject: |
|
|
| Code: |
Loop,
{
Sleep, 5000 ; checks every 5 seconds
if A_Hour = %what hour you want%
{
if A_Min = %what minet you want%
{
if A_sec = %what second u want%
{
MouseClick, Left, 1580, 62
}
}
}
} |
_________________
I know i have 6 legs. It's cuz I'm special. |
|
| Back to top |
|
 |
DataLife
Joined: 27 Apr 2008 Posts: 369
|
Posted: Tue Jan 13, 2009 4:19 pm Post subject: |
|
|
| SpiderGames wrote: | | Code: |
Loop,
{
Sleep, 5000 ; checks every 5 seconds
if A_Hour = %what hour you want%
{
if A_Min = %what minet you want%
{
if A_sec = %what second u want%
{
MouseClick, Left, 1580, 62
}
}
}
} |
| What are the chances that the seconds will match if your checking every 5 seconds. It very easily could skip the specified second.
Nice example though.
I think to match the second you would have to sleep for less then a second. Every second seems like it would work but you have to account for the time it takes to run the loop. If you sleep for 1 second, the loop probably would take 1 second and 40 milliseconds. Based on each line of code taking 10 milliseconds to complete. _________________ Unless otherwise stated, all code is untested
Check out my scripts.
http://www.autohotkey.net/~DataLife/MyIpChanger/MyIpChanger.ahk
http://www.autohotkey.net/~DataLife/XPSnap.ahk
http://www.autohotkey.net/~DataLife/SavePictureAs.ahk |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 936 Location: Canada
|
Posted: Wed Jan 14, 2009 12:28 pm Post subject: |
|
|
| Quote: | What are the chances that the seconds will match if your checking every 5 seconds. It very easily could skip the specified second.
Nice example though.
I think to match the second you would have to sleep for less then a second. Every second seems like it would work but you have to account for the time it takes to run the loop. If you sleep for 1 second, the loop probably would take 1 second and 40 milliseconds. Based on each line of code taking 10 milliseconds to complete. |
Set the seconds to 5 10 15 20 or something like that. Or you can just omit them if you dont really care. Setting the Sleep command to 900 would work too. _________________
I know i have 6 legs. It's cuz I'm special. |
|
| Back to top |
|
 |
Lighthouse
Joined: 12 Jan 2009 Posts: 55 Location: Southern Ca, USA
|
Posted: Thu Jan 15, 2009 4:21 pm Post subject: |
|
|
In the Seconds area you could easily make it work using:
If seconds >0 AND <=10
do this |
|
| Back to top |
|
 |
|