Code:
#SingleInstance, Force
#Persistent
#NoEnv
CoordMode, Mouse, Screen
;I had all the sleeps at 1500 instead of 2000 and it worked good but once in a while it would miss one, so putting on 2000
; Ctrl-w sets up the cleric window
^w::SetUp()
; Ctrl-m tell cleric what the main window is
;~F1::PickUp()
~!LButton::Follow()
!f::AutoFollow()
;f is stop autofollow
XButton2::Heal()
!XButton2::UseHP()
!XButton1::UseMP()
!p::GoSub, PartyBuffs
!b::GoSub, NormalBuffs
!`::SwapBF()
!a::AutoMode()
^a::StopAM()
!r::GoSub, AutoBF
~F7::AOE()
!g::
{
Geb := !Geb
Return
}
; started on auto heal, but decided not gonna use so finish later
^h::
{
MouseGetPos, hbPosX, hbPosY, hbWinID
PixelGetColor, hbColor, %hbPosX%, %hbPosY%
}
SetUp()
{
global
Critical
BF := false
flip := false
PlayerSet := false
Geb := false
WinGet, active_id, PID, A
SetSlotPos()
Return
}
;This works well enough but gets "out of sync", it should keep 4 BF all the time but doesnt
AutoBF:
{
flip := false
if(BF)
{
flip := true
SwapBF()
}
GoSub, Bonfire
Sleep 14000
GoSub, Bonfire
Sleep 14000
GoSub, Bonfire
Sleep 14000
GoSub, Bonfire
Sleep 2000
if(flip)
{
Sleep 2000
SwapBF()
}
flip := false
Return
}
NormalBuffs:
{
Thread, NoTimers
flip := false
if(BF)
{
flip := true
SwapBF()
}
SelectPlayer()
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {1}, ahk_pid %active_id%
ControlSend, , {F1}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F2}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F3}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F4}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F5}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F6}, ahk_pid %active_id%
ControlSend, , {2}, ahk_pid %active_id%
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
if(flip)
{
Sleep 2000
SwapBF()
}
flip := false
Return
}
PartyBuffs:
{
Thread, NoTimers
flip := false
if(BF)
{
flip := true
SwapBF()
}
SelectPlayer()
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {1}, ahk_pid %active_id%
ControlSend, , {F7}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F8}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F9}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F10}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F11}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F3}, ahk_pid %active_id%
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
if(flip)
{
Sleep 2000
SwapBF()
}
flip := false
Return
}
AutoMode()
{
global
flip := false
if(BF)
{
flip := true
SwapBF()
}
GoSub, Bonfire
Sleep 2000
GoSub, NormalBuffs
SetTimer, NormalBuffs, 840000
Sleep 2000
GoSub, Bonfire
Sleep 2000
GoSub, PartyBuffs
SetTimer, PartyBuffs, 840000
Sleep 2000
GoSub, Bonfire
SetTimer, Bonfire, -14000
SetTimer, AutoBF, 83000
if(flip)
{
Sleep 2000
SwapBF()
}
flip := false
Return
}
Bonfire:
{
Thread, NoTimers
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F10}, ahk_pid %active_id%
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
Return
}
StopAM()
{
global
Critical
SetTimer, NormalBuffs, Off
SetTimer, PartyBuffs, Off
SetTimer, AutoBF, Off
Return
}
; press pickup on both clients - idea for repeat spam on hold F1
PickUp()
{
global
Critical
ControlSend, , {F1}, ahk_pid %active_id%
Return
}
Heal()
{
global
Critical
if(BF)
{
flip := true
SwapBF()
}
SelectPlayer()
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F2}, ahk_pid %active_id%
Sleep 2000
ControlSend, , {F3}, ahk_pid %active_id%
Sleep 2000
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
if(flip)
{
SwapBF()
}
flip := false
Return
}
UseHP()
{
global
Critical
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F5}, ahk_pid %active_id%
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
Return
}
UseMP()
{
global
Critical
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F6}, ahk_pid %active_id%
if(Geb)
{
WinActivate, ahk_pid %main_id%
}
Return
}
AOE()
{
global
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F7}, ahk_pid %active_id%
Return
}
Follow()
{
global
Critical
SelectPlayer()
if(Geb)
{
WinActivate, ahk_pid %active_id%
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F10}, ahk_pid %active_id%
WinActivate, ahk_pid %main_id%
}
else
{
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F11}, ahk_pid %active_id%
}
Return
}
AutoFollow() ;Only needed on geb after discovering follow skill, lol
{
global
if(!BF)
{
SwapBF()
}
SelectPlayer()
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F9}, ahk_pid %active_id%
Loop
{
if(GetKeyState("f"))
{
if(BF)
{
SwapBF()
}
break
}
Sleep 2000
ControlSend, , {2}, ahk_pid %active_id%
ControlSend, , {F11}, ahk_pid %active_id%
}
Return
}
SwapBF()
{
global
Critical
BF := !BF
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
ControlSend, , {i}, ahk_pid %active_id%
MouseGetPos, PosX, PosY
Click %PosX1%, %PosY1%, 2
Click %PosX2%, %PosY2%, 2
Click %PosX3%, %PosY3%, 2
ControlSend, , {i}, ahk_pid %active_id%
Click %PosX%, %PosY%, 0
WinActivate, ahk_pid %main_id%
Critical, Off
Return
}
SelectPlayer()
{
global
Critical
if(PlayerSet)
{
if(Geb)
{
WinActivate, ahk_pid %active_id%
}
MouseGetPos, PosX, PosY
Click %PlayerX%, %PlayerY%
Click %PosX%, %PosY%, 0
WinActivate, ahk_pid %main_id%
}
Critical, Off
Return
}
SetPlayerPos()
{
global
Critical
MouseGetPos, PlayerX, PlayerY
PlayerSet := true
Return
}
SetSlotPos()
{
global
Critical
SendInput i
Sleep 500
Loop
{
if(GetKeyState("0"))
{
SendInput i
break
}
else if(GetKeyState("m"))
{
WinGet, main_id, PID, A
continue
}
else if(GetKeyState("p"))
{
SetPlayerPos()
continue
}
else if(GetKeyState("1"))
{
MouseGetPos, PosX1, PosY1
continue
}
else if(GetKeyState("2"))
{
MouseGetPos, PosX2, PosY2
continue
}
else if(GetKeyState("3"))
{
MouseGetPos, PosX3, PosY3
continue
}
else if(GetKeyState("4"))
{
MouseGetPos, PosX4, PosY4
continue
}
else if(GetKeyState("5"))
{
MouseGetPos, PosX5, PosY5
continue
}
else if(GetKeyState("6"))
{
MouseGetPos, PosX6, PosY6
continue
}
else if(GetKeyState("7"))
{
MouseGetPos, PosX7, PosY7
continue
}
else if(GetKeyState("8"))
{
MouseGetPos, PosX8, PosY8
continue
}
else if(GetKeyState("9"))
{
MouseGetPos, PosX9, PosY9
continue
}
}
Return
}