Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IniRead, ConfigNumber , Config.ini, Config, ConfigNumber, 1
- If ConfigNumber = 1
- {
- IniRead, minLifePercentToQuit , Config.ini, Config1, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config1, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config1, minLifePercentToJade, 70
- IniRead, minLifePercentToJade , Config.ini, Config1, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config1, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config1, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config1, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config1, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config1, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config1, minManaToDrinkPot, 15
- IniRead, minLifePercentToSpam, Config.ini, Config1, minLifePercentToSpam, 35
- IniRead, ResyncSpam, Config.ini, Config1, ResyncSpam, 0
- Gui, Add, DropDownList, x192 y9 w100 h10 AltSubmit gConfigList vConfigChoice R5 , Configuration 1||Configuration 2|Configuration 3|Configuration 4|Configuration 5
- }
- else If ConfigNumber = 2
- {
- IniRead, minLifePercentToQuit , Config.ini, Config2, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config2, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config2, minLifePercentToJade, 70
- IniRead, minLifePercentToJade , Config.ini, Config2, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config2, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config2, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config2, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config2, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config2, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config2, minManaToDrinkPot, 15
- IniRead, minLifePercentToSpam, Config.ini, Config2, minLifePercentToSpam, 0
- IniRead, ResyncSpam, Config.ini, Config2, ResyncSpam, 0
- Gui, Add, DropDownList, x192 y9 w100 h10 AltSubmit gConfigList vConfigChoice R5 , Configuration 1|Configuration 2||Configuration 3|Configuration 4|Configuration 5
- }
- else If ConfigNumber = 3
- {
- IniRead, minLifePercentToQuit , Config.ini, Config3, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config3, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config3, minLifePercentToJade, 70
- IniRead, minLifePercentToJade , Config.ini, Config3, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config3, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config3, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config3, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config3, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config3, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config3, minManaToDrinkPot, 15
- IniRead, minLifePercentToSpam, Config.ini, Config3, minLifePercentToSpam, 0
- IniRead, ResyncSpam, Config.ini, Config3, ResyncSpam, 0
- Gui, Add, DropDownList, x192 y9 w100 h10 AltSubmit gConfigList vConfigChoice R5 , Configuration 1|Configuration 2|Configuration 3||Configuration 4|Configuration 5
- }
- else If ConfigNumber = 4
- {
- IniRead, minLifePercentToQuit , Config.ini, Config4, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config4, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config4, minLifePercentToJade, 70
- IniRead, minLifePercentToJade , Config.ini, Config4, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config4, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config4, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config4, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config4, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config4, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config4, minManaToDrinkPot, 15
- IniRead, minLifePercentToSpam, Config.ini, Config4, minLifePercentToSpam, 0
- IniRead, ResyncSpam, Config.ini, Config4, ResyncSpam, 0
- Gui, Add, DropDownList, x192 y9 w100 h10 AltSubmit gConfigList vConfigChoice R5 , Configuration 1|Configuration 2|Configuration 3|Configuration 4||Configuration 5
- }
- else If ConfigNumber = 5
- {
- IniRead, minLifePercentToQuit , Config.ini, Config5, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config5, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config5, minLifePercentToJade, 70
- IniRead, minLifePercentToJade , Config.ini, Config5, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config5, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config5, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config5, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config5, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config5, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config5, minManaToDrinkPot, 15
- IniRead, minLifePercentToSpam, Config.ini, Config5, minLifePercentToSpam, 0
- IniRead, ResyncSpam, Config.ini, Config5, ResyncSpam, 0
- Gui, Add, DropDownList, x192 y9 w100 h10 AltSubmit gConfigList vConfigChoice R5 , Configuration 1|Configuration 2|Configuration 3|Configuration 4|Configuration 5||
- }
- Gui, Add, GroupBox, x12 y39 w220 h60 , Min Life `% to Quit
- Gui, Add, Slider, x22 y59 w170 h30 gGuiUpdate vminLifePercentToQuit +ToolTip TickInterval25, %minLifePercentToQuit%
- Gui, Add, Text, x192 y59 w20 h30 vminLifePercentToQuitUpdate, %minLifePercentToQuit%
- Gui, Add, Text, x212 y59 w10 h30 , `%
- Gui, Add, GroupBox, x242 y39 w220 h60 , Min Energy Shield `% to Quit
- Gui, Add, Slider, x252 y59 w170 h30 gGuiUpdate vminESPercentToQuit +ToolTip TickInterval25, %minESPercentToQuit%
- Gui, Add, Text, x422 y59 w20 h30 vminESPercentToQuitUpdate, %minESPercentToQuit%
- Gui, Add, Text, x442 y59 w10 h30 , `%
- Gui, Add, GroupBox, x12 y109 w220 h60 , Min Life `% to Use Jade Flask
- Gui, Add, Slider, x22 y129 w170 h30 gGuiUpdate vminLifePercentToJade +ToolTip TickInterval25, %minLifePercentToJade%
- Gui, Add, Text, x192 y129 w20 h30 vminLifePercentToJadeUpdate , %minLifePercentToJade%
- Gui, Add, Text, x212 y129 w10 h30 , `%
- Gui, Add, GroupBox, x242 y109 w220 h60 , Min Energy Shield `% to Use Jade Flask
- Gui, Add, Slider, x252 y129 w170 h30 gGuiUpdate vminESPercentToJade +ToolTip TickInterval25, %minESPercentToJade%
- Gui, Add, Text, x422 y129 w20 h30 vminESPercentToJadeUpdate, %minESPercentToJade%
- Gui, Add, Text, x442 y129 w10 h30 , `%
- Gui, Add, GroupBox, x12 y179 w220 h60 , Min Life `% to Use Granite Flask
- Gui, Add, Slider, x22 y199 w170 h30 gGuiUpdate vminLifePercentToGranite +ToolTip TickInterval25, %minLifePercentToGranite%
- Gui, Add, Text, x192 y199 w20 h30 vminLifePercentToGraniteUpdate, %minLifePercentToGranite%
- Gui, Add, Text, x212 y199 w10 h30 , `%
- Gui, Add, GroupBox, x242 y179 w220 h60 , Min Energy Shield `% to Use Granite Flask
- Gui, Add, Slider, x252 y199 w170 h30 gGuiUpdate vminESPercentToGranite +ToolTip TickInterval25, %minESPercentToGranite%
- Gui, Add, Text, x422 y199 w20 h30 vminESPercentToGraniteUpdate, %minESPercentToGranite%
- Gui, Add, Text, x442 y199 w10 h30 , `%
- Gui, Add, GroupBox, x12 y249 w220 h60 , Min Life `% to Drink Health Potion
- Gui, Add, Slider, x22 y269 w170 h30 gGuiUpdate vminLifePercentToDrink +ToolTip TickInterval25, %minLifePercentToDrink%
- Gui, Add, Text, x192 y269 w20 h30 vminLifePercentToDrinkUpdate, %minLifePercentToDrink%
- Gui, Add, Text, x212 y269 w10 h30 , `%
- Gui, Add, GroupBox, x242 y249 w220 h60 , Min Mana `% to Drink Mana Potion
- Gui, Add, Slider, x252 y269 w170 h30 gGuiUpdate vminManaPercentToDrink +ToolTip TickInterval25, %minManaPercentToDrink%
- Gui, Add, Text, x422 y269 w20 h30 vminManaPercentToDrinkUpdate, %minManaPercentToDrink%
- Gui, Add, Text, x442 y269 w10 h30 , `%
- Gui, Add, GroupBox, x12 y319 w220 h60 , Min Mana to Drink Mana Potion
- Gui, Add, Slider, x22 y339 w170 h30 Range0-300 gGuiUpdate vminManaToDrinkPot +ToolTip TickInterval50, %minManaToDrinkPot%
- Gui, Add, Text, x192 y339 w30 h30 vminManaToDrinkPotUpdate, %minManaToDrinkPot%
- Gui, Add, Text, x2 y-1 w110 h20 , GUI Created by Gurud.
- Gui, Add, Text, x362 y-1 w100 h20 vAttached, Waiting for Game...
- Gui, Add, Button, x52 y599 w150 h40 gDefault, Reset to Default
- Gui, Add, Button, x272 y599 w150 h40 gReadMe, ReadMe
- Gui, Add, GroupBox, x242 y459 w220 h60, Auto Quit Method
- IniRead, AutoQuitMethod , Config.ini, Config, AutoQuitMethod, 1
- If AutoQuitMethod = 1
- {
- Gui, Add, DropDownList, x252 y479 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Fastest)||Kill Process|Exit to Character Selection (On Testing)|Use a Portal (On Testing)|Disabled
- autoQuitMode:=1
- }
- else If AutoQuitMethod = 2
- {
- Gui, Add, DropDownList, x252 y479 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Fastest)|Kill Process||Exit to Character Selection (On Testing)|Use a Portal (On Testing)|Disabled
- autoQuitMode:=0
- }
- else If AutoQuitMethod = 3
- {
- Gui, Add, DropDownList, x252 y479 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Fastest)|Kill Process|Exit to Character Selection (On Testing)||Use a Portal (On Testing)|Disabled
- autoQuitMode:=2
- }
- else If AutoQuitMethod = 4
- {
- Gui, Add, DropDownList, x252 y479 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Fastest)|Kill Process|Exit to Character Selection (On Testing)|Use a Portal (On Testing)||Disabled
- autoQuitMode:=3
- }
- else If AutoQuitMethod = 5
- {
- Gui, Add, DropDownList, x252 y479 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Fastest)|Kill Process|Exit to Character Selection (On Testing)|Use a Portal (On Testing)|Disabled||
- autoQuitMode:=4
- }
- Gui, Add, GroupBox, x12 y529 w220 h60 , Base Pointer (Click Find After New Patch)
- Gui, Add, Button, x92 y549 w130 h30 gFind, Find
- IniRead, baseMgrPtr , Config.ini, Config, baseMgrPtr, 0
- Gui, Add, Text, x22 y559 w70 h20 vbasePtrText , %baseMgrPtr%
- IniRead, SteamCheck , Config.ini, Config, SteamCheck, 0
- If SteamCheck = 0
- {
- Gui, Add, CheckBox, x252 y559 w190 h30 vSteamCheckBox gSteamCheck, Using Steam
- global Steam:=false
- }
- If SteamCheck = 1
- {
- Gui, Add, CheckBox, x252 y559 w190 h30 vSteamCheckBox gSteamCheck Checked, Using Steam
- global Steam:=true
- }
- ;display tray notifications about script actions : drinking potions, autoquitting
- IniRead, TrayNotificationsCheck , Config.ini, Config, TrayNotificationsCheck, 0
- If TrayNotificationsCheck = 0
- {
- Gui, Add, CheckBox, x252 y529 w190 h30 vTrayCheckBox gTrayNotificationsCheck, Disable Tray Notifications
- global trayNotifications:=true
- }
- If TrayNotificationsCheck = 1
- {
- Gui, Add, CheckBox, x252 y529 w190 h30 vTrayCheckBox gTrayNotificationsCheck Checked, Disable Tray Notifications
- global trayNotifications:=false
- }
- Gui, Add, GroupBox, x242 y389 w220 h60 , Instant Flask Delay (100 = 1 Second)
- IniRead, InstantFlaskDelay , Config.ini, Config, InstantFlaskDelay, 50
- Gui, Add, Slider, x252 y409 w170 h30 Range0-200 gGuiUpdate vInstantFlaskDelay +ToolTip TickInterval50, %InstantFlaskDelay%
- Gui, Add, Text, x422 y409 w30 h30 vInstantFlaskDelayUpdate, %InstantFlaskDelay%
- Gui, Add, GroupBox, x12 y459 w220 h60 , Disable AutoFlask on Slot
- IniRead, Slot1Disabled, Config.ini, DisableSlot, DisableSlot1, 0
- If Slot1Disabled = 0
- Gui, Add, CheckBox, x22 y479 w30 h30 vDisableSlot1 gDisableSlot, 1
- Else If Slot1Disabled = 1
- Gui, Add, CheckBox, x22 y479 w30 h30 checked vDisableSlot1 gDisableSlot, 1
- IniRead, Slot2Disabled, Config.ini, DisableSlot, DisableSlot2, 0
- If Slot2Disabled = 0
- Gui, Add, CheckBox, x62 y479 w30 h30 vDisableSlot2 gDisableSlot, 2
- Else If Slot2Disabled = 1
- Gui, Add, CheckBox, x62 y479 w30 h30 checked vDisableSlot2 gDisableSlot, 2
- IniRead, Slot3Disabled, Config.ini, DisableSlot, DisableSlot3, 0
- If Slot3Disabled = 0
- Gui, Add, CheckBox, x102 y479 w30 h30 vDisableSlot3 gDisableSlot, 3
- Else If Slot3Disabled = 1
- Gui, Add, CheckBox, x102 y479 w30 h30 checked vDisableSlot3 gDisableSlot, 3
- IniRead, Slot4Disabled, Config.ini, DisableSlot, DisableSlot4, 0
- If Slot4Disabled = 0
- Gui, Add, CheckBox, x142 y479 w30 h30 vDisableSlot4 gDisableSlot, 4
- Else If Slot4Disabled = 1
- Gui, Add, CheckBox, x142 y479 w30 h30 checked vDisableSlot4 gDisableSlot, 4
- IniRead, Slot5Disabled, Config.ini, DisableSlot, DisableSlot5, 0
- If Slot5Disabled = 0
- Gui, Add, CheckBox, x182 y479 w30 h30 vDisableSlot5 gDisableSlot, 5
- Else If Slot5Disabled = 1
- Gui, Add, CheckBox, x182 y479 w30 h30 checked vDisableSlot5 gDisableSlot, 5
- ;Gui, Add, GroupBox, x12 y389 w220 h60 , Min Life `% to Spam Instant Flasks
- ;Gui, Add, Slider, x22 y409 w170 h30 gGuiUpdate vminLifePercentToSpam +ToolTip TickInterval25, %minLifePercentToSpam%
- ;Gui, Add, Text, x192 y409 w20 h30 vminLifePercentToSpamUpdate, %minLifePercentToSpam%
- ;Gui, Add, Text, x212 y409 w10 h30 , `%
- IniRead, TradeSpam, Config.ini, Config, TradeSpam, 0
- Gui, Add, GroupBox, x12 y389 w220 h60 , Send Trade Message Every X Minutes
- Gui, Add, Slider, x22 y409 w170 h30 gGuiUpdate vTradeSpam +ToolTip TickInterval1 Range0-10, %TradeSpam%
- Gui, Add, Text, x192 y409 w20 h30 vTradeSpamUpdate, %TradeSpam%
- Gui, Add, Text, x212 y409 w10 h30 , m
- Gui, Add, GroupBox, x242 y319 w220 h60 , Use Resync Command Every X Seconds
- Gui, Add, Slider, x252 y339 w170 h30 gGuiUpdate vResyncSpam +ToolTip TickInterval30 Range0-120, %ResyncSpam%
- Gui, Add, Text, x422 y339 w20 h30 vResyncSpamUpdate, %ResyncSpam%
- Gui, Add, Text, x442 y339 w10 h30 , s
- Menu, Tray, Add, Configuration Window, showgui
- Gui, Submit
- Gui, Show, x760 y198 h648 w477,
- ;-------GUI-----------------GUI-----------------GUI-----------------GUI-----------------GUI----------
- SetBatchLines, -1
- DetectHiddenWindows, On
- cliname=Path of Exile
- if (Steam)
- {
- cliexe=PathOfExileSteam.exe
- }
- else
- cliexe=PathOfExile.exe
- autoPotionsWatchdogPeriod:=10 ;milliseconds, time to have script recheck life/mana/flasks availability more often/increase chances of getting saved from death in time, increase this if fps drop.
- lagCompensation:=50
- ; Font size for the tooltip, leave empty for default(part of DPSCalc)
- FontSize := 12
- ; Create font for later use(part of DPSCalc)
- FixedFont := CreateFont()
- ResyncTimer:= 0
- TradeTimer:= 0
- TradeChannel:= 0
- tradechat:= 0
- TradeTimer:= 0
- TradeTimer2:= 0
- TradeStep:= 3
- TradeSpamTimer:= 99999
- autoQuitPauseBeforeClick:=100
- autoQuitSoftToleranceBeforeKill:=2000 ; try to quit to loginscreen at most milliseconds before killing game window(in case we can't quit by clicking menu option for some reason)
- PlayerConfig:={}
- PlayerConfig["Default"]:={minLifeRatioToInstant: minLifePercentToSpam/100, IFlaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopGranite: minLifePercentToGranite/100, minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100, minNShieldRatioToQuit: minESPercentToQuit/100, minNShieldRatioToPopGranite: minESPercentToGranite/100, minNShieldRatioToPopJade: minESPercentToJade/100}
- PlayerConfig["Default"].FlaskConfig:=[]
- PlayerConfig["Default"].FlaskConfig[1]:={Hotkey:"{1 Down 1 UP}"} ; ,OverrideFlaskDuration: 70, instantRecoveryOnLowLife:true, } ;specify override recovery time in deciseconds, e.g. 7 seconds = 70
- PlayerConfig["Default"].FlaskConfig[2]:={Hotkey:"{2 Down 2 UP}"}
- PlayerConfig["Default"].FlaskConfig[3]:={Hotkey:"{3 Down 3 UP}"}
- PlayerConfig["Default"].FlaskConfig[4]:={Hotkey:"{4 Down 4 UP}"}
- PlayerConfig["Default"].FlaskConfig[5]:={Hotkey:"{5 Down 5 UP}"}
- attachedtext=:false
- WindowQueuedFlaskEffects:=[] ;keyed by "%hwnd%%CurrPid%", hpQueueEndtime, manaQueueEndtime
- basePtrAoBArray:=[0x53,0x55,0x56,0x57,0x33,0xFF,0x3B,0xC7]
- basePtrAobOffset:=-0x0A
- WindowBasicsCache:=[] ; keyed by "%hwnd%%CurrPid%", entries are objects with properties processHandle, moduleBase, moduleSize, baseFramePtr
- #Include AutoHotkeyMemoryLib.ahk
- Loop
- {
- Main()
- }
- GetWindowBasics(hwnd, byref mB="", byref pH="", byref mS="")
- {
- global WindowBasicsCache
- global cliexe
- WinGet, CurrPid, PID, ahk_id %hwnd%
- k="%hwnd%%CurrPid%"
- mB:=WindowBasicsCache[k].mBase
- mS:=WindowBasicsCache[k].mSize
- if mB=
- {
- WindowBasicsCache[k]:=Object()
- GetModuleInfo(cliexe, CurrPid, mB, mS)
- if (mB="" || mS="")
- {
- MsgBox, Failed to obtain moduleBase or moduleSize for PID %CurrPid%, script will now terminate
- ExitApp
- }
- WindowBasicsCache[k].mBase:=mB
- WindowBasicsCache[k].mSize:=mS
- }
- pH:=WindowBasicsCache[k].ProcessHandle
- if pH=
- {
- pH:=GetProcessHandle(CurrPid)
- if (pH="" || pH=-1)
- {
- MsgBox, Invalid process handle obtained for PID %CurrPid%, script will now terminate
- ExitApp
- }
- WindowBasicsCache[k].ProcessHandle:=pH
- }
- }
- ScanBaseMgrPtr(mBase,pH,moduleSize)
- {
- global basePtrAoBArray
- global basePtrAobOffset
- global baseMgrPtr
- aobResult:=AobScan(pH,mBase,moduleSize,basePtrAoBArray)
- if aobResult
- {
- SetFormat, IntegerFast, hex
- baseMgrPtr:=ReadMemUInt(pH,mBase+aobResult+basePtrAobOffset)-mBase
- if (trayNotifications)
- TrayTip, New Base Pointer Found, baseMgrPtr = %baseMgrPtr%
- IniWrite, %baseMgrPtr% , Config.ini, Config, baseMgrPtr
- GuiControl, , basePtrText, %baseMgrPtr%
- SetFormat, IntegerFast, dec
- }
- else
- {
- MsgBox, baseMgrPtr not found with AoBScan, script will now terminate
- ExitApp
- }
- }
- GetFrameBase(hwnd)
- {
- global baseMgrPtr
- global WindowBasicsCache
- WinGet, CurrPid, PID, ahk_id %hwnd%
- k="%hwnd%%CurrPid%"
- fB:=WindowBasicsCache[k].fBase
- if fB=
- {
- GetWindowBasics(hwnd, mBase, pH, mSize)
- if baseMgrPtr= 0
- {
- ScanBaseMgrPtr(mBase, pH, mSize)
- }
- fB:=GetMultilevelPointer(pH,[mBase+baseMgrPtr,4,0x7C,0x94])
- WindowBasicsCache[k].fBase:=fB
- }
- return fB
- }
- GetUiBase(hwnd)
- {
- global baseMgrPtr
- GetWindowBasics(hwnd, mBase, pH, mSize)
- if baseMgrPtr= 0
- {
- ScanBaseMgrPtr(mBase, pH, mSize)
- }
- FrameBase:=GetFrameBase(hwnd)
- if (FrameBase="" || FrameBase=0)
- return
- if (Steam)
- {
- uiBase:=GetMultilevelPointer(pH,[FrameBase+0xd8,0xA4,0x50])
- }
- else
- uiBase:=GetMultilevelPointer(pH,[FrameBase+0xBC,0xA4,0x50])
- return uiBase
- }
- ReadClientResolution(hwnd, ByRef w, ByRef h)
- {
- GetWindowBasics(hwnd,mBase,pH)
- if (mBase!=0 && pH && pH!=-1)
- {
- FrameBase:=GetFrameBase(hwnd)
- if (Steam)
- {
- w:=ReadMemUInt(pH,FrameBase+0x1470)
- h:=ReadMemUInt(pH,FrameBase+0x1474)
- }
- else
- {
- w:=ReadMemUInt(pH,FrameBase+0x1458)
- h:=ReadMemUInt(pH,FrameBase+0x145C)
- }
- return true
- }
- }
- ReadPlayerStats(hwnd, byRef PlayerStats)
- {
- GetWindowBasics(hwnd, mBase, pH)
- fBase:=GetFrameBase(hwnd)
- if (Steam)
- {
- PlayerBase:=GetMultilevelPointer(pH,[fBase+0xD8,0x59C])
- }
- else
- PlayerBase:=GetMultilevelPointer(pH,[fBase+0xBC,0x59C])
- PlayerMain:=ReadMemUInt(pH,PlayerBase+4)
- PlayerStatsOffset:=ReadMemUInt(pH,PlayerMain+0xC)
- PlayerStats.MaxHP:=ReadMemUInt(pH,PlayerStatsOffset+0x50)
- PlayerStats.CurrHP:=ReadMemUInt(pH,PlayerStatsOffset+0x54)
- PlayerStats.ReservedHPFlat:=ReadMemUInt(pH,PlayerStatsOffset+0x5C)
- PlayerStats.ReservedHPPercent:=ReadMemUInt(pH,PlayerStatsOffset+0x60)
- PlayerStats.MaxMana:=ReadMemUInt(pH,PlayerStatsOffset+0x74)
- PlayerStats.ReservedManaFlat:=ReadMemUInt(pH,PlayerStatsOffset+0x80)
- PlayerStats.ReservedManaPercent:=ReadMemUInt(pH,PlayerStatsOffset+0x84)
- PlayerStats.CurrMana:=ReadMemUInt(pH,PlayerStatsOffset+0x78)
- PlayerStats.MaxNShield:=ReadMemUInt(pH,PlayerStatsOffset+0x98)
- PlayerStats.CurrNShield:=ReadMemUInt(pH,PlayerStatsOffset+0x9C)
- }
- ReadFlasksData(hwnd, byRef FlasksData)
- {
- GetWindowBasics(hwnd, mBase, pH)
- UiBase:=GetUiBase(hwnd)
- if (!UiBase) ;not InGame
- return
- FlaskInvBase:=GetMultilevelPointer(pH,[UiBase+0x968,0x980,0x20])
- Loop, 5
- {
- currFlaskPtr:=ReadMemUInt(pH,FlaskInvBase+(A_Index-1)*4)
- if (currFlaskPtr!=0) ; there's a flask in said slot
- {
- FlasksData[A_Index]:={}
- If A_Index = 1
- {
- IniRead, Slot1Disabled, Config.ini, DisableSlot, DisableSlot1, 0
- If Slot1Disabled = 1
- continue
- }
- else If A_Index = 2
- {
- IniRead, Slot2Disabled, Config.ini, DisableSlot, DisableSlot2, 0
- If Slot2Disabled = 1
- continue
- }
- else If A_Index = 3
- {
- IniRead, Slot3Disabled, Config.ini, DisableSlot, DisableSlot3, 0
- If Slot3Disabled = 1
- continue
- }
- else If A_Index = 4
- {
- IniRead, Slot4Disabled, Config.ini, DisableSlot, DisableSlot4, 0
- If Slot4Disabled = 1
- continue
- }
- else If A_Index = 5
- {
- IniRead, Slot5Disabled, Config.ini, DisableSlot, DisableSlot5, 0
- If Slot5Disabled = 1
- continue
- }
- FlaskChargesPtr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0xC])
- FlasksData[A_Index].ChargesCurrent:=ReadMemUInt(pH,FlaskChargesPtr+0xC)
- FlasksData[A_Index].ChargesPerUse:=ReadMemUInt(pH,ReadMemUInt(pH,FlaskChargesPtr+8)+0xC)
- FlaskMod1Ptr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0x10,0x34,0x14,0x50])
- FlaskMod1Str:=ReadMemStr(ph,FlaskMod1Ptr,70,"UTF-16")
- FlasksData[A_Index].mod1:=FlaskMod1Str
- FlaskMod2Ptr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0x10,0x34,0x2c,0x50])
- FlaskMod2Str:=ReadMemStr(ph,FlaskMod2Ptr,70,"UTF-16")
- FlasksData[A_Index].mod2:=FlaskMod2Str
- if (FlasksData[A_Index].ChargesCurrent < FlasksData[A_Index].ChargesPerUse) ; not enough charges in this flask to use it, don't bother
- continue
- FlaskMetadataPtr:=GetMultilevelPointer(ph,[currFlaskPtr,0,8])
- FlaskMetadataStr:=ReadMemStr(ph,FlaskMetadataPtr,70,"UTF-16")
- FlaskTypeStr:=SubStr(FlaskMetadataStr,23)
- FlasksData[A_Index].type:=FlaskTypeStr
- FlaskLocalstatsPtr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x18,0x20,0xC])
- if InStr(FlaskTypeStr, "FlaskLife")
- {
- FlasksData[A_Index].HPRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
- if (InStr(FlasksData[A_Index].mod1,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/2.35)
- else if (InStr(FlasksData[A_Index].mod2,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/2.35)
- else if (InStr(FlasksData[A_Index].mod1,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/0.67)
- else if (InStr(FlasksData[A_Index].mod2,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/0.67)
- else if (InStr(FlasksData[A_Index].mod1,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/1.5)
- else if (InStr(FlasksData[A_Index].mod2,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/1.5)
- else
- FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)
- }
- if InStr(FlaskTypeStr, "FlaskMana")
- {
- FlasksData[A_Index].ManaRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
- if (InStr(FlasksData[A_Index].mod1,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/2.35)
- else if (InStr(FlasksData[A_Index].mod2,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/2.35)
- else if (InStr(FlasksData[A_Index].mod1,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/0.67)
- else if (InStr(FlasksData[A_Index].mod2,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/0.67)
- else if (InStr(FlasksData[A_Index].mod1,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/1.5)
- else if (InStr(FlasksData[A_Index].mod2,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)/1.5)
- else
- FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)
- }
- if InStr(FlaskTypeStr, "FlaskHybrid")
- {
- FlasksData[A_Index].HPRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
- FlasksData[A_Index].ManaRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)
- if (InStr(FlasksData[A_Index].mod1,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
- else if (InStr(FlasksData[A_Index].mod2,"Bubbling"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
- else if (InStr(FlasksData[A_Index].mod1,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
- else if (InStr(FlasksData[A_Index].mod2,"Saturated"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
- else if (InStr(FlasksData[A_Index].mod1,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
- else if (InStr(FlasksData[A_Index].mod2,"Catalysed"))
- FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
- else
- FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)
- }
- if InStr(FlaskTypeStr, "FlaskUtility")
- {
- FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x4)
- }
- }
- }
- }
- IsInGame(hwnd)
- {
- if (hwnd=0 || hwnd="")
- return false
- GetWindowBasics(hwnd,mBase,pH)
- if (mBase="" || mBase=0 || pH="" || pH=-1)
- return false
- fBase:=GetFrameBase(hwnd)
- if (fBase="" || fBase=0)
- return false
- localConnection:=ReadMemUInt(pH,fBase+0xc0)
- if (localConnection=0 || localConnection="")
- return false
- else
- return true
- }
- SetGameStateMenu(hwnd)
- {
- if (hwnd=0 || hwnd="")
- return false
- GetWindowBasics(hwnd,mBase,pH)
- if (mBase="" || mBase=0 || pH="" || pH=-1)
- return false
- fBase:=GetFrameBase(hwnd)
- if (fBase="" || fBase=0)
- return false
- if (Steam)
- {
- localConnection:=GetMultilevelPointer(pH,[fBase+0xd8,0x598])
- }
- else
- localConnection:=ReadMemUInt(pH,fBase+0xc0)
- if (localConnection!="" && localConnection!=0)
- {
- WriteMemUInt(pH,localConnection+0x26f8,1)
- }
- }
- ReadHeroPos(hwnd,ByRef x, ByRef y)
- {
- GetWindowBasics(hwnd,mBase,pH)
- if (mBase!=0 && pH && pH!=-1)
- {
- FrameBase:=GetFrameBase(hwnd)
- if (Steam)
- {
- x:=ReadMemFloat(pH,FrameBase+0x16c4)
- y:=ReadMemFloat(pH,FrameBase+0x16c8)
- }
- else
- {
- x:=ReadMemFloat(pH,FrameBase+0x16ac)
- y:=ReadMemFloat(pH,FrameBase+0x16b0)
- }
- return true
- }
- }
- ScreenToClient(hwnd, ByRef x, ByRef y)
- {
- VarSetCapacity(pt, 8)
- NumPut(x, pt, 0)
- NumPut(y, pt, 4)
- DllCall("ScreenToClient", "uint", hwnd, "uint", &pt)
- x := NumGet(pt, 0, "int")
- y := NumGet(pt, 4, "int")
- VarSetCapacity(pt, 0)
- }
- GetClientCoords(byRef mx, byRef my)
- {
- hwnd:=WinActive("A")
- CoordMode, Mouse, Screen
- MouseGetPos, mx, my
- ScreenToClient(hwnd,mx,my) ; x 580 y 435
- }
- QuitToLoginScreen(hwnd)
- {
- if (!IsInGame(hwnd))
- {
- return
- }
- SetGameStateMenu(hwnd)
- }
- GetMaxChargesFlaskOfType(ByRef FlasksData,TypeStr)
- {
- currMaxCharges:=0
- Loop, 5
- if (InStr(FlasksData[A_Index].type,TypeStr))
- {
- if FlasksData[A_Index].ChargesCurrent>currMaxCharges
- {
- currMaxI:=A_Index
- currMaxCharges:=FlasksData[A_Index].ChargesCurrent
- }
- }
- return currMaxI
- }
- Main()
- {
- global autoPotionsWatchdogPeriod
- global lagCompensation
- global PlayerConfig
- global WindowQueuedFlaskEffects
- global cliname
- global cliexe
- global trayNotifications
- global autoQuitMode
- global desync
- global remaining
- global tradechat
- global borderless
- global testingame
- global ChatStatus
- global ResyncTimer
- global ResyncSpam
- global tradechat
- global TradeSpam
- global TradeSpamTimer
- global TradeTimer
- global TradeTimer2
- global TradeChannel
- global TradeStep
- WinGet, WinID, List, %cliname%
- Loop, %WinID%
- {
- WinGet, ProcModuleName, ProcessName, % "ahk_id" WinID%A_Index%
- If(ProcModuleName!=cliexe) ; got a window with title "Path of Exile" but exe is not Client.exe, perhaps we have browser window open with PoE site, ignore it
- continue
- if attachedtext!=true
- {
- GuiControl,,Attached, Game is Attached.
- attachedtext:=true
- }
- if (!IsInGame(WinID%A_Index%)) ;not ingame
- continue
- if (WinID%A_Index%=WinActive("A"))
- ThisID:=WinActive("A")
- PlayerStats:={}
- ReadPlayerStats(WinID%A_Index%, PlayerStats)
- if (PlayerStats.MaxHP<1 || PlayerStats.CurrHP=0) ;dead, don't bother
- continue
- CurrentConfig:=PlayerConfig["Default"]
- if PlayerStats.MaxNShield>0
- {
- currNShieldRatio:=PlayerStats.CurrNShield/PlayerStats.MaxNShield
- }
- else
- currNShieldRatio:= 1
- if (PlayerStats.MaxHP>1)
- {
- currLifeRatio:=PlayerStats.CurrHP/(PlayerStats.MaxHP-PlayerStats.ReservedHPFlat-PlayerStats.MaxHP*PlayerStats.ReservedHPPercent/100)
- }
- else
- currLifeRatio:= 1
- if (PlayerStats.MaxMana>0)
- {
- currManaRatio:=PlayerStats.CurrMana/(PlayerStats.MaxMana-PlayerStats.ReservedManaFlat-PlayerStats.MaxMana*PlayerStats.ReservedManaPercent/100)
- }
- if (currLifeRatio<CurrentConfig.minLifeRatioToQuit || currNShieldRatio<CurrentConfig.minNShieldRatioToQuit)
- {
- if (autoQuitMode=0)
- {
- TrayTip, PoE autoPotions AutoQuit by closing window, specified min life reached, %A_Space% , 2
- WinKill, % "ahk_id" WinID%A_Index%
- continue
- }
- else if (autoQuitMode=1)
- {
- QuitToLoginScreen(WinID%A_Index%)
- continue
- }
- else if (autoQuitMode=2)
- {
- ExitToCharacterSelection()
- continue
- }
- else if (autoQuitMode=3)
- {
- UsePortal()
- continue
- }
- else if (autoQuitMode=4)
- {
- }
- }
- if desync = 1
- {
- if (IsInGame(hwnd))
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- SendInput {NumpadEnter}/oos{NumpadEnter}
- }
- }
- desync = 0
- }
- FlasksData:=[]
- ReadFlasksData(WinID%A_Index%,FlasksData)
- WinGet, CurrPID, PID, % "ahk_id" WinID%A_Index%
- hwnd:=WinID%A_Index%
- k="%hwnd%%CurrPid%"
- if (!WindowQueuedFlaskEffects.HasKey(k))
- {
- WindowQueuedFlaskEffects[k]:={}
- }
- if (currLifeRatio<CurrentConfig.minLifeRatioToPopGranite || currNShieldRatio<CurrentConfig.minNShieldRatioToPopGranite)
- if ((!WindowQueuedFlaskEffects[k].HasKey("graniteQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].graniteQueueEndtime-lagCompensation)))
- {
- flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility5") ; granite flask
- if (flaskNum!="")
- {
- if CurrentConfig.FlaskConfig[flaskNum].HasKey("OverrideFlaskDuration")
- EffectDuration:=CurrentConfig.FlaskConfig[flaskNum].OverrideFlaskDuration
- else
- EffectDuration:=FlasksData[flaskNum].EffectDuration
- WindowQueuedFlaskEffects[k].graniteQueueEndtime:=A_TickCount+EffectDuration*100
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions popping Granite flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- }
- if (currLifeRatio<CurrentConfig.minLifeRatioToPopJade || currNShieldRatio<CurrentConfig.minNShieldRatioToPopJade)
- if ((!WindowQueuedFlaskEffects[k].HasKey("jadeQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].jadeQueueEndtime-lagCompensation)))
- {
- flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility9") ; jade flask
- if (flaskNum!="")
- {
- if CurrentConfig.FlaskConfig[flaskNum].HasKey("OverrideFlaskDuration")
- EffectDuration:=CurrentConfig.FlaskConfig[flaskNum].OverrideFlaskDuration
- else
- EffectDuration:=FlasksData[flaskNum].EffectDuration
- WindowQueuedFlaskEffects[k].jadeQueueEndtime:=A_TickCount+EffectDuration*100
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions popping Jade flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- }
- if (currLifeRatio>=1)
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount
- if (currManaRatio>=1)
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount
- if (currLifeRatio<CurrentConfig.minLifeRatioToDrink)
- {
- if ((!WindowQueuedFlaskEffects[k].HasKey("hpQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].hpQueueEndtime-lagCompensation)))
- {
- tflaskNum2:=GetMaxChargesFlaskOfType(FlasksData,"FlaskLife")
- tflaskNum1:=GetMaxChargesFlaskOfType(FlasksData,"FlaskHybrid")
- if ((tflaskNum1!=) && (tflaskNum2!=))
- flaskNum:=(FlasksData[tflaskNum1].ChargesCurrent>FlasksData[tflaskNum2].ChargesCurrent) ? tflaskNum1 : tflaskNum2
- else
- {
- if (tflaskNum1!="")
- flaskNum:=tflaskNum1
- if (tflaskNum2!="")
- flaskNum:=tflaskNum2
- }
- if (flaskNum!="")
- {
- EffectDuration:=FlasksData[flaskNum].EffectDuration
- IFDelay:= (CurrentConfig.IFlaskDelay*10)
- if (InStr(FlasksData[flaskNum].mod1,"Seething"))
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- else if (InStr(FlasksData[flaskNum].mod2,"Seething"))
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- else if ((InStr(FlasksData[flaskNum].mod1,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- else if ((InStr(FlasksData[flaskNum].mod2,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- else
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+EffectDuration*100
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- Break
- }
- }
- Else if ((!WindowQueuedFlaskEffects[k].HasKey("hpQueueEndtime")) || (A_TickCount<=(WindowQueuedFlaskEffects[k].hpQueueEndtime-lagCompensation)))
- {
- minLifeRatioToInstant:=0
- if (currLifeRatio<minLifeRatioToInstant)
- {
- tflaskNum2:=GetMaxChargesFlaskOfType(FlasksData,"FlaskLife") ;need to change this
- if (tflaskNum2!="")
- flaskNum:=tflaskNum2
- if (flaskNum!="")
- {
- IFDelay:= (CurrentConfig.IFlaskDelay*10)
- if (InStr(FlasksData[flaskNum].mod1,"Seething"))
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- else if (InStr(FlasksData[flaskNum].mod2,"Seething"))
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- else if (InStr(FlasksData[flaskNum].mod1,"Bubbling"))
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- else if (InStr(FlasksData[flaskNum].mod2,"Bubbling"))
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- else if ((InStr(FlasksData[flaskNum].mod1,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- else if ((InStr(FlasksData[flaskNum].mod2,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- {
- WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+IFDelay
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping HP flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- break
- }
- }
- }
- }
- }
- if (PlayerStats.MaxMana>0 && (currManaRatio<CurrentConfig.minManaRatioToDrink || PlayerStats.CurrMana<CurrentConfig.minManaToDrink))
- if ((!WindowQueuedFlaskEffects[k].HasKey("ManaQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].ManaQueueEndtime-lagCompensation)))
- {
- tflaskNum2:=GetMaxChargesFlaskOfType(FlasksData,"FlaskMana")
- tflaskNum1:=GetMaxChargesFlaskOfType(FlasksData,"FlaskHybrid")
- if ((tflaskNum1!=) && (tflaskNum2!=))
- flaskNum:=(FlasksData[tflaskNum1].ChargesCurrent>FlasksData[tflaskNum2].ChargesCurrent) ? tflaskNum1 : tflaskNum2
- else
- {
- if (tflaskNum1!="")
- flaskNum:=tflaskNum1
- if (tflaskNum2!="")
- flaskNum:=tflaskNum2
- }
- if (flaskNum!="")
- {
- EffectDuration:=FlasksData[flaskNum].EffectDuration
- IFDelay:= (CurrentConfig.IFlaskDelay*10)
- if (InStr(FlasksData[flaskNum].mod1,"Seething"))
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+IFDelay
- else if (InStr(FlasksData[flaskNum].mod2,"Seething"))
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+IFDelay
- else if ((InStr(FlasksData[flaskNum].mod1,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+IFDelay
- else if ((InStr(FlasksData[flaskNum].mod2,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low life" can be caused by auras hp reservation from blood magic
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+IFDelay
- else
- WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+EffectDuration*100
- if (trayNotifications)
- {
- TrayTip, PoE autoPotions sipping mana flask %flaskNum%, %A_Space% , 2
- }
- hKey:=CurrentConfig.FlaskConfig[flaskNum].Hotkey
- ControlSend,,%hkey%, % "ahk_id" hwnd
- Break
- }
- }
- }
- if ((autoQuit=1) && (ThisID!="") && (ThisID!=WinActive("A")))
- WinActivate, % "ahk_id" ThisID
- if remaining = 1
- {
- if (IsInGame(hwnd))
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- SendInput {NumpadEnter}/remaining{NumpadEnter}
- }
- }
- remaining = 0
- }
- if testingame = 1
- {
- if (IsInGame(hwnd))
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- ChatStatus:= !ChatStatus
- ResyncTimer = 0
- TradeSpam = 0
- GuiControl, , TradeSpam, 0
- GuiControl, , TradeSpamUpdate, 0
- IniWrite, 0 , Config.ini, Config, TradeSpam
- }
- }
- testingame = 0
- }
- If (TradeSpam>0)
- {
- TradeSpamTimer++
- If (TradeSpamTimer>(TradeSpam*6000*0.64))
- {
- tradechat = 1
- TradeSpamTimer = 0
- }
- }
- if tradechat = 1
- {
- ++TradeTimer
- If (TradeTimer>10)
- {
- if (!ChatStatus)
- {
- if (IsInGame(hwnd))
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- SendMode Input
- If (TradeStep = 1)
- {
- Send {NumpadEnter}
- Send {Raw}/trade %TradeChannel%
- Send {NumpadEnter}
- TradeStep:= 2
- TradeTimer = 0
- }
- else If (TradeStep = 2)
- {
- Send {NumpadEnter}{Up 3}{NumpadEnter}
- TradeStep = 3
- TradeTimer = 0
- }
- else If (TradeStep = 3)
- {
- Send {NumpadEnter}/trade 111{NumpadEnter}
- TradeStep = 4
- TradeTimer = 0
- }
- else If (TradeStep = 4)
- {
- ++TradeTimer2
- If (TradeTimer2>(130))
- {
- TradeTimer = 0
- TradeStep:= 5
- }
- }
- else If (TradeStep = 5)
- {
- If (TradeChannel<10)
- {
- TradeChannel++
- TradeStep = 1
- TradeTimer = 0
- TradeTimer2 = 0
- }
- Else
- {
- TradeChannel = 0
- tradechat = 0
- TradeTimer = 0
- TradeTimer2 = 0
- TradeStep = 3
- }
- }
- }
- }
- Else
- {
- TradeChannel = 0
- tradechat = 0
- TradeTimer = 0
- TradeTimer2 = 0
- TradeStep = 3
- }
- }
- Else
- {
- TradeChannel = 0
- tradechat = 0
- TradeTimer = 0
- TradeTimer2 = 0
- TradeStep = 3
- }
- }
- }
- else
- {
- If (TradeSpam=0)
- {
- ++ResyncTimer
- If ((ResyncTimer>(ResyncSpam*100*0.65)) And (ResyncSpam>0))
- {
- if (!ChatStatus)
- {
- if (IsInGame(hwnd))
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- Sendinput {NumpadEnter}/oos{NumpadEnter}
- }
- }
- }
- ResyncTimer = 0
- }
- }
- }
- Sleep, %autoPotionsWatchdogPeriod%
- }
- UsePortal()
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- BlockInput On
- SendMode Input
- hwnd:=WinActive("A")
- GetKeyState, stateR, RButton, P
- if stateR = D
- {
- Send {RButton up}
- }
- GetKeyState, stateL, LButton, P
- if stateL = D
- {
- Send {LButton up}
- }
- GetKeyState, stateM, MButton, P
- if stateM = D
- {
- Send {MButton up}
- }
- GetKeyState, stateQ, Q, P
- if stateQ = D
- {
- Send {Q up}
- }
- GetKeyState, stateW, W, P
- if stateW = D
- {
- Send {W up}
- }
- GetKeyState, stateE, E, P
- if stateE = D
- {
- Send {E up}
- }
- GetKeyState, stateR, R, P
- if stateR = D
- {
- Send {R up}
- }
- GetKeyState, stateT, T, P
- if stateT = D
- {
- Send {T up}
- }
- GetKeyState, stateI, I, P
- if stateI = D
- {
- Send {I up}
- }
- GetKeyState, stateSP, SPACE, P
- if stateSP = D
- {
- Send {SPACE up}
- }
- GetKeyState, stateSH, SHIFT, P
- if stateSH = D
- {
- Send {SHIFT up}
- }
- ReadClientResolution(hwnd,w,h)
- Send {SPACE}
- Send {NumpadEnter}
- Send {Raw} /oos
- Send {NumpadEnter}
- Send {i}
- ErrorLevel = 1
- Sleep, 50
- ScrollX:= (w/2)
- ScrollY:= (h/2)
- PixelSearch, ScrollX, ScrollY, ScrollX, ScrollY, w, h, 0xFFFFFF, 1, fast ;2b1d35 312238
- If ErrorLevel = 0
- {
- MouseMove, (ScrollX), (ScrollY),0
- If PortalInvCheck() = true
- {
- }
- Else If PortalInvCheck() = false
- {
- ScrollX:= (w/2)
- Loop
- {
- ErrorLevel = 1
- PixelSearch, ScrollX2, ScrollY2, ScrollX, ScrollY, (ScrollX+50), (ScrollY+10), 0xFFFFFF, 1, fast ;0xFBFBFB, 4, fast ;2b1d35 312238
- If ErrorLevel = 0
- {
- MouseMove, (ScrollX2), (ScrollY2),0
- If PortalInvCheck() = true
- Break
- Else If PortalInvCheck() = false
- {
- Send {SPACE}
- MouseMove, (w/2), (h/2), 0
- BlockInput Off
- Return
- }
- }
- else
- {
- ScrollX:= (ScrollX+50)
- Continue
- }
- }
- }
- }
- Send {RButton}
- Send {SPACE}
- Sleep, 50
- MouseMove, (w/2), (h/2),0
- Sleep, 50
- Send {LButton}
- sleep, 250
- Loop
- {
- ErrorLevel = 1
- PixelSearch, PixX, PixY, (w/4), (h/10), ((w/4)*3), h, 0xddbb30, 34, fast ;0xdcc8c8 text color
- if ErrorLevel = 0
- {
- MouseMove, (PixX), (PixY),0
- Sleep, 20
- Send {LButton}
- Loop ;only search for portals when not moving
- {
- ReadHeroPos(hwnd,PosX1,PosY1)
- sleep, 30
- ReadHeroPos(hwnd,PosX2,PosY2)
- if PosX1 = %PosX2%
- {
- If PosY1 = %PosY2%
- {
- break
- }
- }
- else
- sleep, 30
- }
- }
- else
- {
- Break
- }
- }
- Sleep, 50
- MouseMove, (w/2), (h/2),0
- Sleep, 50
- Send {LButton}
- Sleep, 50
- BlockInput Off
- }
- Else
- return
- }
- ExitToCharacterSelection()
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- BlockInput On
- SendMode Input
- hwnd:=WinActive("A")
- GetKeyState, stateR, RButton, P
- if stateR = D
- {
- Send {RButton up}
- }
- GetKeyState, stateL, LButton, P
- if stateL = D
- {
- Send {LButton up}
- }
- GetKeyState, stateM, MButton, P
- if stateM = D
- {
- Send {MButton up}
- }
- GetKeyState, stateQ, Q, P
- if stateQ = D
- {
- Send {Q up}
- }
- GetKeyState, stateW, W, P
- if stateW = D
- {
- Send {W up}
- }
- GetKeyState, stateE, E, P
- if stateE = D
- {
- Send {E up}
- }
- GetKeyState, stateR, R, P
- if stateR = D
- {
- Send {R up}
- }
- GetKeyState, stateT, T, P
- if stateT = D
- {
- Send {T up}
- }
- GetKeyState, stateI, I, P
- if stateI = D
- {
- Send {I up}
- }
- GetKeyState, stateSP, SPACE, P
- if stateSP = D
- {
- Send {SPACE up}
- }
- GetKeyState, stateSH, SHIFT, P
- if stateSH = D
- {
- Send {SHIFT up}
- }
- Send {SPACE}
- Send {ESC}
- ReadClientResolution(hwnd,w,h)
- MouseMove, (w/2), ((h/2)- ((h-674.4)/6.24)) ;Might have to change the height in this line to work.
- Send {LButton}
- Sleep,150
- Send {LButton}
- Sleep, 200
- BlockInput Off
- }
- Else
- return
- }
- Toggle_Window(window)
- {
- global ClientX, ClientY, ClientW, ClientH
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- WinGet, S, Style, % "ahk_id " window ; Get the style of the window
- If (S & +0x840000) ; if not borderless
- {
- WinGetPos, ClientX, ClientY, ClientW, ClientH
- hwnd:=WinActive("A")
- ReadClientResolution(hwnd,w,h)
- WinMove, % "ahk_id " window,, %ClientX%, %ClientY%, %w%, %h%
- WinSet, Style, -0x840000, % "ahk_id " window ; Remove borders
- WinSet, Style, -0x400000, % "ahk_id " window
- Confine := !Confine
- ClipCursor(Confine, (ClientX), (ClientY), (ClientX+w),(ClientY+h))
- return
- }
- If (S & -0x840000) ; if borderless
- {
- WinSet, Style, +0x840000, % "ahk_id " window ; Reapply borders
- WinSet, Style, +0x400000, % "ahk_id " window
- WinMove, % "ahk_id " window,, %ClientX%, %ClientY%, %ClientW%, %ClientW%
- Confine := !Confine
- ClipCursor(Confine, 0, 0, A_ScreenWidth, A_ScreenHeight)
- return
- }
- }
- }
- ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 )
- {
- VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
- Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
- }
- F1::
- desync=1
- return
- F2::
- remaining = 1
- return
- F3::
- DPSCalc()
- return
- F4::
- QuitToLoginScreen(WinActive("A"))
- return
- F10::
- tradechat = 1
- return
- F11::
- ExitToCharacterSelection()
- return
- F12::
- UsePortal()
- return
- !w::
- WinGet, window, ID, A ; Use the ID of the active window.
- Toggle_Window(window)
- return
- Enter::
- SendInput {NumpadEnter}
- testingame = 1
- return
- GuiUpdate:
- Gui, Submit, NoHide
- GuiControl, , minLifePercentToQuitUpdate, %minLifePercentToQuit%
- GuiControl, , minESPercentToQuitUpdate, %minESPercentToQuit%
- GuiControl, , minLifePercentToJadeUpdate, %minLifePercentToJade%
- GuiControl, , minESPercentToJadeUpdate, %minESPercentToJade%
- GuiControl, , minLifePercentToGraniteUpdate, %minLifePercentToGranite%
- GuiControl, , minESPercentToGraniteUpdate, %minESPercentToGranite%
- GuiControl, , minLifePercentToDrinkUpdate, %minLifePercentToDrink%
- GuiControl, , minManaPercentToDrinkUpdate, %minManaPercentToDrink%
- GuiControl, , minManaToDrinkPotUpdate, %minManaToDrinkPot%
- GuiControl, , InstantFlaskDelayUpdate, %InstantFlaskDelay%
- GuiControl, , minLifePercentToSpamUpdate, %minLifePercentToSpam%
- GuiControl, , TradeSpamUpdate, %TradeSpam%
- GuiControl, , ResyncSpamUpdate, %ResyncSpam%
- If ConfigChoice = 1
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config1, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config1, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config1, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config1, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config1, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config1, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config1, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config1, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config1, minManaToDrinkPot
- IniWrite, %minLifePercentToSpam% , Config.ini, Config1, minLifePercentToSpam
- IniWrite, %ResyncSpam% , Config.ini, Config1, ResyncSpam
- }
- else If ConfigChoice = 2
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config2, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config2, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config2, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config2, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config2, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config2, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config2, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config2, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config2, minManaToDrinkPot
- IniWrite, %minLifePercentToSpam% , Config.ini, Config2, minLifePercentToSpam
- IniWrite, %ResyncSpam% , Config.ini, Config2, ResyncSpam
- }
- else If ConfigChoice = 3
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config3, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config3, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config3, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config3, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config3, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config3, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config3, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config3, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config3, minManaToDrinkPot
- IniWrite, %minLifePercentToSpam% , Config.ini, Config3, minLifePercentToSpam
- IniWrite, %ResyncSpam% , Config.ini, Config3, ResyncSpam
- }
- else If ConfigChoice = 4
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config4, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config4, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config4, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config4, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config4, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config4, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config4, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config4, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config4, minManaToDrinkPot
- IniWrite, %minLifePercentToSpam% , Config.ini, Config4, minLifePercentToSpam
- IniWrite, %ResyncSpam% , Config.ini, Config4, ResyncSpam
- }
- else If ConfigChoice = 5
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config5, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config5, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config5, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config5, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config5, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config5, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config5, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config5, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config5, minManaToDrinkPot
- IniWrite, %minLifePercentToSpam% , Config.ini, Config5, minLifePercentToSpam
- IniWrite, %ResyncSpam% , Config.ini, Config5, ResyncSpam
- }
- IniWrite, %InstantFlaskDelay% , Config.ini, Config, InstantFlaskDelay
- IFDelay:= InstantFlaskDelay
- PlayerConfig["Default"]:={minLifeRatioToInstant: minLifePercentToSpam/100, IFlaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopGranite: minLifePercentToGranite/100, minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100, minNShieldRatioToQuit: minESPercentToQuit/100, minNShieldRatioToPopGranite: minESPercentToGranite/100, minNShieldRatioToPopJade: minESPercentToJade/100}
- PlayerConfig["Default"].FlaskConfig:=[]
- PlayerConfig["Default"].FlaskConfig[1]:={Hotkey:"{1 Down 1 UP}"} ; ,OverrideFlaskDuration: 70, instantRecoveryOnLowLife:true, } ;specify override recovery time in deciseconds, e.g. 7 seconds = 70
- PlayerConfig["Default"].FlaskConfig[2]:={Hotkey:"{2 Down 2 UP}"}
- PlayerConfig["Default"].FlaskConfig[3]:={Hotkey:"{3 Down 3 UP}"}
- PlayerConfig["Default"].FlaskConfig[4]:={Hotkey:"{4 Down 4 UP}"}
- PlayerConfig["Default"].FlaskConfig[5]:={Hotkey:"{5 Down 5 UP}"}
- return
- Default:
- Gui, Submit, NoHide
- GuiControl, , minLifePercentToQuit, 35
- GuiControl, , minLifePercentToQuitUpdate, 35
- minLifePercentToQuit := 35
- GuiControl, , minESPercentToQuit, 0
- GuiControl, , minESPercentToQuitUpdate, 0
- minESPercentToQuit := 0
- GuiControl, , minLifePercentToJade, 70
- GuiControl, , minLifePercentToJadeUpdate, 70
- minLifePercentToJade := 70
- GuiControl, , minESPercentToJade, 0
- GuiControl, , minESPercentToJadeUpdate, 0
- minESPercentToJade := 0
- GuiControl, , minLifePercentToGranite, 70
- GuiControl, , minLifePercentToGraniteUpdate, 70
- minLifePercentToGranite := 70
- GuiControl, , minESPercentToGranite, 0
- GuiControl, , minESPercentToGraniteUpdate, 0
- minESPercentToGranite := 0
- GuiControl, , minLifePercentToDrink, 55
- GuiControl, , minLifePercentToDrinkUpdate, 55
- minLifePercentToDrink := 55
- GuiControl, , minManaPercentToDrink, 25
- GuiControl, , minManaPercentToDrinkUpdate, 25
- minManaPercentToDrink := 25
- GuiControl, , minManaToDrinkPot, 15
- GuiControl, , minManaToDrinkPotUpdate, 15
- minManaToDrinkPot := 15
- GuiControl, , InstantFlaskDelay, 50
- GuiControl, , InstantFlaskDelayUpdate, 50
- InstantFlaskDelay := 50
- GuiControl, , ResyncSpam, 0
- GuiControl, , ResyncSpamUpdate, 0
- ResyncSpam := 0
- IniWrite, %InstantFlaskDelay% , Config.ini, Config, InstantFlaskDelay
- ResyncTimer:= 0
- TradeTimer:= 0
- TradeChannel:= 0
- tradechat:= 0
- TradeTimer:= 0
- TradeTimer2:= 0
- TradeStep:= 3
- TradeSpamTimer:= 99999
- TradeSpam = 0
- GuiControl, , TradeSpam, 0
- GuiControl, , TradeSpamUpdate, 0
- IniWrite, 0 , Config.ini, Config, TradeSpam
- If ConfigChoice = 1
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config1, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config1, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config1, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config1, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config1, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config1, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config1, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config1, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config1, minManaToDrinkPot
- }
- else If ConfigChoice = 2
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config2, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config2, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config2, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config2, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config2, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config2, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config2, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config2, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config2, minManaToDrinkPot
- }
- else If ConfigChoice = 3
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config3, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config3, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config3, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config3, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config3, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config3, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config3, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config3, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config3, minManaToDrinkPot
- }
- else If ConfigChoice = 4
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config4, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config4, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config4, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config4, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config4, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config4, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config4, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config4, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config4, minManaToDrinkPot
- }
- else If ConfigChoice = 5
- {
- IniWrite, %minLifePercentToQuit% , Config.ini, Config5, minLifePercentToQuit
- IniWrite, %minESPercentToQuit% , Config.ini, Config5, minESPercentToQuit
- IniWrite, %minLifePercentToJade% , Config.ini, Config5, minLifePercentToJade
- IniWrite, %minESPercentToJade% , Config.ini, Config5, minESPercentToJade
- IniWrite, %minLifePercentToGranite% , Config.ini, Config5, minLifePercentToGranite
- IniWrite, %minESPercentToGranite% , Config.ini, Config5, minESPercentToGranite
- IniWrite, %minLifePercentToDrink% , Config.ini, Config5, minLifePercentToDrink
- IniWrite, %minManaPercentToDrink% , Config.ini, Config5, minManaPercentToDrink
- IniWrite, %minManaToDrinkPot% , Config.ini, Config5, minManaToDrinkPot
- }
- PlayerConfig["Default"]:={minLifeRatioToInstant: minLifePercentToSpam/100, IFlaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopGranite: minLifePercentToGranite/100, minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100, minNShieldRatioToQuit: minESPercentToQuit/100, minNShieldRatioToPopGranite: minESPercentToGranite/100, minNShieldRatioToPopJade: minESPercentToJade/100}
- PlayerConfig["Default"].FlaskConfig:=[]
- PlayerConfig["Default"].FlaskConfig[1]:={Hotkey:"{1 Down 1 UP}"} ; ,OverrideFlaskDuration: 70, instantRecoveryOnLowLife:true, } ;specify override recovery time in deciseconds, e.g. 7 seconds = 70
- PlayerConfig["Default"].FlaskConfig[2]:={Hotkey:"{2 Down 2 UP}"}
- PlayerConfig["Default"].FlaskConfig[3]:={Hotkey:"{3 Down 3 UP}"}
- PlayerConfig["Default"].FlaskConfig[4]:={Hotkey:"{4 Down 4 UP}"}
- PlayerConfig["Default"].FlaskConfig[5]:={Hotkey:"{5 Down 5 UP}"}
- return
- AutoQuitList:
- Gui, Submit, NoHide
- If AutoQuitChoice = 1
- autoQuitMode:=1
- If AutoQuitChoice = 2
- autoQuitMode:=0
- If AutoQuitChoice = 3
- {
- MsgBox, Test with [F3] First, This is not coded for all resolutions.
- autoQuitMode:=2
- }
- If AutoQuitChoice = 4
- {
- MsgBox, This is still beta. This is only for testing.`nDont use in Harcore`nIt will fail.`nThe only currency in your first line of your`ninventory should be portal scrolls.`nTest With [F2] First`n`nUse Ctrl+Alt+Del to unstuck.
- autoQuitMode:=3
- }
- If AutoQuitChoice = 5
- autoQuitMode:=4
- IniWrite, %AutoQuitChoice% , Config.ini, Config, AutoQuitMethod
- return
- ConfigList:
- Gui, Submit, NoHide
- If ConfigChoice = 1
- {
- IniRead, minLifePercentToQuit , Config.ini, Config1, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config1, minESPercentToQuit1, 0
- IniRead, minLifePercentToJade , Config.ini, Config1, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config1, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config1, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config1, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config1, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config1, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot1 , Config.ini, Config1, minManaToDrinkPot, 15
- IniWrite, 1, Config.ini, Config, ConfigNumber
- }
- else If ConfigChoice = 2
- {
- IniRead, minLifePercentToQuit , Config.ini, Config2, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config2, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config2, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config2, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config2, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config2, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config2, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config2, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config2, minManaToDrinkPot, 15
- IniWrite, 2, Config.ini, Config, ConfigNumber
- }
- else If ConfigChoice = 3
- {
- IniRead, minLifePercentToQuit , Config.ini, Config3, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config3, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config3, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config3, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config3, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config3, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config3, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config3, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config3, minManaToDrinkPot, 15
- IniWrite, 3, Config.ini, Config, ConfigNumber
- }
- else If ConfigChoice = 4
- {
- IniRead, minLifePercentToQuit , Config.ini, Config4, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config4, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config4, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config4, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config4, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config4, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config4, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config4, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config4, minManaToDrinkPot, 15
- IniWrite, 4, Config.ini, Config, ConfigNumber
- }
- else If ConfigChoice = 5
- {
- IniRead, minLifePercentToQuit , Config.ini, Config5, minLifePercentToQuit, 35
- IniRead, minESPercentToQuit , Config.ini, Config5, minESPercentToQuit, 0
- IniRead, minLifePercentToJade , Config.ini, Config5, minLifePercentToJade, 70
- IniRead, minESPercentToJade , Config.ini, Config5, minESPercentToJade, 0
- IniRead, minLifePercentToGranite , Config.ini, Config5, minLifePercentToGranite, 70
- IniRead, minESPercentToGranite , Config.ini, Config5, minESPercentToGranite, 0
- IniRead, minLifePercentToDrink , Config.ini, Config5, minLifePercentToDrink, 55
- IniRead, minManaPercentToDrink , Config.ini, Config5, minManaPercentToDrink, 25
- IniRead, minManaToDrinkPot , Config.ini, Config5, minManaToDrinkPot, 15
- IniWrite, 5, Config.ini, Config, ConfigNumber
- }
- GuiControl, , minLifePercentToQuit, %minLifePercentToQuit%
- GuiControl, , minLifePercentToQuitUpdate, %minLifePercentToQuit%
- GuiControl, , minESPercentToQuit, %minESPercentToQuit%
- GuiControl, , minESPercentToQuitUpdate, %minESPercentToQuit%
- GuiControl, , minLifePercentToJade, %minLifePercentToJade%
- GuiControl, , minLifePercentToJadeUpdate, %minLifePercentToJade%
- GuiControl, , minESPercentToJade, %minESPercentToJade%
- GuiControl, , minESPercentToJadeUpdate, %minESPercentToJade%
- GuiControl, , minLifePercentToGranite, %minLifePercentToGranite%
- GuiControl, , minLifePercentToGraniteUpdate, %minLifePercentToGranite%
- GuiControl, , minESPercentToGranite, %minESPercentToGranite%
- GuiControl, , minESPercentToGraniteUpdate, %minESPercentToGranite%
- GuiControl, , minLifePercentToDrink, %minLifePercentToDrink%
- GuiControl, , minLifePercentToDrinkUpdate, %minLifePercentToDrink%
- GuiControl, , minManaPercentToDrink, %minManaPercentToDrink%
- GuiControl, , minManaPercentToDrinkUpdate, %minManaPercentToDrink%
- GuiControl, , minManaToDrinkPot, %minManaToDrinkPot%
- GuiControl, , minManaToDrinkPotUpdate, %minManaToDrinkPot%
- PlayerConfig["Default"]:={minLifeRatioToInstant: minLifePercentToSpam/100, IFlaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopGranite: minLifePercentToGranite/100, minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100, minNShieldRatioToQuit: minESPercentToQuit/100, minNShieldRatioToPopGranite: minESPercentToGranite/100, minNShieldRatioToPopJade: minESPercentToJade/100}
- PlayerConfig["Default"].FlaskConfig:=[]
- PlayerConfig["Default"].FlaskConfig[1]:={Hotkey:"{1 Down 1 UP}"}
- PlayerConfig["Default"].FlaskConfig[2]:={Hotkey:"{2 Down 2 UP}"}
- PlayerConfig["Default"].FlaskConfig[3]:={Hotkey:"{3 Down 3 UP}"}
- PlayerConfig["Default"].FlaskConfig[4]:={Hotkey:"{4 Down 4 UP}"}
- PlayerConfig["Default"].FlaskConfig[5]:={Hotkey:"{5 Down 5 UP}"}
- return
- TrayNotificationsCheck:
- Gui, Submit, NoHide
- If TrayCheckBox = 0
- {
- TrayNotificationsCheck = 0
- trayNotifications:=true
- }
- If TrayCheckBox = 1
- {
- TrayNotificationsCheck = 1
- trayNotifications:=false
- }
- IniWrite, %TrayNotificationsCheck% , Config.ini, Config, TrayNotificationsCheck
- return
- SteamCheck:
- Gui, Submit, NoHide
- If SteamCheckBox = 0
- {
- IniWrite, 0 , Config.ini, Config, baseMgrPtr
- IniWrite, 0 , Config.ini, Config, SteamCheck
- MsgBox, The Base Pointer Has Been Erased,`nNext Time You Open the Script, `nIt Will Search for it Again `n`nThe Script Will now Close.
- }
- If SteamCheckBox = 1
- {
- IniWrite, 0 , Config.ini, Config, baseMgrPtr
- IniWrite, 1 , Config.ini, Config, SteamCheck
- MsgBox, The Base Pointer Has Been Erased,`nNext Time You Open the Script, `nIt Will Search for it Again `n`nThe Script Will now Close.
- }
- ExitApp
- showgui:
- Gui, Show, x760 y198 h582 w473,
- Return
- DisableSlot:
- Gui, Submit, NoHide
- If DisableSlot1 = 0
- {
- IniWrite, 0 , Config.ini, DisableSlot, DisableSlot1
- }
- else If DisableSlot1 = 1
- {
- IniWrite, 1 , Config.ini, DisableSlot, DisableSlot1
- }
- If DisableSlot2 = 0
- {
- IniWrite, 0 , Config.ini, DisableSlot, DisableSlot2
- }
- else If DisableSlot2 = 1
- {
- IniWrite, 1 , Config.ini, DisableSlot, DisableSlot2
- }
- If DisableSlot3 = 0
- {
- IniWrite, 0 , Config.ini, DisableSlot, DisableSlot3
- }
- else If DisableSlot3 = 1
- {
- IniWrite, 1 , Config.ini, DisableSlot, DisableSlot3
- }
- If DisableSlot4 = 0
- {
- IniWrite, 0 , Config.ini, DisableSlot, DisableSlot4
- }
- else If DisableSlot4 = 1
- {
- IniWrite, 1 , Config.ini, DisableSlot, DisableSlot4
- }
- If DisableSlot5 = 0
- {
- IniWrite, 0 , Config.ini, DisableSlot, DisableSlot5
- }
- else If DisableSlot5 = 1
- {
- IniWrite, 1 , Config.ini, DisableSlot, DisableSlot5
- }
- return
- Find:
- Gui, Submit, NoHide
- IniWrite, 0 , Config.ini, Config, baseMgrPtr
- MsgBox, The Base Pointer Has Been Erased,`nNext Time You Open the Script, `nIt Will Search for it Again `n`nThe Script Will now Close.
- ExitApp
- ReadMe:
- MsgBox, ------------------------------HOTKEYS------------------------------`n`n[F1] --- Use Resync Command`n[F2] --- Use Remaining Command`n[F3] --- Over an Item for DPSCalc`n[F4] --- Test Exit to Log In Screen`n[F10] -- Send Last Chat Message to Trade Channels 1-10`n[F11] -- Test Exit to Character Selection`n[F12] -- Test Use Portal`n[Alt + W] - Change Window to Bordeless, and locks mouse on window.`n`n------------------------------CREDITS------------------------------`n`n Base Script Created by Wrongusername.`n`n GUI and a Few Improvements by Gurud.`n`n DPSCalc By Nipper`n`n----------------------------MORE INFO----------------------------`n`nFor more Info and Updates Go to:`n`n http://www.ownedcore.com/forums`n/mmo/path-of-exile/poe-bots-programs`n/451206-poe-autoflask-autoscript-improvements-updates.html`n`nTip: Press Ctrl+C to copy this MessageBox contents to clipboard.
- return
- GuiClose:
- Gui, Submit
- if (trayNotifications)
- {
- TrayTip, Script is Still Running in the Background, %A_Space% , 2
- }
- return
- PortalInvCheck()
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- SendMode Input
- clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
- ErrorLevel = 0
- Send ^c
- ClipWait, 0.05 ; Wait for the clipboard to contain text.
- If ErrorLevel = 1
- {
- return false
- }
- ItemLevel := ""
- Name := ""
- Type := ""
- Quality := 0
- AttackSpeed := 0
- PhysicalDamageLow := 0
- PhysicalDamageHigh := 0
- IncreasedPhysicalDamage := 0
- FireDamageLow := 0
- FireDamageHigh := 0
- ColdDamageLow := 0
- ColdDamageHigh := 0
- LightningDamageLow := 0
- LightningDamageHigh := 0
- ChaosDamageLow := 0
- ChaosDamageHigh := 0
- Armour := 0
- EvasionRating := 0
- EnergyShield := 0
- Loop, parse, Clipboard, `n, `r ; Goes through a loop with the lines of text found in the clipboard
- {
- if (A_Index = 1)
- {
- IfNotInString, A_Loopfield, Rarity: ; Starts a check whether it has "Rarity:" in the first line, otherwise exit
- {
- Exit
- }
- }
- else if (A_Index = 2)
- {
- Name := A_Loopfield
- }
- else if (A_Index = 3)
- {
- Type := A_Loopfield
- }
- else if (!ItemLevel && RegExMatch(A_Loopfield, "Itemlevel: (\d*)", SubPat))
- {
- ItemLevel := SubPat1
- }
- else if (!Quality && RegExMatch(A_Loopfield, "Quality: \+(\d*)\%", SubPat))
- {
- Quality := SubPat1/100
- }
- else if (!AttackSpeed && RegExMatch(A_Loopfield, "Attacks per Second: (\d\.\d*)", SubPat))
- {
- AttackSpeed := SubPat1
- }
- else if (!PhysicalDamageLow && RegExMatch(A_Loopfield, "Physical Damage: (\d*)-(\d*)", SubPat))
- {
- PhysicalDamageLow := SubPat1
- PhysicalDamageHigh := SubPat2
- }
- else if (!IncreasedPhysicalDamage && RegExMatch(A_Loopfield, "(\d*)\% increased Physical Damage", SubPat))
- {
- IncreasedPhysicalDamage := SubPat1/100
- }
- else if (!FireDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Fire Damage", SubPat))
- {
- FireDamageLow := SubPat1
- FireDamageHigh := SubPat2
- }
- else if (!ColdDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Cold Damage", SubPat))
- {
- ColdDamageLow := SubPat1
- ColdDamageHigh := SubPat2
- }
- else if (!LightningDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Lightning Damage", SubPat))
- {
- LightningDamageLow := SubPat1
- LightningDamageHigh := SubPat2
- }
- else if (!ChaosDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Chaos Damage", SubPat))
- {
- ChaosDamageLow := SubPat1
- ChaosDamageHigh := SubPat2
- }
- else if (!Armour && RegExMatch(A_Loopfield, "Armour: (\d*)", SubPat))
- {
- Armour:= SubPat1
- }
- else if (!EvasionRating && RegExMatch(A_Loopfield, "Evasion Rating: (\d*)", SubPat))
- {
- EvasionRating:= SubPat1
- }
- else if (!EnergyShield && RegExMatch(A_Loopfield, "Energy Shield: (\d*)", SubPat))
- {
- EnergyShield:= SubPat1
- }
- }
- if (!ItemLevel) ; If we didn't get the itemlevel...
- {
- Portal := "Portal Scroll"
- If Portal = %name%
- return true
- Else
- return false
- }
- }
- return false
- }
- ; DPS Calculator Script
- ; This script can be found here:
- ; https://www.pathofexile.com/forum/view-thread/594346
- ; If you have any questions or comments please post them there as well. If you think you can help
- ; improve this project. I am looking for contributors. So Pm me if you think you can help.
- ;
- ;
- ; If you have a issue please post what version you are using.
- ; Reason being is that something that might be a issue might already be fixed.
- ; Version: 1.2d
- ;DPSCalc Credits:
- ;Nipper4369, creator of DPSCalc
- ;mcpower for the base iLVL display of the script 5months ago before Immo.
- ;Immo for the base iLVL display of the script.(Which was taken from mcpower.)
- ;olop4444 for helping Nipper4369 figure out the calculations for Q20 items.
- ;Aeons for a rewrite and fancy tooltips.
- ;kongyuyu for base item level display.
- ;Fayted for testing the script.
- ; Creates a font for later use
- CreateFont()
- {
- global FontSize
- Options :=
- If (!(FontSize = ""))
- {
- Options = s%FontSize%
- }
- Gui Font, %Options%, Courier New
- Gui Font, %Options%, Consolas
- Gui Add, Text, HwndHidden,
- SendMessage, 0x31,,,, ahk_id %Hidden%
- return ErrorLevel
- }
- ; Sets the font for a created ahk tooltip
- SetFont(Font)
- {
- SendMessage, 0x30, Font, 1,, ahk_class tooltips_class32 ahk_exe autohotkey.exe
- }
- ; Parse elemental damage
- ParseDamage(String, DmgType, ByRef DmgLo, ByRef DmgHi)
- {
- IfInString, String, %DmgType% Damage
- {
- IfInString, String, Converted to or IfInString, String, taken as
- Return
- IfNotInString, String, increased
- {
- StringSplit, Arr, String, %A_Space%
- StringSplit, Arr, Arr2, -
- DmgLo := Arr1
- DmgHi := Arr2
- }
- }
- }
- ; Parse clipboard content for item level and dps
- DPSCalc()
- {
- IfWinActive Path of Exile ahk_class Direct3DWindowClass
- {
- SendMode Input
- clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
- ErrorLevel = 0
- Send ^c
- ClipWait, 0.05 ; Wait for the clipboard to contain text.
- If ErrorLevel = 1
- {
- return
- }
- NameIsDone := False
- ItemName :=
- ItemLevel := -1
- IsWeapon := False
- PhysLo := 0
- PhysHi := 0
- Quality := 0
- AttackSpeed := 0
- PhysMult := 0
- ChaoLo := 0
- ChaoHi := 0
- ColdLo := 0
- ColdHi := 0
- FireLo := 0
- FireHi := 0
- LighLo := 0
- LighHi := 0
- Loop, Parse, Clipboard, `n, `r
- {
- ; Clipboard must have "Rarity:" in the first line
- If A_Index = 1
- {
- IfNotInString, A_LoopField, Rarity:
- {
- Exit
- }
- Else
- {
- Continue
- }
- }
- ; Get name
- If Not NameIsDone
- {
- If A_LoopField = --------
- {
- NameIsDone := True
- }
- Else
- {
- ItemName := ItemName . A_LoopField . "`n" ; Add a line of name
- }
- Continue
- }
- ; Get item level
- IfInString, A_LoopField, Itemlevel:
- {
- StringSplit, ItemLevelArray, A_LoopField, %A_Space%
- ItemLevel := ItemLevelArray2
- Continue
- }
- ; Get quality
- IfInString, A_LoopField, Quality:
- {
- StringSplit, Arr, A_LoopField, %A_Space%, +`%
- Quality := Arr2
- Continue
- }
- ; Get total physical damage
- IfInString, A_LoopField, Physical Damage:
- {
- IsWeapon = True
- StringSplit, Arr, A_LoopField, %A_Space%
- StringSplit, Arr, Arr3, -
- PhysLo := Arr1
- PhysHi := Arr2
- Continue
- }
- ;Fix for Elemental damage only weapons. Like the Oro's Sacrifice
- IfInString, A_LoopField, Elemental Damage:
- {
- IsWeapon = True
- Continue
- }
- ; These only make sense for weapons
- If IsWeapon
- {
- ; Get attack speed
- IfInString, A_LoopField, Attacks per Second:
- {
- StringSplit, Arr, A_LoopField, %A_Space%
- AttackSpeed := Arr4
- Continue
- }
- ; Get percentage physical damage increase
- IfInString, A_LoopField, increased Physical Damage
- {
- StringSplit, Arr, A_LoopField, %A_Space%, `%
- PhysMult := Arr1
- Continue
- }
- ;Lines to skip fix for converted type damage. Like the Voltaxic Rift
- IfInString, A_LoopField, Converted to
- Goto, SkipDamageParse
- IfInString, A_LoopField, can Shock
- Goto, SkipDamageParse
- ; Parse elemental damage
- ParseDamage(A_LoopField, "Chaos", ChaoLo, ChaoHi)
- ParseDamage(A_LoopField, "Cold", ColdLo, ColdHi)
- ParseDamage(A_LoopField, "Fire", FireLo, FireHi)
- ParseDamage(A_LoopField, "Lightning", LighLo, LighHi)
- SkipDamageParse:
- }
- }
- If ItemLevel = -1 ; Something without an itemlevel
- {
- Exit
- }
- ; Get position of mouse cursor
- global X
- global Y
- MouseGetPos, X, Y
- ; All items should show name and item level
- ; Pad to 3 places
- ItemLevel := " " + ItemLevel
- StringRight, ItemLevel, ItemLevel, 3
- TT = %ItemName%Item lvl: %ItemLevel%
- ; DPS calculations
- If IsWeapon {
- SetFormat, FloatFast, 5.1
- PhysDps := ((PhysLo + PhysHi) / 2) * AttackSpeed
- EleDps := ((ChaoLo + ChaoHi + ColdLo + ColdHi + FireLo + FireHi + LighLo + LighHi) / 2) * AttackSpeed
- TotalDps := PhysDps + EleDps
- TT = %TT%`nPhys DPS: %PhysDps%`nElem DPS: %EleDps%`nTotal DPS: %TotalDps%
- ; Only show Q20 values if item is not Q20
- If Quality < 20
- {
- TotalPhysMult := (PhysMult + Quality + 100) / 100
- BasePhysDps := PhysDps / TotalPhysMult
- Q20Dps := BasePhysDps * ((PhysMult + 120) / 100) + EleDps
- TT = %TT%`nQ20 DPS: %Q20Dps%
- }
- }
- ; Replaces Clipboard with tooltip data
- StringReplace, clipboard, TT, `n, %A_SPACE% , All
- ; Show tooltip, with fixed width font
- ToolTip, %TT%, X + 35, Y + 35
- global FixedFont
- SetFont(FixedFont)
- ; Set up count variable and start timer for tooltip timeout
- global ToolTipTimeout := 0
- SetTimer, ToolTipTimer, 100
- }
- }
- ; Tick every 100 ms
- ; Remove tooltip if mouse is moved or 5 seconds pass
- ToolTipTimer:
- ToolTipTimeout += 1
- MouseGetPos, CurrX, CurrY
- MouseMoved := (CurrX - X)**2 + (CurrY - Y)**2 > 40**2
- If (MouseMoved or ToolTipTimeout >= 50)
- {
- SetTimer, ToolTipTimer, Off
- ToolTip
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement