Ore Aird wrote:
All I am trying to have the Script do is
Code:
soundbeep 250
Loop
Sleep 500
Soundbeep 50
MouseClick, left
Sleep, 10200
when I press a button, and stop when i press the same button really.
I like the status idea. might try give that a whirl.
I am sure tha not got what You want exactly, but try understand this logic to can, I hope, does the changes You need.
Code:
#Persistent
#SingleInstance
Process, Priority, , N
SetBatchLines, -1
F12::
If ( Status = 1 )
{
Status := 0
GoTo, Stop
}
Else
{
Status := 1
Counter := 0
GoTo, Action
}
Return
Action:
ToolTip, Initiated !`nStatus = %Status%`nCouter = %Counter% ; To tests, can delet after
Soundbeep 250
Sleep, 500 ;Seems very short, I hear only one beep. With 1500 play 2 beeps.
Counter += 1
If ( Status = 0 or Counter = 25)
GoTo, Stop
Soundbeep 50
MouseClick, left
SetTimer, Action102s, 10200
Return
Action102s:
SetTimer, Action102s, Off
If ( Status = 0 )
GoTo, Stop
;Here you put what you desire Action102s does each 10.2 seconds.
GoTo, Action ; like this
Return
Stop:
SetTimer, Action102s, Off
Status = 0
Counter = 0
ToolTip, Stoped !`nStatus = %Status%`nCouter = %Counter% ; To tests, can delet after
Sleep, 2000 ; To tests, can delet after
ToolTip, ; To tests, can delet after
Return
Note that the second Key command don't function if the script is running a loop, if there are some way to do this, someone more expert could explaine how, I can't. I think that any looping must end before hot keys turn reliable, by this I didn't used Loopings.