Quote:
Originally Posted by ikjahaa
gives me an error with the HP thing.
if i delete the if statement and only call the Died() function then it still doesn't work. only moves the cursor to the position but doesn't click
btw i use Win7 64-bit
|
the line with the HP=0 is only an example where you'd replace it with whatever routine you plan on using to tell when you are dead. I originally used a getpixelcolor check to see when the red ran out of the HP bar. This is what I used to check the HP
func IsAlive()
while $test=0xB1251C ; Red on HP bar
sleep(1000) ; Wait one second then test if dead
$test=pixelgetcolor(129,33,$id) ;B1251C=Alive else =Dead
WEnd ; exit only if HP bar is empty (dead)
endfunc
func Died()
WinActivate("Hero","")
Sleep(10000) ;Wait for timer to run out
MouseClick("left",836,635,1,1)
endfunc
While 1
isAlive() ; Loops as long as char is alive, checks every 1 second
Died() ; only gets here if char died, so revive
wend ;loop back thru and monitor HP