Hey guys, need some help.
I have a script that needs to Send 1,2,3,4 in a loop with a 10 second delay between each. I have also given 5 seconds before it actually starts. I also need to be able to Toggle pausing the loop
Here is what I have so far:
#p::Pause, toggle
Sleep, 5000
Loop
{
SetKeyDelay, 10000,
Send, 1
Send, 2
Send, 3
Send, 4
}
Return
the problem is if I remove the pause function (#p::Pause, toggle) the script will keep looping and still type out the 1234 repeatedly but when I add in the pause function the script doesn't do anything. I can see in the system tray that it is running and I can Pause and unpause it easily but nothing is typed out. any help would be appreciated
Need help with pauseing a looping script Topic is solved
Re: Need help with pauseing a looping script
Code: Select all
sleep, 5000
loop {
loop, 4 {
send, %A_index%
}
sleep, 10000
}
p::
pause
return
Re: Need help with pauseing a looping script
thanks, but this will type 1234 all at once, where as I need a gap between each number of about 10 seconds and I need to be able to pause it at any moment. Toggle is a built in function but it isn't necessary as pause defaults to toggle. with my original script above it does toggle on and off regardless of whether I have toggle written in or not.wryyymuda wrote: ↑31 Jan 2019, 21:07press p to pause, is toggle a built in function? if not then thats the problem.Code: Select all
sleep, 5000 loop { loop, 4 { send, %A_index% } sleep, 10000 } p:: pause return
I tried to modify your script to this
Code: Select all
sleep, 5000
loop {
loop, 1 {
SetKeyDelay, 1000
Send, 1
Send, 2
Send, 3
Send, 4
}
sleep, 10000
}
p::
pause
return
Re: Need help with pauseing a looping script Topic is solved
Look at this topic.
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=45616&p=206143
I don't think there is any other way to break out of the loop like you want it to.
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=45616&p=206143
I don't think there is any other way to break out of the loop like you want it to.
Re: Need help with pauseing a looping script
Thanks, it is basically to cycle through cameras and just stop when I need it to so this worked well for me thanksCuadrix wrote: ↑31 Jan 2019, 21:55Look at this topic.
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=45616&p=206143
I don't think there is any other way to break out of the loop like you want it to.
Re: Need help with pauseing a looping script
Why not put the gap of 10 seconds between each send?Saanage wrote: ↑31 Jan 2019, 22:17Thanks, it is basically to cycle through cameras and just stop when I need it to so this worked well for me thanksCuadrix wrote: ↑31 Jan 2019, 21:55Look at this topic.
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=45616&p=206143
I don't think there is any other way to break out of the loop like you want it to.
Partial code
Code: Select all
Send, 1
Sleep, 10000 ; 10 seconds
Send, 2
Sleep, 10000
Send, 3
Sleep, 10000
Send, 4
Sleep, 10000
WinExist() / IfWin[Not]Exist
https://autohotkey.com/docs/commands/WinExist.htm
WinActivate
https://autohotkey.com/docs/commands/WinActivate.htm
ControlSend
https://autohotkey.com/docs/commands/ControlSend.htm
Who is online
Users browsing this forum: garry, marypoppins_1, mikeyww, OrangeCat, RussF and 151 guests