 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Cyn Guest
|
Posted: Mon Feb 02, 2009 9:00 pm Post subject: Start/Stop correctly |
|
|
Hello
I made this script, basically i want it to start when i press ctrl alt x and stop when i press ctrl alt y. Now when it stops it needs to go back to the beginning, and start the process again.
Here is what i have.
| Code: | ; ctrl-alt-x key starts clicking loop
^!x::
StopIt := 0
Loop
{
IfEqual, StopIt, 1, break
Send, R
sleep, 3000
Send, 1
Sleep, 3000
Click
Sleep, 11000
Click
Sleep, 11000
Click
Sleep, 11000
Click
Sleep, 11000
Click
Sleep, 11000
Click
Sleep, 11000
Click
Sleep, 11000
}
return
; ctrl-alt-y key breaks it
^!y::
StopIt := 1
return |
At the moment it wont stop until its finished going down the list back to the top but if i wanted to stop it say after the 3rd click then when the button is pressed to start it goes to Send, R. do you know what i mean? |
|
| Back to top |
|
 |
evan Guest
|
Posted: Mon Feb 02, 2009 9:10 pm Post subject: |
|
|
| Code: | ^!x::
settimer, aa
return
^!y::
settimer, aa, off
return
aa:
do this
and that
return |
|
|
| Back to top |
|
 |
cyn Guest
|
Posted: Mon Feb 02, 2009 9:16 pm Post subject: |
|
|
it didnt seem to work, the button was still being clicked after i ctrl alt y.
here is the full script incase im missing anything
| Code: | ; ctrl-alt-x key starts it and ctrl-alt-y stops it
^!x::
settimer, aa
return
^!y::
settimer, aa, off
return
aa:
Send, R
sleep, 3000
Send, 1
Sleep, 3000
MouseClick, left, 663, 705
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Click
Sleep, 4000
Send, r
Sleep, 3000
send, 0
Click
Sleep, 180000
send, w
Sleep, 3000
MouseClick, left, 663, 705
return
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs. |
|
|
| Back to top |
|
 |
poo_noo
Joined: 08 Dec 2006 Posts: 248 Location: Sydney Australia
|
Posted: Tue Feb 03, 2009 9:50 am Post subject: |
|
|
Put your Click /sleep 4000 into a loop. this is a little shorter.
| Code: | ctrl-alt-x key starts it and ctrl-alt-y stops it
^!x::
settimer, aa
return
^!y::
settimer, aa, off
return
aa:
Send, R
sleep, 3000
Send, 1
Sleep, 3000
MouseClick, left, 663, 705
loop 40
{
Click
Sleep, 4000
}
Send, r
Sleep, 3000
send, 0
Click
Sleep, 180000
send, w
Sleep, 3000
MouseClick, left, 663, 705
return
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs. |
_________________ Paul O |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 03, 2009 11:19 am Post subject: |
|
|
This script does not stop. It just.keeps.going.
For the sake of my mental state can somebody else test it and confirm it will not stop running with ctrl alt y or any other letter. |
|
| Back to top |
|
 |
Robbo
Joined: 27 Jul 2008 Posts: 47 Location: England
|
Posted: Tue Feb 03, 2009 1:11 pm Post subject: |
|
|
| Code: | ;ctrl-alt-x key starts it and ctrl-alt-y stops it
^!x::
GoSub Start
Return,
^!y::
GoSub Start
Return,
Start:
Send, R
sleep, 3000
Send, 1
Sleep, 3000
MouseClick, left, 663, 705
loop 40
{
Click
Sleep, 4000
}
Send, r
Sleep, 3000
send, 0
Click
Sleep, 180000
send, w
Sleep, 3000
MouseClick, left, 663, 705
return
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs. |
Unfortunatly I'm at school right now and can't test it... Tell me if it works! _________________ All scripts are untested unless otherwise mentioned. |
|
| Back to top |
|
 |
Robbo
Joined: 27 Jul 2008 Posts: 47 Location: England
|
Posted: Tue Feb 03, 2009 1:14 pm Post subject: |
|
|
If you want ^!y to pause it and not restart it then try this:
| Code: | ;ctrl-alt-x key starts it and ctrl-alt-y pauses it
^!x::
GoSub Start
Return,
^!y::
Pause
Return,
Start:
Send, R
sleep, 3000
Send, 1
Sleep, 3000
MouseClick, left, 663, 705
loop 40
{
Click
Sleep, 4000
}
Send, r
Sleep, 3000
send, 0
Click
Sleep, 180000
send, w
Sleep, 3000
MouseClick, left, 663, 705
return
; Note: From now on whenever you run AutoHotkey directly, this script
; will be loaded. So feel free to customize it to suit your needs. |
Press ^!y to unpause it again. _________________ All scripts are untested unless otherwise mentioned. |
|
| Back to top |
|
 |
cyn Guest
|
Posted: Tue Feb 03, 2009 1:18 pm Post subject: |
|
|
| that pause is definitely usefull. But i still need to bind keystrokes to stop the script and return to the beginning . i was looking at the website and i was thinking the Goto command. would this be used to go back to the start which is the Send, R command. |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 03, 2009 1:22 pm Post subject: |
|
|
| and that other script didnt work, it just kept clicking. |
|
| Back to top |
|
 |
cyn Guest
|
Posted: Tue Feb 03, 2009 2:43 pm Post subject: |
|
|
| anyone have any ideas? |
|
| Back to top |
|
 |
Guest
|
Posted: Tue Feb 03, 2009 3:11 pm Post subject: |
|
|
hurray i did it
for future reference to anyone i used the exit command if break is 1 during the loop. pressing the x key started from the beginning |
|
| 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
|