AutoHotkey Community

It is currently May 26th, 2012, 2:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Most simple script
PostPosted: January 12th, 2009, 9:38 pm 
Offline

Joined: January 12th, 2009, 9:36 pm
Posts: 1
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 12th, 2009, 9:56 pm 
Online

Joined: April 27th, 2008, 5:28 pm
Posts: 489
Code:
FormatTime, SavedTimeVar ,   , HH:mm:ss
MsgBox Current Time is %SavedTimeVar%

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 13th, 2009, 11:47 am 
Offline

Joined: February 27th, 2005, 5:51 pm
Posts: 139
Location: Heidelberg, Germany
Hi,

have a look at SetTimer.

Or, the easy way: use the task scheduler from Windows and call your script.

Regards, Nils.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 13th, 2009, 12:09 pm 
Offline

Joined: October 9th, 2008, 6:04 am
Posts: 180
Location: Finland
Code:
SetTimer, TODO, 3000 ; run every third second
Return

TODO:
   Click 1580 , 62
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 13th, 2009, 4:21 pm 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
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
     }
   }
 }
}

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 13th, 2009, 5:19 pm 
Online

Joined: April 27th, 2008, 5:28 pm
Posts: 489
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.

_________________
Check out my scripts.
(MyIpChanger) (XPSnap) (SavePictureAs)

All my scripts are tested on Windows 7, AutoHotkey_L 32 bit Ansi unless otherwise stated.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 14th, 2009, 1:28 pm 
Offline

Joined: June 9th, 2008, 2:32 am
Posts: 936
Location: Canada
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.

_________________
Image
I know i have 6 legs. It's cuz I'm special.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 15th, 2009, 5:21 pm 
Offline

Joined: January 12th, 2009, 11:38 pm
Posts: 55
Location: Southern Ca, USA
In the Seconds area you could easily make it work using:

If seconds >0 AND <=10
do this


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, LazyMan, poserpro, Tilter_of_Windmills and 9 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