Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, pixel, Client
CoordMode, mouse, Client
;#############################
; Global
;#############################
global Char5
global Char4
global Char3
global Char2
global Char1
global Panic_Heal
global Instant_Heal
global Holy_Light
global Flash_Of_Light
global AoE
HP_col = 0xF58CBA
;#############################
; Setting - Change as needed
;#############################
Char5 = F1
Char4 = F2
Char3 = F3
Char2 = F4
Char1 = F5
Panic_Heal = !0
Instant_Heal = !1
Holy_Light = !2
Flash_Of_Light = !3
AoE = !4
;======================
;#############################
; Hotkey
;#############################
F7::
;#############################
; AoE 50%HP
;#############################
{ ;; <--- Is this right?
PixelSearch,,, 1242, 542, 1243, 543, HP_col, 5, RGB ; Krenn HP 50%
if ErrorLevel
{
PixelSearch,,, 957, 542, 958, 543, HP_col, 5, RGB ; Ilia HP 50%
if ErrorLevel
{
PixelSearch,,, 1099, 542, 1100, 543, HP_col, 5, RGB ; Kostus HP 50%
if ErrorLevel
{
PixelSearch,,, 813, 542, 814, 543, HP_col, 5, RGB ;Dreyel HP 50%
if ErrorLevel
{
PixelSearch,,, 671, 542, 672, 543, HP_col, 5, RGB ;Danicus HP 50%
if ErrorLevel
{
AoE(AoE)
}
}
return ; <--- Return?
;#############################
; Panic 0-10%HP
;#############################
;========= Char5 0% - SLOT1 - =========
PixelSearch,,, 1177, 542, 1179, 543, HP_col, 5, RGB ; Krenn HP 0%
if ErrorLevel
Heal(Char5,Panic_Heal)
;========= Char3 0% - SLOT3 - =========
PixelSearch,,, 892, 542, 893, 543, HP_col, 5, RGB ; Ilia HP 0%
if ErrorLevel
Heal(Char3,Panic_Heal)
;========= Char4 0% - SLOT2 =========
PixelSearch,,, 1034, 542, 1035, 543, HP_col, 5, RGB ; Kostus HP 0%
if ErrorLevel
Heal(Char4,Panic_Heal)
;========= Char2 0% - SLOT4 - =========
PixelSearch,,, 748, 542, 749, 543, HP_col, 5, RGB ; Dreyel HP 0%
if ErrorLevel
Heal(Char2,Panic_Heal)
;========= Char1 0% - SLOT5 - =========
PixelSearch,,, 606, 542, 607, 543, HP_col, 5, RGB ; Danicus HP 0%
if ErrorLevel
Heal(Char1,Panic_Heal)
;#############################
; Instant Heal 25%HP
;#############################
;========= Char5 25% - SLOT1 - =========
PixelSearch,,, 1208, 542, 1209, 543, HP_col, 5, RGB ; Krenn HP 25%
if ErrorLevel
Heal(Char5,Instant_Heal)
;========= Char3 25% - SLOT3 - =========
PixelSearch,,, 923, 542, 924, 543, HP_col, 5, RGB ; Ilia HP 25%
if ErrorLevel
Heal(Char3,Instant_Heal)
;========= Char4 25% - SLOT2 =========
PixelSearch,,, 1065, 542, 1066, 543, HP_col, 5, RGB ; Kostus HP 25%
if ErrorLevel
Heal(Char4,Instant_Heal)
;========= Char2 25% - SLOT4 - =========
PixelSearch,,, 779, 542, 780, 543, HP_col, 5, RGB ; Dreyel HP 25%
if ErrorLevel
Heal(Char2,Instant_Heal)
;========= Char1 25% - SLOT5 - =========
PixelSearch,,, 637, 542, 638, 543, HP_col, 5, RGB ; Danicus HP 25%
if ErrorLevel
Heal(Char1,Instant_Heal)
;#############################
; Holy Light 50%HP
;#############################
PixelSearch,,, 1242, 542, 1243, 543, HP_col, 5, RGB ; Krenn HP 50%
if ErrorLevel
Heal(Char5,Holy_Light)
PixelSearch,,, 957, 542, 958, 543, HP_col, 5, RGB ; Ilia HP 50%
if ErrorLevel
Heal(Char3,Holy_Light)
PixelSearch,,, 1099, 542, 1100, 543, HP_col, 5, RGB ; Kostus HP 50%
if ErrorLevel
Heal(Char4,Holy_Light)
PixelSearch,,, 813, 542, 814, 543, HP_col, 5, RGB ;Dreyel HP 50%
if ErrorLevel
Heal(Char2,Holy_Light)
PixelSearch,,, 671, 542, 672, 543, HP_col, 5, RGB ;Danicus HP 50%
if ErrorLevel
Heal(Char1,Holy_Light)
;#############################
; Flash of Light 75%HP
;#############################
PixelSearch,,, 1275, 542, 1276, 543, HP_col, 5, RGB ; Krenn HP 75%
if ErrorLevel
Heal(Char5,Flash_Of_Light)
PixelSearch,,, 990, 542, 991, 543, HP_col, 5, RGB ; Ilia HP 75%
if ErrorLevel
Heal(Char3,Flash_Of_Light)
PixelSearch,,, 1133, 542, 1134, 543, HP_col, 5, RGB ; Kostus HP 75%
if ErrorLevel
Heal(Char4,Flash_Of_Light)
PixelSearch,,, 846, 542, 847, 543, HP_col, 5, RGB ; Dreyel HP 75%
if ErrorLevel
Heal(Char2,Flash_Of_Light)
PixelSearch,,, 704, 542, 705, 543, HP_col, 5, RGB ; Danicus HP 75%
if ErrorLevel
Heal(Char1,Flash_Of_Light)
return
;#############################
; Heal Function
;#############################
Heal(charbut,HealBut) ; Char Button = F1/F2/F3/F4/F5 HealBut=Heal button 0/1/2/3/4 etc
{
Send, {%charbut% Down} ; send Char Keybutton Down , in your case F1/F2/F3/F4
Sleep, 100 ; Delay 75 ms
Send, {%charbut% Up} ; send Char Keybutton Up
Sleep, 100
KeyWait, F7, D ; wait for "e" button to be pressed again
Sleep, 150 ; delay 100ms to avoid "F7" press button too long
Send, %healbut% ; send Heal button, in your case 0/1/2/3/4
Sleep, 2500
}
;#############################
; AoE Function
;#############################
AoE(aoebut)
{
Sleep, 75
Send, %aoebut% ; send aoe button
Sleep, 1500 ; gcd
}
I haven't actually tested it but does this look right to you? What I think it does is, it checks al 5 and if all 5 are below 50% hp the aoe is sent.
How many pixelsearches can you eventually add before things start to get messy? is another 20 pixel searches allright? what about 40? - I wont actualy do it but just wondering, googling about pixelsearches you find many people requesting help because the script is slow and they're refered to pixelgetcolor.
Xtra, thanks for your script again, I'm howeer unable to learn its process so its hard for me to add things on my own, down the line so I would have to keep that script on the side for noow but I'm very glad you join in, I don't really wanna take someone elses work and be done with it.
i would very much like to learn along the way, of course i wouldnt be here without everyones help but Sparks code is abit more understandable for me at this moment