I am currently using AHK but i feel the pixelsearch in AutoIt works better.
So fare i have changed the desired sprites in the game so they have a blue square with hexcolor 0x0000FF, that i use durring pixelsearch, and a part that checks for my HP and pots if nessesary.
My problem is in AHK i could do Click, x, y, down to attack a monster for a specific amount of time. Cant rly seem to get that to work in AutoIt - the mouseMove then mouseDown seems unreliable.
Also any suggestions on anything i can improve ?
Code:
HotKeySet("!q", "Terminate")
HotKeySet("!a", "attackLoop")
HotKeySet("!e", "autoPot")
WinActivate("Lineage")
Global $interval
$interval = 5000
$hpcolor = 0x7B3029
Func Terminate()
Exit 1
EndFunc
Local $aColorArray[1] = [ 0x0000FF]
Func attackLoop()
While 1
$point = PixelSearch(275,192,445,296,$aColorArray) %% Search a small box around target for monsters
$point2 = PixelSearch(228,158,350,252,$aColorArray) %% search a bigger box around target for monsters
if IsArray($point) Then
MouseMove($point[0], $point[1])
MouseDown("left")
Sleep($interval)
MouseUp("left")
ElseIf IsArray($point2) Then
MouseMove($point2[0], $point2[1])
MouseDown("left")
Sleep($interval)
MouseUp("left")
Else
Send("{F7}") % Random teleports to a new area.
Sleep(3000)
EndIf
Sleep(50)
WEnd
EndFunc
Func autoPot()
While 1
$pot = PixelGetColor(110,437)
if $pot = $hpcolor Then
sleep(1000)
Else
Send("{F5}")
sleep(1000)
EndIf
WEnd
EndFunc
While 1
Sleep(250)
WEnd







