Code:
;Flask on Keypress + BF timer release via image search (de-activated) + hp check (never finished)
;#####################################################################################
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
#SingleInstance force
SetBatchLines, -1
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
isactive:= 1
isvisible:= 0
Scan_delay := 20
BF_timer := 0
Flask1_enable := "Y"
Flask1_key := 1
Flask1_trigger := "RMB"
Flask1_timer := 0
Flask1_duration := 5000
Flask1_type:= "QS"
Flask2_enable := "Y"
Flask2_key := 2
Flask2_trigger := "RMB"
Flask2_timer := 0
Flask2_duration := 4000
Flask2_type:= "QS"
Flask3_enable := "Y"
Flask3_key := 3
Flask3_trigger := "RMB"
Flask3_timer := 0
Flask3_duration := 4600
Flask3_type:= "DD"
Flask4_enable := "Y"
Flask4_key := 4
Flask4_trigger := "RMB"
Flask4_timer := 0
Flask4_duration := 3500
Flask4_type:= "DD"
Flask5_enable := "Y"
Flask5_key := 5
Flask5_trigger := "RMB"
Flask5_timer := 0
Flask5_duration := 4800
Flask5_type:= "DD"
CustomColor = 000000
Gui +LastFound +AlwaysOnTop +ToolWindow -Caption
Gui, Color, %CustomColor%
Gui, Font, s10, Lucida Console
;Gui, Add, Text, x50 y0 w150 BackgroundTrans gGuiMove 0x5
Gui, Add, Text, x50 y0 w150 BackgroundTrans cWhite, Autopot On
WinSet, TransColor, %CustomColor% 230
;#####################################################################################
Loop
{
IfWinActive, Path of Exile ahk_class POEWindowClass
{
If (isvisible = 0) {
isvisible = 1
Gui, Show, NoActivate x250 y960
}
If (isactive = 1) {
If (Flask1_enable="Y"){
FlaskLogic(Flask1_timer,Flask1_duration,Flask1_key,Flask1_trigger)
Flask1_timer := A_TickCount
}
If (Flask2_enable="Y"){
FlaskLogic(Flask2_timer,Flask2_duration,Flask2_key,Flask2_trigger)
Flask1_timer := A_TickCount
}
If (Flask3_enable="Y"){
FlaskLogic(Flask3_timer,Flask3_duration,Flask3_key,Flask3_trigger)
Flask1_timer := A_TickCount
}
If (Flask4_enable="Y"){
FlaskLogic(Flask4_timer,Flask4_duration,Flask4_key,Flask4_trigger)
Flask1_timer := A_TickCount
}
If (Flask5_enable="Y"){
FlaskLogic(Flask5_timer,Flask5_duration,Flask5_key,Flask5_trigger)
Flask1_timer := A_TickCount
}
;BladeFlurryReleaseAt6()
;Hpcheck()
Sleep, %Scan_delay%
}
} else {
If (isvisible = 1) {
isvisible = 0
Gui, Hide
}
Sleep 2000 ;Waiting for game to open
}
}
;#####################################################################################
FlaskLogic(Flask_timer, Flask_duration, Flask_key, Flask_trigger){ ;using utility when u not moving and channeling BF
Global Flask1_timer
Global Flask2_timer
Global Flask3_timer
Global Flask4_timer
Global Flask5_timer
if (A_TickCount - Flask_timer > Flask_duration) {
if (Flask_trigger = "LMB") {
if GetKeyState("LButton", "P") ;and GetKeyState("Shift", "D") ;not moving and channeling BF
{
Sendinput, {%Flask_key% Down}
Sendinput, {%Flask_key% Up}
If (Flask_key = 1){
Flask1_timer := A_TickCount
}Else If (Flask_key = 2){
Flask2_timer := A_TickCount
}Else If (Flask_key = 3){
Flask3_timer := A_TickCount
}Else If (Flask_key = 4){
Flask4_timer := A_TickCount
}Else If (Flask_key = 5){
Flask5_timer := A_TickCount
}
Return
}
}
else if (Flask_trigger = "RMB") {
if GetKeyState("RButton", "P") ;and GetKeyState("Shift", "D") ;not moving and channeling BF
{
Sendinput, {%Flask_key% Down}
Sendinput, {%Flask_key% Up}
If (Flask_key = 1){
Flask1_timer := A_TickCount
}Else If (Flask_key = 2){
Flask2_timer := A_TickCount
}Else If (Flask_key = 3){
Flask3_timer := A_TickCount
}Else If (Flask_key = 4){
Flask4_timer := A_TickCount
}Else If (Flask_key = 5){
Flask5_timer := A_TickCount
}
Return
}
}
}
}
BladeFlurryReleaseAt6()
{
ImageSearch,FoundX,FoundY,0,0,1600,140,C:\Programming\AHK\POE\bf.png
if (ErrorLevel = 2){
;~ msgbox, "-File Issue"
return
}Else if (ErrorLevel = 1){
;~ msgbox, "-Search Issue"
return
}Else if (ErrorLevel = 0){
GetKeyState, state, RButton
Sendinput, {RButton Up}
if state = D
Sendinput, {RButton Down}
return
}
}
HPcheck()
{
ImageSearch,FoundX,FoundY,80,900,160,960,C:\Programming\AHK\POE\hp.png
if (ErrorLevel = 2){
;~ msgbox, "-File Issue"
return
}Else if (ErrorLevel = 1){
Sendinput, {1 Down}
Sendinput, {1 Up}
return
}Else if (ErrorLevel = 0){
;~ msgbox, "-Image found"
return
}
}
;#####################################################################################
RandSleep(x,y) {
Random, rand, %x%, %y%
Sleep %rand%
}
;#####################################################################################
F2::
If (isactive = 1){
isactive = 0
GuiControl, Text, Static1, AutoPot Off
}Else if (isactive = 0) {
isactive = 1
GuiControl, Text, Static1, AutoPot On
}
return
;T:: ;Curse + Aura + Golem
;Send, T
;Sleep, 1000
;Send, R
;Sleep, 1000
;Send, W
;return
GuiMove:
PostMessage, 0xA1, 2,,, A
Return
F11::
Process,Close,Fallback.exe
Process,Close,POE Trades Helper.exe
ExitApp
return
F5::SendInput {Enter}/hideout{Enter} ; go to hideout with F5
^WheelUp::SendInput {Left} ; Ctrl+mouse wheel up toggles stash tabs left
^WheelDown::SendInput {Right} ; Ctrl+mouse wheel down toggles stash tabs right r