Hello! So I am new to Autoit but I understand the syntax a bit (Coming from C#)
And I created this function but for some reason it only clicks once (does the function one time)
then it stops, why is that?
HotKeySet("{ESC}", "myExit")
Global $needrest = False;
While 1
checkHealth()
WEnd
Func LC($x, $y)
MouseClick("left", $x, $y, 1, 1)
EndFunc
Func ViewReset()
MouseClick("left",551, 55,1,1)
Send("{UP down}")
EndFunc
Func checkHealth()
$needrest = True
$hpBar = PixelSearch(724, 58, 726, 61, 0x8A0502, 1)
;MsgBox(0,"test", "Your health is full")
if @error Then
$findFood = PixelSearch(556, 240, 738, 493,0xE44C1B,5)
If NOT(@error) Then
LC($findFood[0],$findFood[1]) ;this is the thing it only does once I want the checkHealth() function to loop
EndIf
While($needrest)
WEnd
EndIf
EndFunc
Func myExit()
MsgBox(0, "Exiting", "The Bot Has Quit")
Exit
EndFunc