Code:
; screen resolution of 1280x800
; F10 start / stop leveling
Opt ("SendKeyDownDelay", 35); Global delay to hold down the key 35ms
Opt ("PixelCoordMode", 2)
Func _WinWaitActivate ($ title, $ text, $ timeout = 0)
WinWait ($ title, $ text, $ timeout)
If Not WinActive ($ title, $ text) Then WinActivate ($ title, $ text)
WinWaitActive ($ title, $ text, $ timeout)
EndFunc
ToolTip ("started, wait aa", 0, 0)
$ COUNTER = 0
HotKeySet ("{F10}", "StartOrStop"); hotkey start and stop if you need more than one copy of the script to run, use the other keys
HotKeySet ("{F11}", "Terminate")
Global $ STOP = True
Global $ AA_TITLE = "- ArcheAge"; Name of the client window. If you are using multi-window rename them differently and include your name exactly (better copy)
Global $ hp_color = 0x
; In this embodiment, the script will bind through HWND to the first found the window.
_WinWaitActivate ($ AA_TITLE, "")
Global $ hWnd = WinActive ($ AA_TITLE, "")
sleep (1000)
ToolTip ("aa found!", 0, 0)
Global $ BUFF1_COUNT = TimerInit ()
Global $ BUFF2_COUNT = TimerInit ()
Global $ BUFF3_COUNT = TimerInit ()
Global $ NeedShield = False
Global $ ShieldTryCount = 0
Do
Sleep (1000)
Until $ STOP = False
While (1)
Main ()
WEnd
; CHECKING HP LEVEL ===============================
Func CheckHP ($ xCoord, $ Color)
$ y = 37
if PixelSearch ($ xCoord, $ y, $ xCoord + 4, $ y + 4, $ Color, 30, 1, $ hWnd) <> 0 Then
Return True
Else
Return False
EndIf
EndFunc
Func hp90 ()
Return CheckHP (242, 0x62983B)
EndFunc
Func hp75 ()
Return CheckHP (191, 0x528C31)
EndFunc
Func hp50 ()
Return CheckHP (135, 0x3E7E25)
EndFunc
Func hp25 ()
Return CheckHP (70, 0x30741D)
EndFunc
; CHECKING MP LEVEL ===============================
Func CheckMP ($ xCoord, $ Color)
$ y = 52
if PixelSearch ($ xCoord, $ y, $ xCoord + 4, $ y + 4, $ Color, 30, 1, $ hWnd) <> 0 Then
Return True
Else
Return False
EndIf
EndFunc
Func mp90 ()
Return CheckMP (245, 0x4D76C8)
EndFunc
Func mp75 ()
Return CheckMP (191, 0x4064C3)
EndFunc
Func mp50 ()
Return CheckMP (135, 0x3351BC)
EndFunc
Func mp25 ()
Return CheckMP (70, 0x304DBA)
EndFunc
; CHECK TARGET ==================================
Func HaveTarget ()
; look at the mana bars mob in several places
$ y = 52
$ Color = 0x304DBB
$ xCoord = 525
$ px1 = PixelSearch ($ xCoord, $ y, $ xCoord + 2, $ y + 2, $ Color, 20, 1, $ hWnd)
$ xCoord = 573
$ px2 = PixelSearch ($ xCoord, $ y, $ xCoord + 2, $ y + 2, $ Color, 20, 1, $ hWnd)
if ($ px1 <> 0) or ($ px2 <> 0) Then
Return True
Else
Return False
EndIf
EndFunc
; ================================================= ==
Func Main ()
If $ STOP = False Then
$ df = TimerDiff ($ BUFF2_COUNT)
If $ df> 50000 Then
$ NeedShield = True
$ ShieldTryCount = 3
$ BUFF2_COUNT = TimerInit ()
EndIf
; if there is objective
If Not HaveTarget () Then
; no purpose
; check our MP
; if it is a little run regen
If (Not mp50 ()) Then
While (Not mp50 ())
ControlSend ($ hWnd, "", "", "{0}"); REGEN Mana or xn FLUTE
Sleep (1600)
$ BUFF1_COUNT = TimerInit ()
WEnd
Else
; if enough MP
; send turn to find the target
Opt ("SendKeyDownDelay", 700)
ControlSend ($ hWnd, "", "", "d")
Opt ("SendKeyDownDelay", 35)
EndIf
EndIf
if $ NeedShield Then
Sleep (200)
ControlSend ($ hWnd, "", "", "{9}"); Magic shield but you can leave the empty slot
Sleep (50)
$ ShieldTryCount = $ ShieldTryCount - 1
if ($ ShieldTryCount <= 0) Then
$ NeedShield = False
EndIf
else
Sleep (50)
; Only if you want to MP!
if (Not mp75 ()) Then
ControlSend ($ hWnd, "", "", "{8}"); The absorption of energy to make up for MP but you can leave the slot empty
Sleep (50)
EndIf
ControlSend ($ hWnd, "", "", "{1}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{2}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{3}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{4}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{5}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{6}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "{7}"); place for skill
Sleep (50)
ControlSend ($ hWnd, "", "", "f"); raise the drop
EndIf
Sleep (100)
$ COUNTER = $ COUNTER + 1
$ text = "some"
if hp90 () Then
$ text = "hp> 90"
ElseIf hp75 () Then
$ text = "hp> 75"
ElseIf hp50 () Then
$ text = "hp> 50"
ElseIf hp25 () Then
$ text = "hp> 25"
Else
$ text = "hp LOW"
EndIf
if mp90 () Then
$ text2 = "mp> 90"
ElseIf mp75 () Then
$ text2 = "mp> 75"
ElseIf mp50 () Then
$ text2 = "mp> 50"
ElseIf mp25 () Then
$ text2 = "mp> 25"
Else
$ text2 = "mp LOW"
EndIf
if HaveTarget () Then
$ text3 = "YES"
Else
$ text3 = "none"
EndIf
if $ STOP = False Then
ToolTip ("buff2 =" & ($ df) & "" & $ text & "" & $ text2 & "target =" & $ text3, 0, 0)
EndIf
Else
Sleep (100)
EndIf
EndFunc; ==> Main
Func StartOrStop ()
If $ STOP = True Then
; On START action
ToolTip ("STARTED! Press F10 for stop", 0, 0); clue about the state of the script in the upper left corner
$ STOP = False
Else
; On STOP action
; ColorCheck ()
ToolTip ("STOPPED! Press F10 for start", 0, 0)
$ STOP = True
EndIf
EndFunc
Func Terminate ()
Exit 0
EndFunc