Var Screen_W = 1920
Var Screen_H = 1080
Var SearchArea_Left = 400
Var SearchArea_Top = 200
Var SearchArea_Right = 1520
Var SearchArea_Bottom = 800
Var HP_Check_X = 180
Var HP_Check_Y = 55
Var HP_Full_Color = "C81018"
Var MP_Check_X = 180
Var MP_Check_Y = 75
Var MP_Full_Color = "1840D0"
Var Mob_Color = "C80000"
Var Boss_Color = "FF00DC"
Var Loot_Color = "FFC800"
Var Color_Similarity = 0.9
Var HP_Potion_Key = "1"
Var MP_Potion_Key = "2"
Var Attack_Key_1 = "3"
Var Attack_Key_2 = "4"
Var Buff_Skill_Key = "5"
Var Loot_Key = "Z"
Var Attack_Retries = 15
Var Loot_Attempts = 4
Var vFoundX = 0
Var vFoundY = 0
label MainLoop
Var vRandomPause = GetRandom(250, 750)
Delay(%vRandomPause%)
label CheckHealth
GetColor(vCurrentColor, %HP_Check_X%, %HP_Check_Y%)
if(%vCurrentColor% <> %HP_Full_Color%)
KeyPress(%HP_Potion_Key%, 1)
Delay(500)
endif
GetColor(vCurrentColor, %MP_Check_X%, %MP_Check_Y%)
if(%vCurrentColor% <> %MP_Full_Color%)
KeyPress(%MP_Potion_Key%, 1)
Delay(500)
endif
FindColor(vFoundX, vFoundY, %SearchArea_Left%, %SearchArea_Top%, %SearchArea_Right%, %SearchArea_Bottom%, %Boss_Color%, %Color_Similarity%)
if(%vFoundX% > 0)
goto EngageTarget
endif
FindColor(vFoundX, vFoundY, %SearchArea_Left%, %SearchArea_Top%, %SearchArea_Right%, %SearchArea_Bottom%, %Mob_Color%, %Color_Similarity%)
if(%vFoundX% > 0)
goto EngageTarget
else
goto Reposition
endif
label EngageTarget
Var vClickX = %vFoundX% + GetRandom(-3, 3)
Var vClickY = %vFoundY% + GetRandom(-3, 3)
LeftClick(1, %vClickX%, %vClickY%)
Delay(GetRandom(400, 600))
for i from 1 to %Attack_Retries%
goto CheckHealth
KeyPress(%Attack_Key_1%, 1)
Delay(GetRandom(800, 1200))
KeyPress(%Attack_Key_2%, 1)
Delay(GetRandom(800, 1200))
GetColor(vTargetColor, %vClickX%, %vClickY%)
if(%vTargetColor% <> %Mob_Color% AND %vTargetColor% <> %Boss_Color%)
Delay(1000)
goto Loot
endif
next
goto MainLoop
label Loot
for i from 1 to %Loot_Attempts%
KeyPress(%Loot_Key%, 1)
Delay(GetRandom(150, 300))
next
goto MainLoop
label Reposition
Comment("No target found. Repositioning character...")
if(GetRandom(1, 10) == 1)
KeyPress(%Buff_Skill_Key%, 1)
Delay(GetRandom(2000, 3000))
endif
Var vMoveX = GetRandom(%SearchArea_Left%, %SearchArea_Right%)
Var vMoveY = GetRandom(%SearchArea_Top%, %SearchArea_Bottom%)
LeftClick(1, %vMoveX%, %vMoveY%)
Delay(GetRandom(3000, 7000))
goto MainLoop
goto MainLoop