Im trying to do a script that:
1) press L every 3 seconds (because in the game you have to press it to Target the enemy)
2) Search the enemy bar for the pixelcolor that equals red (which means he still has HP) and hit E while is still red
Basically, target the enemy every 3 seconds, and while he is alive, hit him. So when he is dead, i dont keep hitting the air. The enemy respawn every 30 seconds, but i have no way to predict how long will take for him to die, since is a multiple player raid.
It work, but once E start pressing it wont ever stop, even when the enemy is dead, and wont even press L again.
Here is my code, if anyone can help me:
Code: Select all
#SingleInstace Force
keydelay = 100
weapondelay = 550
;x1,y1 = 1360,74 x2,y2 = 1090,105. color from hp: b92929
loopL:
{
Send {L down}
Sleep, % keydelay
Send {L up}
Sleep, % keydelay
}
-::
SetTimer, loopL, 3000
PixelSearch, 1360, 74, 1090, 105, 0xb92929, 10, RGB
while (Errorlevel = 0)
Loop, {
Send {E down}
Sleep, % keydelay
Send {E up}
Sleep, % weapondelay
}