AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

This is probably day 1 stuff but...

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
TLMATX



Joined: 16 Jun 2008
Posts: 2

PostPosted: Mon Jun 16, 2008 1:28 am    Post subject: This is probably day 1 stuff but... Reply with quote

So I've read the tutorial, searched the index using some key words and tried the few different ways I could think of to write this script with no success. All I want to do is to have the mouse go to the coordinates below and click the left mouse button once, wait 60 seconds, then repeat until I pause or stop the script. Every one I write either doesn't work at all or it just clicks the mouse over and over again without waiting the 60 seconds. My guess is that there is a single symbol or something like that that I keep overlooking that is preventing my success. The script below doesn't work but thats what I have so far. Any help would be appreciated!

Thanks,
Tom


Loop

Click 119, 53

Sleep, 60000

^!p::Pause
Back to top
View user's profile Send private message
Red Hat Dude
Guest





PostPosted: Mon Jun 16, 2008 1:46 am    Post subject: Reply with quote

Code:

; x key starts clicking loop
x::
StopIt := 0
Loop
{
IfEqual, StopIt, 1, break
Click 119, 53
Sleep, 60000
}
return

; y key breaks it
y::
StopIt := 1
return

Yes, I really should take the time to look up the pause script. But this is currently how I tackle these things.
Back to top
aaaaaaaaaaaaaaa
Guest





PostPosted: Mon Jun 16, 2008 2:58 am    Post subject: Reply with quote

F1::
Loop
{
Click 119, 53
Sleep, 60000
}
return

F2::
suspend
return
Back to top
Superfraggle



Joined: 02 Nov 2004
Posts: 837
Location: London, UK

PostPosted: Mon Jun 16, 2008 3:18 am    Post subject: Reply with quote

loop wrote:
The loop command is usually followed by a block, which is a collection of statements that form the body of the loop. However, a loop with only a single command does not require a block (an if-else compound statement counts as a single command for this purpose).


You are missing the braces for the block in your script ie
Code:
Loop
 click ; as there are no braces only this line is looped
Sleep 60000 ; This line will not loop

Loop
{
Click
Sleep 60000
} ; Now we have enclosed both commands in the braces both commands will loop.

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
TLMATX



Joined: 16 Jun 2008
Posts: 2

PostPosted: Mon Jun 16, 2008 3:20 am    Post subject: Reply with quote

Thanks guys!
Red Hat Dude, that script works great oh and FYI the last line in my original script allows you to pause it with ctrl+alt+P

aaaaaaaaaaaaa thanks to you too. I didn't try yours because the first one worked but thanks anyway!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group