I'm having some difficulty debugging this.
Global $empty = "404040" ;Color of an empty bar in HEX
Global $Paused
HotKeySet("^!p", "TogglePause")
HotKeySet("^!z", "Start")
ToolTip('Ctrl-Alt-P = TogglePause | ESC - Quit | Ctrl-Alt-Z = Start',0,0)
Func CheckStam()
While $conts = 1
$checkstam = PixelGetColor( 891 , 12 ) ;Gets color of bar
If Hex($checkstam, 6) = $empty Then ; Converts $checkstam into Hex 6 chars long and compares to $empty.
Call("TogglePause") ; If both variables match the Func is called.
Else
Sleep(5000) ; Pauses and sends key and mouse commands until Variables above match.
Send("Q")
Sleep (500)
Send ("8")
Sleep(1000)
MouseClick ( "left" )
EndIf
WEnd
EndFunc
Func TogglePause()
$Paused = Not $Paused
While $Paused
Sleep(100)
ToolTip('Script is "Paused"', 0, 0)
WEnd
ToolTip('Shift-Alt-S - TogglePause | Shift-Alt-D - Start',0,0)
EndFunc ;==>TogglePause
The func runs when called, however when it hits the Else segment its only doing the mouse click and wont send the keys. Without a means to step through running code to see where it breaks I'm at a loss.
Any help would be greatly appreciated.