Code:
Opt("SendKeyDownDelay",100) ;Important to have this or manually "keydown" & "keyup" instructions so that it actually registers the keypresses.
WinActivate("AION Client")
Sleep(10) ;give the time for the client to come to front
While 1
$coord = PixelSearch(127,26,127,26,0xC81B19,100)
;experiment with a range until you find it JUST works) ;you could also use the pixelget func- up to you it doesnt matter really
If not @error Then;if the color is not found
If PixelSearch(127,26,127,26) = 0xC81B19 Then
Sleep(10) ;AKA do nothing
Else
Send ("{-}") ;it presses "-"
Endif
EndIf
Sleep(500) ; if we don't put this sleep the auto-pot will keep the CPU used 100%
WEnd
Code:
Opt("SendKeyDownDelay",100) ;Important to have this or manually "keydown" & "keyup" instructions so that it actually registers the keypresses.
Ok I get the delay for the send keys, thanks forgot about that!
Code:
WinActivate("AION Client")
Sleep(10) ;give the time for the client to come to front
Ahh that is why my script was always paused probably, I didn't give it time to show up?
Code:
$coord = PixelSearch(127,26,127,26,0xC81B19,100)
This is the part that really confused me. This is the part of the loop that keeps looking at a spot in the hp bar and reading the color. The variable $coord does what though? It isn't used again in the script so why declare it?
PixelSearch(127,26,127,26,0xC81B19,100). Ok so it looks at 1 pixel (127,26) for a color within 100 shades of 0xC81B19 right? Well 0xC81B19 is my red color, so it is my color when I have health, is this the right value for this portion of the script?
Code:
If not @error Then;if the color is not found
If PixelSearch(127,26,127,26) = 0xC81B19 Then
Sleep(10) ;AKA do nothing
This confuses me also, big surprise! In your notes it said use the grey color code here. It seemed to me it was saying if (127,26) is grey I will do nothing. So I changed it to my red value, ELSE use pot.
This stuff is more interesting than playing the game, are there any online courses that teach autoit?