I have this piece of code, problem is when it kill mob so no more color there, he waits untill bar from mob hp dissapear from screen then he send tab and aim other mob then attack. But it need to work like, send tab until you find color (that works), send keys to kill mob (that works), send tab again after mob is dead without waiting for 5-6 seconds (that dont works). And it send keys all time, when he kill mob or search for him
and i tried like this too and its same
Code:
Global $Run = False
HotKeySet("{F2}","_Attack")
If $pid Then
If WinExists($win) Then
WinActivate($win)
Sleep(1000)
WinMove($win, "", 0, 0, "1024", "768", 2)
Sleep(3000)
EndIf
Else
MsgBox(48, "Error", "Game is not running")
Exit
EndIf
While 1
Sleep(200)
WEnd
Func _Attack()
$Run = NOT $Run
While $Run
$find = PixelSearch(425, 20, 593, 29, $color)
If IsArray($find) Then
ControlSend($win, "", "", "{3}")
Sleep(2200)
ControlSend($win, "", "", "{4}")
Sleep(2200)
ControlSend($win, "", "", "{5}")
Sleep(2500)
Else
ControlSend($win, "", "", "{TAB}")
Sleep(300)
EndIf
WEnd
EndFunc
Code:
Func _Attack()
$Run = NOT $Run
While $Run
$find = PixelSearch(425, 20, 593, 29, $color)
If @error Then
ControlSend($win, "", "", "{TAB}")
Sleep(300)
Else
ControlSend($win, "", "", "{3}")
Sleep(2200)
ControlSend($win, "", "", "{4}")
Sleep(2200)
ControlSend($win, "", "", "{5}")
Sleep(2500)
EndIf
WEnd
EndFunc