Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
821
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 177.23 KB | None | 0 0
  1. ;██████╗ ██╗ ██╗ ██████╗ ██╗ ██╗██████╗ ██╗ ██╗██████╗
  2. ;██╔══██╗╚██╗ ██╔╝ ██╔════╝ ██║ ██║██╔══██╗██║ ██║██╔══██╗
  3. ;██████╔╝ ╚████╔╝ ██║ ███╗██║ ██║██████╔╝██║ ██║██║ ██║
  4. ;██╔══██╗ ╚██╔╝ ██║ ██║██║ ██║██╔══██╗██║ ██║██║ ██║
  5. ;██████╔╝ ██║ ╚██████╔╝╚██████╔╝██║ ██║╚██████╔╝██████╔╝
  6. ;╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝
  7.  
  8. ;-------GUI-----------------GUI-----------------GUI-----------------GUI-----------------GUI----------
  9.  
  10. #SingleInstance force
  11.  
  12. IniRead, LastTab, Config.ini, Config, LastTab, Settings
  13.  
  14. If LastTab = AutoFlask
  15. {
  16. Gui,Add,Tab2, x0 y0 w474 h595 gTabFunc vTabChoice,AutoFlask||AutoQuit|Others|Settings|
  17. }
  18. Else If LastTab = AutoQuit
  19. {
  20. Gui,Add,Tab2, x0 y0 w474 h595 gTabFunc vTabChoice,AutoFlask|AutoQuit||Others|Settings|
  21. }
  22. Else If LastTab = Others
  23. {
  24. Gui,Add,Tab2, x0 y0 w474 h595 gTabFunc vTabChoice,AutoFlask|AutoQuit|Others||Settings|
  25. }
  26. Else If LastTab = Settings
  27. {
  28. Gui,Add,Tab2, x0 y0 w474 h595 gTabFunc vTabChoice,AutoFlask|AutoQuit|Others|Settings||
  29. }
  30.  
  31. Gui, Tab, Settings
  32.  
  33. Gui, Add, GroupBox, x12 y110 w220 h60, AutoFlask/AutoQuit Profile
  34.  
  35. IniRead, ConfigNumber , Config.ini, Config, ConfigNumber, 1
  36.  
  37. If ConfigNumber = 1
  38. {
  39. Gui, Add, DropDownList, x22 y130 w200 h21 AltSubmit gConfigList vConfigChoice R5 , Profile 1||Profile 2|Profile 3|Profile 4|Profile 5
  40. }
  41. Else If ConfigNumber = 2
  42. {
  43. Gui, Add, DropDownList, x22 y130 w200 h21 AltSubmit gConfigList vConfigChoice R5 , Profile 1|Profile 2||Profile 3|Profile 4|Profile 5
  44. }
  45. Else If ConfigNumber = 3
  46. {
  47. Gui, Add, DropDownList, x22 y130 w200 h21 AltSubmit gConfigList vConfigChoice R5 , Profile 1|Profile 2|Profile 3||Profile 4|Profile 5
  48. }
  49. Else If ConfigNumber = 4
  50. {
  51. Gui, Add, DropDownList, x22 y130 w200 h21 AltSubmit gConfigList vConfigChoice R5 , Profile 1|Profile 2|Profile 3|Profile 4||Profile 5
  52. }
  53. Else If ConfigNumber = 5
  54. {
  55. Gui, Add, DropDownList, x22 y130 w200 h21 AltSubmit gConfigList vConfigChoice R5 , Profile 1|Profile 2|Profile 3|Profile 4|Profile 5||
  56. }
  57.  
  58. Loop, 5
  59. {
  60. If ConfigNumber = %A_Index%
  61. {
  62. IniRead, minLifePercentToQuit , Config.ini, Config%A_Index%, minLifePercentToQuit, 35
  63. IniRead, minESPercentToQuit , Config.ini, Config%A_Index%, minESPercentToQuit, 0
  64. IniRead, maxLifePercentPerHitToQuit , Config.ini, Config%A_Index%, maxLifePercentPerHitToQuit, 50
  65. IniRead, maxESPercentPerHitToQuit , Config.ini, Config%A_Index%, maxESPercentPerHitToQuit, 0
  66. IniRead, minLifePercentToJade , Config.ini, Config%A_Index%, minLifePercentToJade, 70
  67. IniRead, minLifePercentToJade , Config.ini, Config%A_Index%, minLifePercentToJade, 70
  68. IniRead, minESPercentToJade , Config.ini, Config%A_Index%, minESPercentToJade, 0
  69. IniRead, minLifePercentToElementalResist , Config.ini, Config%A_Index%, minLifePercentToElementalResist, 70
  70. IniRead, minESPercentToElementalResist , Config.ini, Config%A_Index%, minESPercentToElementalResist, 0
  71. IniRead, minLifePercentToDrink , Config.ini, Config%A_Index%, minLifePercentToDrink, 55
  72. IniRead, minManaPercentToDrink , Config.ini, Config%A_Index%, minManaPercentToDrink, 25
  73. IniRead, minManaToDrinkPot , Config.ini, Config%A_Index%, minManaToDrinkPot, 15
  74. IniRead, minLifePercentToSpam, Config.ini, Config%A_Index%, minLifePercentToSpam, 35
  75. IniRead, ResyncSpam, Config.ini, Config%A_Index%, ResyncSpam, 0
  76. IniRead, RemainingSpam, Config.ini, Config%A_Index%, RemainingSpam, 0
  77. IniRead, InstantFlaskDelay, Config.ini, Config%A_Index%, InstantFlaskDelay, 0
  78. IniRead, QuickSilverMovementTimer , Config.ini, Config%A_Index%, QuickSilverMovementTimer, 15
  79. IniRead, RemoveAilmentsTimer , Config.ini, Config%A_Index%, RemoveAilmentsTimer, 10
  80. IniRead, RemoveCorruptedBloodCharges , Config.ini, Config%A_Index%, RemoveCorruptedBloodCharges, 10
  81. }
  82. }
  83.  
  84. IniRead, QuickSilverCheck , Config.ini, Config, QuickSilverCheck, 0
  85.  
  86. IniRead, QuickSilverCheck2 , Config.ini, Config, QuickSilverCheck2, 0
  87.  
  88. IniRead, FlaskOnFrozenCheck , Config.ini, Config, FlaskOnFrozenCheck, 0
  89.  
  90. IniRead, FlaskOnShockedCheck , Config.ini, Config, FlaskOnShockedCheck, 0
  91.  
  92. IniRead, FlaskOnIgnitedCheck , Config.ini, Config, FlaskOnIgnitedCheck, 0
  93.  
  94. IniRead, AttackInPlaceCheck , Config.ini, Config, AttackInPlaceCheck, 0
  95.  
  96. IniRead, HoldCtrlCheck , Config.ini, Config, HoldCtrlCheck, 0
  97.  
  98. IniRead, FlaskOnCurseCheck , Config.ini, Config, FlaskOnCurseCheck, 0
  99.  
  100. IniRead, FlaskOnCorruptedBloodCheck , Config.ini, Config, FlaskOnCorruptedBloodCheck, 0
  101.  
  102. Gui, Tab, AutoFlask
  103.  
  104. Gui, Add, GroupBox, x12 y250 w220 h60 , Min Life `% to Use Jade/Granite Flask
  105. Gui, Add, Slider, x22 y270 w170 h30 gGuiUpdate vminLifePercentToJade +ToolTip TickInterval25, %minLifePercentToJade%
  106. Gui, Add, Text, x192 y270 w20 h30 vminLifePercentToJadeUpdate , %minLifePercentToJade%
  107. Gui, Add, Text, x212 y270 w10 h30 vminLifePercentToJadeUpdatePercent, `%
  108.  
  109. Gui, Add, GroupBox, x242 y250 w220 h60 , Min E.Shield `% to Use Jade/Granite Flask
  110. Gui, Add, Slider, x252 y270 w170 h30 gGuiUpdate vminESPercentToJade +ToolTip TickInterval25, %minESPercentToJade%
  111. Gui, Add, Text, x422 y270 w20 h30 vminESPercentToJadeUpdate, %minESPercentToJade%
  112. Gui, Add, Text, x442 y270 w10 h30 vminESPercentToJadeUpdatePercent, `%
  113.  
  114. Gui, Add, GroupBox, x12 y320 w220 h60 , Min Life `% to Use Elemental Resist Flask
  115. Gui, Add, Slider, x22 y340 w170 h30 gGuiUpdate vminLifePercentToElementalResist +ToolTip TickInterval25, %minLifePercentToElementalResist%
  116. Gui, Add, Text, x192 y340 w20 h30 vminLifePercentToElementalResistUpdate, %minLifePercentToElementalResist%
  117. Gui, Add, Text, x212 y340 w10 h30 vminLifePercentToElementalResistUpdatePercent, `%
  118.  
  119. Gui, Add, GroupBox, x242 y320 w220 h60 , Min E.Shield `% to Use Element. Resist Flask
  120. Gui, Add, Slider, x252 y340 w170 h30 gGuiUpdate vminESPercentToElementalResist +ToolTip TickInterval25, %minESPercentToElementalResist%
  121. Gui, Add, Text, x422 y340 w20 h30 vminESPercentToElementalResistUpdate, %minESPercentToElementalResist%
  122. Gui, Add, Text, x442 y340 w10 h30 vminESPercentToElementalResistUpdatePercent, `%
  123.  
  124. Gui, Add, GroupBox, x12 y40 w220 h60 , Min Life `% to Drink Health Potion
  125. Gui, Add, Slider, x22 y60 w170 h30 gGuiUpdate vminLifePercentToDrink +ToolTip TickInterval25, %minLifePercentToDrink%
  126. Gui, Add, Text, x192 y60 w20 h30 vminLifePercentToDrinkUpdate, %minLifePercentToDrink%
  127. Gui, Add, Text, x212 y60 w10 h30 vminLifePercentToDrinkUpdatePercent, `%
  128.  
  129. Gui, Add, GroupBox, x242 y40 w220 h60 , Min Mana `% to Drink Mana Potion
  130. Gui, Add, Slider, x252 y60 w170 h30 gGuiUpdate vminManaPercentToDrink +ToolTip TickInterval25, %minManaPercentToDrink%
  131. Gui, Add, Text, x422 y60 w20 h30 vminManaPercentToDrinkUpdate, %minManaPercentToDrink%
  132. Gui, Add, Text, x442 y60 w10 h30 vminManaPercentToDrinkUpdatePercent, `%
  133.  
  134. Gui, Add, GroupBox, x12 y180 w220 h60 , Min Life `% to Spam Instant Flasks
  135. Gui, Add, Slider, x22 y200 w170 h30 gGuiUpdate vminLifePercentToSpam +ToolTip TickInterval25, %minLifePercentToSpam%
  136. Gui, Add, Text, x192 y200 w20 h30 vminLifePercentToSpamUpdate, %minLifePercentToSpam%
  137. Gui, Add, Text, x212 y200 w10 h30 vminLifePercentToSpamUpdatePercent, `%
  138.  
  139. Gui, Add, GroupBox, x242 y110 w220 h60 , Min Mana to Drink Mana Potion
  140. Gui, Add, Slider, x252 y130 w170 h30 Range0-300 gGuiUpdate vminManaToDrinkPot +ToolTip TickInterval50, %minManaToDrinkPot%
  141. Gui, Add, Text, x422 y130 w30 h30 vminManaToDrinkPotUpdate, %minManaToDrinkPot%
  142.  
  143. Gui, Add, GroupBox, x242 y180 w220 h60 , Instant Flask Spam Delay ;x12 y149 w220 h60
  144. IniRead, InstantFlaskDelay , Config.ini, Config, InstantFlaskDelay, 0
  145. Gui, Add, Slider, x252 y200 w170 h30 Range0-50 gGuiUpdate vInstantFlaskDelay +ToolTip TickInterval50, %InstantFlaskDelay%
  146. Gui, Add, Text, x422 y200 w25 h30 vInstantFlaskDelayUpdate, % Round(InstantFlaskDelay/100,2)
  147. Gui, Add, Text, x447 y200 w10 h30 vInstantFlaskDelayUpdatePercent, s
  148.  
  149. Gui, Add, GroupBox, x12 y390 w220 h60 , Only QuickSilver If Moving for X Seconds
  150. Gui, Add, Slider, x22 y410 w170 h30 Range0-100 gGuiUpdate vQuickSilverMovementTimer +ToolTip TickInterval20, %QuickSilverMovementTimer%
  151. Gui, Add, Text, x192 y410 w22 h30 vQuickSilverMovementTimerUpdate, % Round(QuickSilverMovementTimer/10,1)
  152. Gui, Add, Text, x214 y410 w10 h30 , s
  153.  
  154. Gui, Add, GroupBox, x12 y460 w220 h60 , Only Remove Ailments If They Are Over
  155. Gui, Add, Slider, x22 y480 w170 h30 Range0-50 gGuiUpdate vRemoveAilmentsTimer +ToolTip TickInterval10, %RemoveAilmentsTimer%
  156. Gui, Add, Text, x192 y480 w22 h30 vRemoveAilmentsTimerUpdate, % Round(RemoveAilmentsTimer/10,1)
  157. Gui, Add, Text, x214 y480 w10 h30 , s
  158.  
  159. Gui, Add, GroupBox, x12 y530 w220 h60 , Only Remove Corrupted Blood If X Charges
  160. Gui, Add, Slider, x22 y550 w170 h30 Range1-20 gGuiUpdate vRemoveCorruptedBloodCharges +ToolTip, %RemoveCorruptedBloodCharges%
  161. Gui, Add, Text, x192 y550 w12 h30 vRemoveCorruptedBloodChargesUpdate, %RemoveCorruptedBloodCharges%
  162. Gui, Add, Text, x210 y550 w20 h30 , ch
  163.  
  164. Gui, Add, GroupBox, x12 y110 w220 h60 , Disable AutoFlask on Slot ;x12 y359 w220 h60
  165.  
  166. Loop, 5
  167. {
  168. IniRead, Slot%A_Index%Disabled, Config.ini, DisableSlot, DisableSlot%A_Index%, 0
  169. XSlot:=((A_Index*40)-18)
  170. X=x%XSlot%
  171. If (Slot%A_Index%Disabled = 0)
  172. Gui, Add, CheckBox, %X% y130 w30 h30 vDisableSlot%A_Index% gDisableSlot, %A_Index%
  173. Else If (Slot%A_Index%Disabled = 1)
  174. Gui, Add, CheckBox, %X% y130 w30 h30 checked vDisableSlot%A_Index% gDisableSlot, %A_Index%
  175. }
  176.  
  177. If QuickSilverCheck = 0
  178. {
  179. Gui, Add, CheckBox, x242 y389 w220 h30 vQuickSilverCheckBox gQuickSilverCheck, Use QuickSilver Flask When 40+ Charges
  180. }
  181. If QuickSilverCheck = 1
  182. {
  183. Gui, Add, CheckBox, x242 y389 w220 h30 vQuickSilverCheckBox gQuickSilverCheck Checked, Use QuickSilver Flask When 40+ Charges
  184. }
  185.  
  186. If QuickSilverCheck2 = 0
  187. {
  188. Gui, Add, CheckBox, x242 y418 w220 h30 vQuickSilverCheckBox2 gQuickSilverCheck2, Use QuickSilver Flask When 20+ Charges
  189. }
  190. If QuickSilverCheck2 = 1
  191. {
  192. Gui, Add, CheckBox, x242 y418 w220 h30 vQuickSilverCheckBox2 gQuickSilverCheck2 Checked, Use QuickSilver Flask When 20+ Charges
  193. }
  194.  
  195. If FlaskOnFrozenCheck = 0
  196. {
  197. Gui, Add, CheckBox, x242 y447 w220 h30 vFlaskOnFrozenCheckBox gFlaskOnFrozenCheck, Use Flask to Remove Frozen Ailment
  198. }
  199. If FlaskOnFrozenCheck = 1
  200. {
  201. Gui, Add, CheckBox, x242 y447 w220 h30 vFlaskOnFrozenCheckBox gFlaskOnFrozenCheck Checked, Use Flask to Remove Frozen Ailment
  202. }
  203.  
  204. If FlaskOnShockedCheck = 0
  205. {
  206. Gui, Add, CheckBox, x242 y475 w220 h30 vFlaskOnShockedCheckBox gFlaskOnShockedCheck, Use Flask to Remove Shocked Ailment
  207. }
  208. If FlaskOnShockedCheck = 1
  209. {
  210. Gui, Add, CheckBox, x242 y475 w220 h30 vFlaskOnShockedCheckBox gFlaskOnShockedCheck Checked, Use Flask to Remove Shocked Ailment
  211. }
  212.  
  213. If FlaskOnIgnitedCheck = 0
  214. {
  215. Gui, Add, CheckBox, x242 y503 w220 h30 vFlaskOnIgnitedCheckBox gFlaskOnIgnitedCheck, Use Flask to Remove Burning Ailment
  216. }
  217. If FlaskOnIgnitedCheck = 1
  218. {
  219. Gui, Add, CheckBox, x242 y503 w220 h30 vFlaskOnIgnitedCheckBox gFlaskOnIgnitedCheck Checked, Use Flask to Remove Burning Ailment
  220. }
  221.  
  222. If FlaskOnCurseCheck = 0
  223. {
  224. Gui, Add, CheckBox, x242 y531 w220 h30 vFlaskOnCurseCheckBox gFlaskOnCurseCheck, Use Flask to Remove Curses
  225. }
  226. If FlaskOnCurseCheck = 1
  227. {
  228. Gui, Add, CheckBox, x242 y531 w220 h30 vFlaskOnCurseCheckBox gFlaskOnCurseCheck Checked, Use Flask to Remove Curses
  229. }
  230.  
  231. If FlaskOnCorruptedBloodCheck = 0
  232. {
  233. Gui, Add, CheckBox, x242 y558 w220 h30 vFlaskOnCorruptedBloodCheckBox gFlaskOnCorruptedBloodCheck, Use Flask to Remove Corrupted Blood
  234. }
  235. If FlaskOnCorruptedBloodCheck = 1
  236. {
  237. Gui, Add, CheckBox, x242 y558 w220 h30 vFlaskOnCorruptedBloodCheckBox gFlaskOnCorruptedBloodCheck Checked, Use Flask to Remove Corrupted Blood
  238. }
  239.  
  240.  
  241. Gui, Tab, AutoQuit
  242.  
  243. Gui, Add, GroupBox, x12 y180 w220 h60, Auto Quit Method
  244. IniRead, AutoQuitMethod , Config.ini, Config, AutoQuitMethod, 1
  245. If AutoQuitMethod = 1
  246. {
  247. Gui, Add, DropDownList, x22 y200 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Using cports)||Exit to Login Screen (Writes to Memory)|Alt+F4 (Fastest according to Chris)|Disabled
  248. autoQuitMode:=1
  249. }
  250. Else If AutoQuitMethod = 2
  251. {
  252. Gui, Add, DropDownList, x22 y200 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Using cports)|Exit to Login Screen (Writes to Memory)||Alt+F4 (Fastest according to Chris)|Disabled
  253. autoQuitMode:=0
  254. }
  255. Else If AutoQuitMethod = 3
  256. {
  257. Gui, Add, DropDownList, x22 y200 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Using cports)|Exit to Login Screen (Writes to Memory)|Alt+F4 (Fastest according to Chris)||Disabled
  258. autoQuitMode:=3
  259. }
  260. Else If AutoQuitMethod = 4
  261. {
  262. Gui, Add, DropDownList, x22 y200 w200 h21 AltSubmit gAutoQuitList vAutoQuitChoice R5, Exit to Login Screen (Using cports)|Exit to Login Screen (Writes to Memory)|Alt+F4 (Fastest according to Chris)|Disabled||
  263. autoQuitMode:=4
  264. }
  265.  
  266. Gui, Add, GroupBox, x12 y40 w220 h60 , Min Life `% to Quit
  267. Gui, Add, Slider, x22 y60 w170 h30 gGuiUpdate vminLifePercentToQuit +ToolTip TickInterval25, %minLifePercentToQuit%
  268. Gui, Add, Text, x192 y60 w20 h30 vminLifePercentToQuitUpdate, %minLifePercentToQuit%
  269. Gui, Add, Text, x212 y60 w10 h30 vminLifePercentToQuitUpdatePercent, `%
  270.  
  271. Gui, Add, GroupBox, x242 y40 w220 h60 , Min Energy Shield `% to Quit
  272. Gui, Add, Slider, x252 y60 w170 h30 gGuiUpdate vminESPercentToQuit +ToolTip TickInterval25, %minESPercentToQuit%
  273. Gui, Add, Text, x422 y60 w20 h30 vminESPercentToQuitUpdate, %minESPercentToQuit%
  274. Gui, Add, Text, x442 y60 w10 h30 vminESPercentToQuitUpdatePercent, `%
  275.  
  276. Gui, Add, GroupBox, x12 y110 w220 h60 , Max Life `% Per Hit to Quit
  277. Gui, Add, Slider, x22 y130 w170 h30 gGuiUpdate vmaxLifePercentPerHitToQuit +ToolTip TickInterval25, %maxLifePercentPerHitToQuit%
  278. Gui, Add, Text, x192 y130 w20 h30 vmaxLifePercentPerHitToQuitUpdate, %maxLifePercentPerHitToQuit%
  279. Gui, Add, Text, x212 y130 w10 h30 vmaxLifePercentPerHitToQuitUpdatePercent, `%
  280.  
  281. Gui, Add, GroupBox, x242 y110 w220 h60 , Max Energy Shield `% Per Hit to Quit
  282. Gui, Add, Slider, x252 y130 w170 h30 gGuiUpdate vmaxESPercentPerHitToQuit +ToolTip TickInterval25, %maxESPercentPerHitToQuit%
  283. Gui, Add, Text, x422 y130 w20 h30 vmaxESPercentPerHitToQuitUpdate, %maxESPercentPerHitToQuit%
  284. Gui, Add, Text, x442 y130 w10 h30 vmaxESPercentPerHitToQuitUpdatePercent, `%
  285.  
  286. Gui, Tab, Settings
  287.  
  288. IniRead, DPSCheck , Config.ini, Config, DPSCheck, 0
  289. If DPSCheck = 0
  290. {
  291. Gui, Add, CheckBox, x272 y70 w190 h30 vDPSCheckBox gDPSCheck, Disable DPS Calculator
  292. global DPS:=false
  293. }
  294. If DPSCheck = 1
  295. {
  296. Gui, Add, CheckBox, x272 y70 w190 h30 vDPSCheckBox gDPSCheck Checked, Disable DPS Calculator
  297. global DPS:=true
  298. }
  299.  
  300. ;display tray notIfications about script actions : drinking potions, autoquitting
  301. IniRead, TrayNotIficationsCheck , Config.ini, Config, TrayNotIficationsCheck, 0
  302. If TrayNotIficationsCheck = 0
  303. {
  304. Gui, Add, CheckBox, x272 y40 w190 h30 vTrayCheckBox gTrayNotIficationsCheck, Disable Tray NotIfications
  305. global trayNotIfications:=true
  306. }
  307. If TrayNotIficationsCheck = 1
  308. {
  309. Gui, Add, CheckBox, x272 y40 w190 h30 vTrayCheckBox gTrayNotIficationsCheck Checked, Disable Tray NotIfications
  310. global trayNotIfications:=false
  311. }
  312.  
  313. Gui, Add, GroupBox, x12 y40 w220 h60 , Base Pointer
  314. Gui, Add, Text, x92 y60 w130 h30, Will Automatically Find Itself On New Client/Patch
  315. IniRead, baseMgrPtr , Config.ini, Config, baseMgrPtr, 0
  316. Gui, Add, Text, x22 y70 w70 h20 vbasePtrText , %baseMgrPtr%
  317.  
  318. Gui, Add, Button, x262 y120 w180 h40 gshowgui2, Configure Hotkeys
  319.  
  320. Gui, Add, Button, x32 y190 w180 h40 gshowgui4, Debug Window
  321.  
  322. Gui, Add, Button, x262 y190 w180 h40 gDefaultHotkeys, Restore Default Hotkeys
  323.  
  324. Gui, Add, GroupBox, x12 y250 w220 h60, Client Server
  325. IniRead, ClientServer , Config.ini, Config, ClientServer, 1
  326. If ClientServer = 1
  327. {
  328. Gui, Add, DropDownList, x22 y270 w200 h21 AltSubmit gClientServerList vClientServerChoice R5, Global||Steam|Singapore/Malasya|Taiwan
  329. ClientServerMode:=1
  330. }
  331. Else If ClientServer = 2
  332. {
  333. Gui, Add, DropDownList, x22 y270 w200 h21 AltSubmit gClientServerList vClientServerChoice R5, Global|Steam||Singapore/Malasya|Taiwan
  334. ClientServerMode:=2
  335. }
  336. Else If ClientServer = 3
  337. {
  338. Gui, Add, DropDownList, x22 y270 w200 h21 AltSubmit gClientServerList vClientServerChoice R5, Global|Steam|Singapore/Malasya||Taiwan
  339. ClientServerMode:=3
  340. }
  341. Else If ClientServer = 4
  342. {
  343. Gui, Add, DropDownList, x22 y270 w200 h21 AltSubmit gClientServerList vClientServerChoice R5, Global|Steam|Singapore/Malasya|Taiwan||
  344. ClientServerMode:=4
  345. }
  346.  
  347.  
  348. Gui, Tab, Others
  349.  
  350. IniRead, TradeSpam, Config.ini, Config, TradeSpam, 0
  351. Gui, Add, GroupBox, x12 y40 w220 h60 , Send Trade Message Every X Minutes*
  352. Gui, Add, Slider, x22 y60 w170 h30 gGuiUpdate vTradeSpam +ToolTip TickInterval1 Range0-10, %TradeSpam%
  353. Gui, Add, Text, x192 y60 w20 h30 vTradeSpamUpdate, %TradeSpam%
  354. Gui, Add, Text, x212 y60 w10 h30 vTradeSpamUpdatePercent, m
  355.  
  356. Gui, Add, Text, x22 y565 w400 h21, *Opening the chat will stop and reset the trade spam.
  357.  
  358. Gui, Add, GroupBox, x242 y40 w220 h60 , Send Resync Command Every X Seconds
  359. Gui, Add, Slider, x252 y60 w170 h30 gGuiUpdate vResyncSpam +ToolTip TickInterval30 Range0-120, %ResyncSpam%
  360. Gui, Add, Text, x422 y60 w20 h30 vResyncSpamUpdate, %ResyncSpam%
  361. Gui, Add, Text, x442 y60 w10 h30 vResyncSpamUpdatePercent, s
  362.  
  363. Gui, Add, GroupBox, x242 y110 w220 h60 , Send Remaining Command Every X Secs
  364. Gui, Add, Slider, x252 y130 w170 h30 gGuiUpdate vRemainingSpam +ToolTip TickInterval30 Range0-120, %RemainingSpam%
  365. Gui, Add, Text, x422 y130 w20 h30 vRemainingSpamUpdate, %RemainingSpam%
  366. Gui, Add, Text, x442 y130 w10 h30 vRemainingSpamUpdatePercent, s
  367.  
  368. If AttackInPlaceCheck = 0
  369. {
  370. Gui, Add, CheckBox, x22 y110 w200 h30 vAttackInPlaceCheckBox gAttackInPlaceCheck, Auto Hold In Place When Attacking
  371. }
  372. If AttackInPlaceCheck = 1
  373. {
  374. Gui, Add, CheckBox, x22 y110 w200 h30 vAttackInPlaceCheckBox gAttackInPlaceCheck Checked, Auto Hold In Place When Attacking
  375. }
  376.  
  377. If HoldCtrlCheck = 0
  378. {
  379. Gui, Add, CheckBox, x22 y140 w200 h30 vHoldCtrlCheckBox gHoldCtrlCheck, Auto Hold Ctrl On Waypoint Panel
  380. }
  381. If HoldCtrlCheck = 1
  382. {
  383. Gui, Add, CheckBox, x22 y140 w200 h30 vHoldCtrlCheckBox gHoldCtrlCheck Checked, Auto Hold Ctrl On Waypoint Panel
  384. }
  385.  
  386.  
  387. Gui, Tab
  388.  
  389. Gui, Add, Button, x22 y609 w130 h40 gDefault, Reset Profile
  390. Gui, Add, Button, x182 y609 w120 h40 gReadMe, ReadMe
  391. Gui, Add, Button, x332 y609 w120 h40 gDonate, Donate
  392.  
  393. Gui, Add, Text, x380 y1 w110 h18 vguicontroled, Created by Gurud.
  394.  
  395. Gui, Add, GroupBox, x0 y590 w472 h74 ,
  396. Gui, Add, GroupBox, x1 y591 w470 h72 ,
  397. Gui, Add, GroupBox, x2 y592 w468 h70 ,
  398. Gui, Add, GroupBox, x3 y593 w466 h68 ,
  399. Gui, Add, GroupBox, x4 y594 w464 h66 ,
  400.  
  401. Gui, Add, GroupBox, x0 y21 w472 h575 ,
  402. Gui, Add, GroupBox, x1 y22 w470 h574 ,
  403. Gui, Add, GroupBox, x2 y23 w468 h573 ,
  404. Gui, Add, GroupBox, x3 y24 w466 h572 ,
  405. Gui, Add, GroupBox, x4 y25 w464 h571 ,
  406.  
  407. Menu, Tray, Add, Configuration Window, showgui
  408.  
  409. If (minLifePercentToQuit=0)
  410. {
  411. GuiControl, , minLifePercentToQuitUpdate, N/A
  412. GuiControl, , minLifePercentToQuitUpdatePercent,
  413. }
  414. If (minESPercentToQuit=0)
  415. {
  416. GuiControl, , minESPercentToQuitUpdate, N/A
  417. GuiControl, , minESPercentToQuitUpdatePercent,
  418. }
  419. If (maxLifePercentPerHitToQuit=0 || maxLifePercentPerHitToQuit=100)
  420. {
  421. GuiControl, , maxLifePercentPerHitToQuitUpdate, N/A
  422. GuiControl, , maxLifePercentPerHitToQuitUpdatePercent,
  423. }
  424. If (maxESPercentPerHitToQuit=0)
  425. {
  426. GuiControl, , maxESPercentPerHitToQuitUpdate, N/A
  427. GuiControl, , maxESPercentPerHitToQuitUpdatePercent,
  428. }
  429. If (minLifePercentToJade=0)
  430. {
  431. GuiControl, , minLifePercentToJadeUpdate, N/A
  432. GuiControl, , minLifePercentToJadeUpdatePercent,
  433. }
  434. If (minESPercentToJade=0)
  435. {
  436. GuiControl, , minESPercentToJadeUpdate, N/A
  437. GuiControl, , minESPercentToJadeUpdatePercent,
  438. }
  439. If (minLifePercentToElementalResist=0)
  440. {
  441. GuiControl, , minLifePercentToElementalResistUpdate, N/A
  442. GuiControl, , minLifePercentToElementalResistUpdatePercent,
  443. }
  444. If (minESPercentToElementalResist=0)
  445. {
  446. GuiControl, , minESPercentToElementalResistUpdate, N/A
  447. GuiControl, , minESPercentToElementalResistUpdatePercent,
  448. }
  449. If (minLifePercentToDrink=0)
  450. {
  451. GuiControl, , minLifePercentToDrinkUpdate, N/A
  452. GuiControl, , minLifePercentToDrinkUpdatePercent,
  453. }
  454. If (minManaPercentToDrink=0)
  455. {
  456. GuiControl, , minManaPercentToDrinkUpdate, N/A
  457. GuiControl, , minManaPercentToDrinkUpdatePercent,
  458. }
  459. If (minManaToDrinkPot=0)
  460. {
  461. GuiControl, , minManaToDrinkPotUpdate, N/A
  462. }
  463. If (InstantFlaskDelay=0)
  464. {
  465. GuiControl, , InstantFlaskDelayUpdate, N/A
  466. GuiControl, , InstantFlaskDelayUpdatePercent,
  467. }
  468. If (minLifePercentToSpam=0)
  469. {
  470. GuiControl, , minLifePercentToSpamUpdate, N/A
  471. GuiControl, , minLifePercentToSpamUpdatePercent,
  472. }
  473. If (TradeSpam=0)
  474. {
  475. GuiControl, , TradeSpamUpdate, N/A
  476. GuiControl, , TradeSpamUpdatePercent,
  477. }
  478. If (ResyncSpam=0)
  479. {
  480. GuiControl, , ResyncSpamUpdate, N/A
  481. GuiControl, , ResyncSpamUpdatePercent,
  482. }
  483. If (RemainingSpam=0)
  484. {
  485. GuiControl, , RemainingSpamUpdate, N/A
  486. GuiControl, , RemainingSpamUpdatePercent,
  487. }
  488.  
  489. Gui, Submit
  490.  
  491. StringTrimRight, Name, A_ScriptName, 4
  492.  
  493. Gui, Show, x760 y198 h665 w474, %Name%
  494.  
  495. ;---------------------START DYNAMIC HOTKEYS---------------------
  496.  
  497. ;"Wild Mode allows hotkeys to trigger when other modIfiers are also held.`nFor example, If you bound Ctrl+C to an action...`nWild Mode ON: Ctrl+Alt+C, Ctrl+ShIft+C etc would still trigger the action`nWild Mode OFF: Ctrl+Alt+C etc would not trigger the action."
  498.  
  499. ; Build list of "End Keys" for Input command
  500. EXTRA_KEY_LIST := "{Escape}" ; DO NOT REMOVE! - Used to quit binding
  501. ; Standard non-printables
  502. EXTRA_KEY_LIST .= "{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}"
  503. EXTRA_KEY_LIST .= "{Home}{End}{PgUp}{PgDn}{Del}{Ins}{BackSpace}{Pause}"
  504. ; Numpad - Numlock ON
  505. EXTRA_KEY_LIST .= "{Numpad0}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}{NumpadDot}{NumpadMult}{NumpadAdd}{NumpadSub}"
  506. ; Numpad - Numlock OFF
  507. EXTRA_KEY_LIST .= "{NumpadIns}{NumpadEnd}{NumpadDown}{NumpadPgDn}{NumpadLeft}{NumpadClear}{NumpadRight}{NumpadHome}{NumpadUp}{NumpadPgUp}{NumpadDel}"
  508. ; Numpad - Common
  509. EXTRA_KEY_LIST .= "{NumpadMult}{NumpadAdd}{NumpadSub}{NumpadDiv}{NumpadEnter}"
  510. ; Stuff we may or may not want to trap
  511. ;EXTRA_KEY_LIST .= "{Numlock}"
  512. EXTRA_KEY_LIST .= "{Capslock}"
  513. ;EXTRA_KEY_LIST .= "{PrintScreen}"
  514. ; Browser keys
  515. EXTRA_KEY_LIST .= "{Browser_Back}{Browser_Forward}{Browser_Refresh}{Browser_Stop}{Browser_Search}{Browser_Favorites}{Browser_Home}"
  516. ; Media keys
  517. EXTRA_KEY_LIST .= "{Volume_Mute}{Volume_Down}{Volume_Up}{Media_Next}{Media_Prev}{Media_Stop}{Media_Play_Pause}"
  518. ; App Keys
  519. EXTRA_KEY_LIST .= "{Launch_Mail}{Launch_Media}{Launch_App1}{Launch_App2}"
  520.  
  521. ; BindMode vars
  522. HKModIfierState := {} ; The state of the modIfiers at the end of the last detection sequence
  523. HKControlType := 0 ; The kind of control that the last hotkey was. 0 = regular key, 1 = solitary modIfier, 2 = mouse, 3 = joystick
  524. HKSecondaryInput := "" ; Set to button pressed If the last detected bind was a Mouse button, Joystick button or Solitary ModIfier
  525. HKLastHotkey := 0 ; Time that Escape was pressed to exit key binding. Used to determine If Escape is held (Clear binding)
  526.  
  527. DefaultHKObject := {hk: "", type: "", wild: ""}
  528.  
  529. ; Misc vars
  530. ININame := "Config.ini"
  531. HotkeyList := []
  532. NumHotkeys := 9
  533.  
  534. ; Create the GUI
  535. Gui 2:Add, Text,, This allows you to change Hotkeys.`n Click the "ReadMe" button to know what the hotkeys do.
  536. Gui, 2:Add, Text, x357 y25 w30 center, Wild`nMode
  537.  
  538. ypos := 50
  539.  
  540. ;Gui, 2:Add, Text, x5 y40 w300 center,Hotkey
  541. ;Gui, 2:Add, Text, x300 y40 center,~ *
  542.  
  543. Loop % NumHotkeys
  544. {
  545. Gui, 2:Add, Edit, Disabled vHotkeyName%A_Index% w260 x5 y%ypos%, None
  546. Gui, 2:Add, Button, gBind vBind%A_Index% yp-1 xp+270, Set Hotkey
  547. Gui, 2:Add, Checkbox, vWild%A_Index% gOptionChanged xp+90 yp+5
  548. ;Gui, 2:Add, Checkbox, vBlock%A_Index% gOptionChanged xp+30 yp
  549. ypos += 25
  550. }
  551.  
  552.  
  553. ; Set GUI State
  554. LoadSettings()
  555.  
  556. ; Enable defined hotkeys
  557. EnableHotkeys()
  558.  
  559. Menu, Tray, Add, Configure Hotkeys, showgui2 ;Check the box If Win modIfier is used.
  560. Gui, 2:Submit, Hide
  561.  
  562. Menu Tray, NoStandard
  563.  
  564. Menu Tray, Standard
  565.  
  566. Menu Tray,Check, Configure Hotkeys
  567. Menu Tray,Check, Configuration Window
  568.  
  569. ;---------------------END DYNAMIC HOTKEYS---------------------
  570. ;---------------------DEBUG WINDOW----------------------------
  571.  
  572. Gui, 4:Add, GroupBox, x5 y0 w300 h300 , Player Stats
  573. ypos := 25
  574. Gui, 4:Add, Text, x15 y%ypos% w155, Max HP
  575. Gui, 4:Add, Edit, Disabled vMaxHPvar x140 y%ypos% w150, Not In Game or Broken
  576. ypos += 25
  577. Gui, 4:Add, Text, x15 y%ypos% w155, Current HP
  578. Gui, 4:Add, Edit, Disabled vCurrHPvar x140 y%ypos% w150, Not In Game or Broken
  579. ypos += 25
  580. Gui, 4:Add, Text, x15 y%ypos% w155, Reserved HP Flat
  581. Gui, 4:Add, Edit, Disabled vReservedHPFlatvar x140 y%ypos% w150, Not In Game or Broken
  582. ypos += 25
  583. Gui, 4:Add, Text, x15 y%ypos% w155, Reserved HP Percent
  584. Gui, 4:Add, Edit, Disabled vReservedHPPercentvar x140 y%ypos% w150, Not In Game or Broken
  585. ypos += 25
  586. Gui, 4:Add, Text, x15 y%ypos% w155, Max Mana
  587. Gui, 4:Add, Edit, Disabled vMaxManavar x140 y%ypos% w150, Not In Game or Broken
  588. ypos += 25
  589. Gui, 4:Add, Text, x15 y%ypos% w155, Current Mana
  590. Gui, 4:Add, Edit, Disabled vCurrManavar x140 y%ypos% w150, Not In Game or Broken
  591. ypos += 25
  592. Gui, 4:Add, Text, x15 y%ypos% w155, Reserved Mana Flat
  593. Gui, 4:Add, Edit, Disabled vReservedManaFlatvar x140 y%ypos% w150, Not In Game or Broken
  594. ypos += 25
  595. Gui, 4:Add, Text, x15 y%ypos% w155, Reserved Mana Percent
  596. Gui, 4:Add, Edit, Disabled vReservedManaPercentvar x140 y%ypos% w150, Not In Game or Broken
  597. ypos += 25
  598. Gui, 4:Add, Text, x15 y%ypos% w155, Max Energy Shield
  599. Gui, 4:Add, Edit, Disabled vMaxEShieldvar x140 y%ypos% w150, Not In Game or Broken
  600. ypos += 25
  601. Gui, 4:Add, Text, x15 y%ypos% w155, Current Energy Shield
  602. Gui, 4:Add, Edit, Disabled vCurrEShieldvar x140 y%ypos% w150, Not In Game or Broken
  603. ypos += 25
  604. Gui, 4:Add, Text, x15 y%ypos% w155, Player Action ID
  605. Gui, 4:Add, Edit, Disabled vPlayerActionIDvar x140 y%ypos% w150, Not In Game or Broken
  606. ypos += 35
  607.  
  608. Gui, 4:Add, GroupBox, x5 y%ypos% w300 h340 , Checks
  609. ypos += 25
  610. Gui, 4:Add, Text, x15 y%ypos% w155, Chat Status
  611. Gui, 4:Add, Edit, Disabled vChatStatusvar x140 y%ypos% w150, Not In Game or Broken
  612. ypos += 25
  613. Gui, 4:Add, Text, x15 y%ypos% w155, Mouse On Enemy
  614. Gui, 4:Add, Edit, Disabled vMouseOnEnemyStatusvar x140 y%ypos% w150, Not In Game or Broken
  615. ypos += 25
  616. Gui, 4:Add, Text, x15 y%ypos% w155, Panel Waypoint
  617. Gui, 4:Add, Edit, Disabled vPanelWaypointvar x140 y%ypos% w150, Not In Game or Broken
  618. ypos += 25
  619. Gui, 4:Add, Text, x15 y%ypos% w155, Panel Inventory
  620. Gui, 4:Add, Edit, Disabled vPanelInventoryvar x140 y%ypos% w150, Not In Game or Broken
  621. ypos += 25
  622. Gui, 4:Add, Text, x15 y%ypos% w155, Panel Skill Tree
  623. Gui, 4:Add, Edit, Disabled vPanelSkillTreevar x140 y%ypos% w150, Not In Game or Broken
  624. ypos += 25
  625. Gui, 4:Add, Text, x15 y%ypos% w155, Panel Social
  626. Gui, 4:Add, Edit, Disabled vPanelSocialvar x140 y%ypos% w150, Not In Game or Broken
  627. ypos += 25
  628. Gui, 4:Add, Text, x15 y%ypos% w155, Panel Instance Manager
  629. Gui, 4:Add, Edit, Disabled vPanelInstanceManagervar x140 y%ypos% w150, Not In Game or Broken
  630. ypos += 25
  631. Gui, 4:Add, Text, x15 y%ypos% w155, In City
  632. Gui, 4:Add, Edit, Disabled vInCityvar x140 y%ypos% w150, Not In Game or Broken
  633. ypos += 25
  634. Gui, 4:Add, Text, x15 y%ypos% w155, Enemy Name
  635. Gui, 4:Add, Edit, Disabled vEnemyNamevar x140 y%ypos% w150, Not In Game or Broken
  636. ypos += 25
  637. Gui, 4:Add, Text, x15 y%ypos% w155, Enemy Name 2
  638. Gui, 4:Add, Edit, Disabled vEnemyName2var x140 y%ypos% w150, Not In Game or Broken
  639. ypos += 25
  640. Gui, 4:Add, Text, x15 y%ypos% w155, Map Name
  641. Gui, 4:Add, Edit, Disabled vMapNamevar x140 y%ypos% w150, Not In Game or Broken
  642.  
  643. Gui, 4:Add, GroupBox, x305 y0 w300 h650 , Flasks Data
  644. ypos := 25
  645. Loop, 5
  646. {
  647. Gui, 4:Add, Text, x315 y%ypos% w155, Flask %A_Index% Type
  648. Gui, 4:Add, Edit, Disabled vFlask%A_Index%Typevar x440 y%ypos% w150, Not In Game or Broken
  649. ypos += 25
  650. Gui, 4:Add, Text, x315 y%ypos% w155, Flask %A_Index% Charges Current
  651. Gui, 4:Add, Edit, Disabled vFlask%A_Index%ChargesCurrentvar x440 y%ypos% w150, Not In Game or Broken
  652. ypos += 25
  653. Gui, 4:Add, Text, x315 y%ypos% w155, Flask %A_Index% Charges Per Use
  654. Gui, 4:Add, Edit, Disabled vFlask%A_Index%ChargesPerUsevar x440 y%ypos% w150, Not In Game or Broken
  655. ypos += 25
  656. Gui, 4:Add, Text, x315 y%ypos% w155, Flask %A_Index% Mod 1
  657. Gui, 4:Add, Edit, Disabled vFlask%A_Index%Mod1var x440 y%ypos% w150, Not In Game or Broken
  658. ypos += 25
  659. Gui, 4:Add, Text, x315 y%ypos% w155, Flask %A_Index% Mod 2
  660. Gui, 4:Add, Edit, Disabled vFlask%A_Index%Mod2var x440 y%ypos% w150, Not In Game or Broken
  661. ypos += 25
  662. }
  663.  
  664. Gui, 4:Add, GroupBox, x605 y0 w300 h650 , Buff Data
  665. ypos := 25
  666. Gui, 4:Add, Text, x615 y%ypos% w155, Buff Amount
  667. Gui, 4:Add, Edit, Disabled vBuffAmountvar x740 y%ypos% w150, Not In Game or Broken
  668. ypos += 25
  669. Loop, 8
  670. {
  671. Gui, 4:Add, Text, x615 y%ypos% w155, Buff %A_Index% Name
  672. Gui, 4:Add, Edit, Disabled vBuff%A_Index%Namevar x740 y%ypos% w150, Not In Game or Broken
  673. ypos += 25
  674. Gui, 4:Add, Text, x615 y%ypos% w155, Buff %A_Index% Charges
  675. Gui, 4:Add, Edit, Disabled vBuff%A_Index%Chargesvar x740 y%ypos% w150, Not In Game or Broken
  676. ypos += 25
  677. Gui, 4:Add, Text, x615 y%ypos% w155, Buff %A_Index% Timer
  678. Gui, 4:Add, Edit, Disabled vBuff%A_Index%Timervar x740 y%ypos% w150, Not In Game or Broken
  679. ypos += 25
  680. }
  681.  
  682. ;---------------------DEBUG WINDOW----------------------------
  683. ;-------GUI-----------------GUI-----------------GUI-----------------GUI-----------------GUI----------
  684.  
  685. ;-------START VARIABLES-----------------START VARIABLES-----------------START VARIABLES--------------
  686.  
  687. SetBatchLines, -1
  688. DetectHiddenWindows, On
  689.  
  690. If not A_IsAdmin
  691. {
  692. TrayTip, Admin Required, Seems that you are not running this program as Admin`, it might not work properlly., 5
  693. }
  694.  
  695. cliname=Path of Exile
  696.  
  697. cliexesteam=PathOfExileSteam.exe
  698.  
  699. cliexe=PathOfExile.exe
  700. AutoFlaskWatchdogPeriod:=20 ;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.
  701. lagCompensation:=50
  702. ; Font size for the tooltip, leave empty for default(part of DPSCalc)
  703. FontSize := 12
  704. ; Create font for later use(part of DPSCalc)
  705. FixedFont := CreateFont()
  706.  
  707. ResyncTimer:= A_TickCount
  708. RemainingTimer:= A_TickCount
  709. ChatStatusTimer:= A_TickCount+99999999999
  710. TradeTimer:= 0
  711. TradeChannel:= 0
  712. tradechat:= 0
  713. TradeStep:= 3
  714. TradeSpamTimer:= 3
  715. ShIftDownOn:=0
  716. ChatCheckTimer:= 1
  717. 10secsTimer:=A_TickCount-10000
  718. 20secsTimer:=A_TickCount-20000
  719. PanickedTimer:=40
  720. LastHP:=0
  721. LastES:=0
  722. FlaskOnFrozen:=1
  723. FlaskOnShocked:=1
  724. FlaskOnIgnited:=1
  725.  
  726. If (ClientServerMode = 1)
  727. {
  728. ConfigPath = %A_MyDocuments%
  729. ConfigPath .= "\My" . A_Space . "Games\Path" . A_Space . "of" . A_Space . "Exile\production_Config.ini"
  730. Taiwan:=False
  731. Steam:=False
  732. Singapore:=False
  733. GlobalS:=True
  734. }
  735. If (ClientServerMode = 2)
  736. {
  737. ConfigPath = %A_MyDocuments%
  738. ConfigPath .= "\My" . A_Space . "Games\Path" . A_Space . "of" . A_Space . "Exile\production_Config.ini"
  739. Taiwan:=False
  740. Steam:=True
  741. Singapore:=False
  742. GlobalS:=False
  743. }
  744. If (ClientServerMode = 3)
  745. {
  746. ConfigPath = %A_MyDocuments%
  747. ConfigPath .= "\My" . A_Space . "Games\Path" . A_Space . "of" . A_Space . "Exile\garena_sg_production_Config.ini"
  748. Taiwan:=False
  749. Steam:=False
  750. Singapore:=True
  751. GlobalS:=False
  752. }
  753. If (ClientServerMode = 4)
  754. {
  755. ConfigPath = %A_MyDocuments%
  756. ConfigPath .= "\My" . A_Space . "Games\Path" . A_Space . "of" . A_Space . "Exile\garena_tw_production_Config.ini"
  757. Taiwan:=True
  758. Steam:=False
  759. Singapore:=False
  760. GlobalS:=False
  761. }
  762.  
  763. autoQuitPauseBeforeClick:=100
  764. 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)
  765.  
  766. PlayerConfig:={}
  767.  
  768. PlayerConfig["Default"]:={RemCorruptedBloodCharges:RemoveCorruptedBloodCharges,RemAilmentsTimer:RemoveAilmentsTimer,QuickSilverTimer:QuickSilverMovementTimer*100, minLifeRatioToInstant: minLifePercentToSpam/100, IflaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopElementalResist: minLifePercentToElementalResist/100,minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100,maxLifeRatioPerHitToQuit: maxLifePercentPerHitToQuit/100,maxEShieldRatioPerHitToQuit: maxESPercentPerHitToQuit/100,minEShieldRatioToQuit: minESPercentToQuit/100, minEShieldRatioToPopElementalResist: minESPercentToElementalResist/100, minEShieldRatioToPopJade: minESPercentToJade/100}
  769.  
  770. PlayerConfig["Default"].FlaskConfig:=[]
  771.  
  772. WindowQueuedFlaskEffects:=[] ;keyed by "%hwnd%%CurrPid%", hpQueueEndtime, manaQueueEndtime
  773.  
  774. basePtrAoBArray:=[0xCE, 0x50, 0xC7, 0x45, 0xF0]
  775. basePtrAobOffset:=+0x10
  776.  
  777. WindowBasicsCache:=[] ; keyed by "%hwnd%%CurrPid%", entries are objects with properties processHandle, moduleBase, moduleSize, baseFramePtr
  778.  
  779. #Include AutoHotkeyMemoryLib.ahk
  780.  
  781. OnExit, ExitSub
  782.  
  783. Loop
  784. {
  785. Main()
  786. }
  787.  
  788. ;-------START VARIABLES-----------------START VARIABLES-----------------START VARIABLES--------------
  789.  
  790. ;-------MAIN FUNCTIONS-----------------MAIN FUNCTIONS-----------------MAIN FUNCTIONS-----------------
  791.  
  792. GetWindowBasics(hwnd, byref mB="", byref pH="", byref mS="")
  793. {
  794.  
  795. global WindowBasicsCache
  796. global cliexe
  797.  
  798. WinGet, CurrPid, PID, ahk_id %hwnd%
  799.  
  800. k="%hwnd%%CurrPid%"
  801.  
  802. mB:=WindowBasicsCache[k].mBase
  803. mS:=WindowBasicsCache[k].mSize
  804.  
  805. If mB=
  806. {
  807. WindowBasicsCache[k]:=Object()
  808. GetModuleInfo(cliexe, CurrPid, mB, mS)
  809. If (mB="" || mS="")
  810. {
  811. MsgBox, Failed to obtain moduleBase or moduleSize for PID %CurrPid%, script will now terminate
  812. ExitApp
  813. }
  814. WindowBasicsCache[k].mBase:=mB
  815. WindowBasicsCache[k].mSize:=mS
  816. }
  817.  
  818. pH:=WindowBasicsCache[k].ProcessHandle
  819. If pH=
  820. {
  821. pH:=GetProcessHandle(CurrPid)
  822. If (pH="" || pH=-1)
  823. {
  824. MsgBox, Invalid process handle obtained for PID %CurrPid%, script will now terminate
  825. ExitApp
  826. }
  827. WindowBasicsCache[k].ProcessHandle:=pH
  828. }
  829. }
  830.  
  831. ScanBaseMgrPtr(mBase,pH,moduleSize)
  832. {
  833. global basePtrAoBArray
  834. global basePtrAobOffset
  835. global baseMgrPtr
  836. aobResult:=AobScan(pH,mBase,moduleSize,basePtrAoBArray)
  837.  
  838. If aobResult
  839. {
  840. SetFormat, IntegerFast, hex
  841. baseMgrPtr:=ReadMemUInt(pH,mBase+aobResult+basePtrAobOffset)-mBase
  842. If (trayNotIfications)
  843. TrayTip, New Base Pointer Found, baseMgrPtr = %baseMgrPtr%
  844. IniWrite, %baseMgrPtr% , Config.ini, Config, baseMgrPtr
  845. GuiControl, , basePtrText, %baseMgrPtr%
  846. SetFormat, IntegerFast, dec
  847.  
  848. }
  849. Else
  850. {
  851. MsgBox, baseMgrPtr not found with AoBScan, script will now terminate
  852. ExitApp
  853. }
  854. }
  855.  
  856. GetFrameBase(hwnd)
  857. {
  858. global baseMgrPtr
  859. global WindowBasicsCache
  860. global cliname
  861. global 10secsTimer
  862.  
  863. WinGet, CurrPid, PID, ahk_id %hwnd%
  864. k="%hwnd%%CurrPid%"
  865.  
  866. fB:=WindowBasicsCache[k].fBase
  867.  
  868. If fB=
  869. {
  870. If (A_TickCount>=10secsTimer+10000)
  871. {
  872. IniRead, MD5Hash , Config.ini, Config, MD5Hash, 0
  873. WinGet FullEXEPath, ProcessPath, %cliname%
  874. NewMD5Hash:=FileMD5(FullEXEPath)
  875.  
  876. If (NewMD5Hash!=MD5Hash)
  877. {
  878. IniWrite, 0 , Config.ini, Config, baseMgrPtr
  879. baseMgrPtr:= 0
  880. IniWrite, %NewMD5Hash% , Config.ini, Config, MD5Hash
  881. }
  882. 10secsTimer:=A_TickCount
  883. }
  884.  
  885. GetWindowBasics(hwnd, mBase, pH, mSize)
  886.  
  887.  
  888. If baseMgrPtr= 0
  889. {
  890. ScanBaseMgrPtr(mBase, pH, mSize)
  891. }
  892.  
  893. fB:=GetMultilevelPointer(pH,[mBase+baseMgrPtr,4,0xFC,0x1c])
  894. WindowBasicsCache[k].fBase:=fB
  895. }
  896. return fB
  897. }
  898.  
  899. GetUiBase(hwnd)
  900. {
  901. global baseMgrPtr
  902. global cliname
  903. global 10secsTimer
  904. global Steam
  905. global Offset3
  906. global Offset4
  907.  
  908.  
  909.  
  910. If (A_TickCount>=10secsTimer+10000)
  911. {
  912. IniRead, MD5Hash , Config.ini, Config, MD5Hash, 0
  913. WinGet FullEXEPath, ProcessPath, %cliname%
  914. NewMD5Hash:=FileMD5(FullEXEPath)
  915.  
  916. If (NewMD5Hash!=MD5Hash)
  917. {
  918. IniWrite, 0 , Config.ini, Config, baseMgrPtr
  919. baseMgrPtr:= 0
  920. IniWrite, %NewMD5Hash% , Config.ini, Config, MD5Hash
  921. }
  922. 10secsTimer:=A_TickCount
  923. }
  924.  
  925.  
  926. GetWindowBasics(hwnd, mBase, pH, mSize)
  927.  
  928. If baseMgrPtr= 0
  929. {
  930. ScanBaseMgrPtr(mBase, pH, mSize)
  931. }
  932.  
  933. FrameBase:=GetFrameBase(hwnd)
  934. If (FrameBase="" || FrameBase=0)
  935. return
  936. uiBase:=GetMultilevelPointer(pH,[FrameBase+Offset3,Offset4,0x8f4])
  937. return uiBase
  938. }
  939.  
  940. ReadClientResolution(hwnd, ByRef w, ByRef h)
  941. {
  942. global Steam
  943. global Offset6
  944. global Offset7
  945.  
  946. GetWindowBasics(hwnd,mBase,pH)
  947. If (mBase!=0 && pH && pH!=-1)
  948. {
  949. FrameBase:=GetFrameBase(hwnd)
  950. w:=ReadMemUInt(pH,FrameBase+Offset6)
  951. h:=ReadMemUInt(pH,FrameBase+Offset7)
  952. return true
  953. }
  954. }
  955.  
  956.  
  957.  
  958. ReadPlayerStats(hwnd, byRef PlayerStats)
  959. {
  960. global baseMgrPtr
  961. global Steam
  962. global Taiwan
  963. global Singapore
  964. global GlobalS
  965.  
  966.  
  967. If (Steam)
  968. {
  969. global Offset1:=0x154
  970. global Offset2:=0x4c4
  971. global Offset3:=0x158
  972. global Offset4:=0x220
  973. global Offset5:=0x2E80
  974. global Offset6:=0x15a8
  975. global Offset7:=0x15ac
  976. global Offset8:=0xa24
  977. global Offset9:=0x9cc
  978. global Offset10:=0x12C
  979. global Offset11:=0x198
  980. }
  981. Else If (Taiwan)
  982. {
  983. global Offset1:=0x138
  984. global Offset2:=0x5A0
  985. global Offset3:=0x13c
  986. global Offset4:=0x220
  987. global Offset5:=0x2E80
  988. global Offset6:=0x15B8
  989. global Offset7:=0x15BC
  990. global Offset8:=0x100
  991. global Offset9:=0xE4
  992. global Offset10:=0x12C
  993. global Offset11:=0x198
  994. }
  995. Else If (GlobalS)
  996. {
  997. global Offset1:=0x138
  998. global Offset2:=0x144
  999. global Offset3:=0x13c
  1000. global Offset4:=0x220
  1001. global Offset5:=0x3934
  1002. global Offset6:=0x158c
  1003. global Offset7:=0x1590
  1004. global Offset8:=0xa00
  1005. global Offset9:=0x9a8
  1006. global Offset10:=0xa34
  1007. global Offset11:=0xa9c
  1008. }
  1009. Else If (Singapore)
  1010. {
  1011. global Offset1:=0x138
  1012. global Offset2:=0x5A0
  1013. global Offset3:=0x13c
  1014. global Offset4:=0x220
  1015. global Offset5:=0x2E80
  1016. global Offset6:=0x15B8
  1017. global Offset7:=0x15BC
  1018. global Offset8:=0x100
  1019. global Offset9:=0xE4
  1020. global Offset10:=0x12C
  1021. global Offset11:=0x198
  1022. }
  1023.  
  1024. GetWindowBasics(hwnd, mBase, pH)
  1025. fBase:=GetFrameBase(hwnd)
  1026. BaseMgr:=ReadMemUInt(pH,mBase+baseMgrPtr)
  1027. PlayerBase:=GetMultilevelPointer(pH,[fBase+Offset1,Offset2])
  1028. ;Config:=GetMultilevelPointer(pH,[BaseMgr+0x180,0x108,0x8c])
  1029. ;PlayerStats.ConfigPath:=ReadMemStr(ph,Config+0xa4,255,"UTF-16")
  1030. PlayerMain:=ReadMemUInt(pH,PlayerBase+4)
  1031. PlayerStatsOffset:=ReadMemUInt(pH,PlayerMain+0xC)
  1032. PlayerStats.MaxHP:=ReadMemUInt(pH,PlayerStatsOffset+0x2c)
  1033. PlayerStats.CurrHP:=ReadMemUInt(pH,PlayerStatsOffset+0x30)
  1034. PlayerStats.ReservedHPFlat:=ReadMemUInt(pH,PlayerStatsOffset+0x38)
  1035. PlayerStats.ReservedHPPercent:=ReadMemUInt(pH,PlayerStatsOffset+0x3c)
  1036. PlayerStats.MaxMana:=ReadMemUInt(pH,PlayerStatsOffset+0x50)
  1037. PlayerStats.ReservedManaFlat:=ReadMemUInt(pH,PlayerStatsOffset+0x5c)
  1038. PlayerStats.ReservedManaPercent:=ReadMemUInt(pH,PlayerStatsOffset+0x60)
  1039. PlayerStats.CurrMana:=ReadMemUInt(pH,PlayerStatsOffset+0x54)
  1040. PlayerStats.MaxEShield:=ReadMemUInt(pH,PlayerStatsOffset+0x74)
  1041. PlayerStats.CurrEShield:=ReadMemUInt(pH,PlayerStatsOffset+0x78)
  1042. PlayerActionIDOffset:=ReadMemUInt(pH,PlayerMain+0x1C)
  1043. PlayerStats.PlayerActionID:=ReadMemUInt(pH,PlayerActionIDOffset+0x70)
  1044. /*
  1045. SetFormat, IntegerFast, hex
  1046. PlayerActionID += 0
  1047. PlayerActionID .= ""
  1048. StringRight, PlayerActionID2, PlayerActionID, 2
  1049. SetFormat, IntegerFast, d
  1050. PlayerStats.PlayerActionID:=PlayerActionID2
  1051. */
  1052.  
  1053. BuffListStart:=ReadMemUInt(pH,PlayerStatsOffset+0x94)
  1054. BuffListEnd:=ReadMemUInt(pH,PlayerStatsOffset+0x98)
  1055. BuffAmount:=((BuffListEnd-BuffListStart)/4)
  1056. PlayerStats.BuffAmount:=((BuffListEnd-BuffListStart)/4)
  1057. Loop, %BuffAmount%
  1058. {
  1059. BuffBasePtr:=GetMultilevelPointer(ph,[BuffListStart+((A_Index-1)*4),4])
  1060. BuffNamePtr:=GetMultilevelPointer(ph,[BuffBasePtr+4,0])
  1061. BuffNameStr:=ReadMemStr(ph,BuffNamePtr,70,"UTF-16")
  1062. PlayerStats.BuffName[A_Index]:=BuffNameStr
  1063. BuffCharges:=ReadMemUInt(pH,BuffBasePtr+0x20)
  1064. PlayerStats.BuffCharges[A_Index]:=BuffCharges
  1065. BuffTimer:=ReadMemFloat(pH,BuffBasePtr+0xC)
  1066. PlayerStats.BuffTimer[A_Index]:=BuffTimer
  1067. }
  1068.  
  1069.  
  1070. CheckBase:=GetMultilevelPointer(pH,[fBase+Offset3,Offset4])
  1071.  
  1072. ChatStatusOffset:=GetMultilevelPointer(pH,[CheckBase+Offset9,0x708,0x0])
  1073. PlayerStats.ChatStatus:=ReadMemUInt(pH,ChatStatusOffset+0x754)
  1074.  
  1075. PanelInventoryOffset:=ReadMemUInt(pH,CheckBase+Offset8)
  1076. PlayerStats.PanelInventory:=ReadMemUInt(pH,PanelInventoryOffset+0x754)
  1077. PanelSocialOffset:=ReadMemUInt(pH,CheckBase+Offset8+0x14)
  1078. PlayerStats.PanelSocial:=ReadMemUInt(pH,PanelSocialOffset+0x754)
  1079. PanelSkillTreeOffset:=ReadMemUInt(pH,CheckBase+Offset8+0x18)
  1080. PlayerStats.PanelSkillTree:=ReadMemUInt(pH,PanelSkillTreeOffset+0x754)
  1081. PanelWaypointOffset:=ReadMemUInt(pH,CheckBase+Offset8+0x30)
  1082. PlayerStats.PanelWaypoint:=ReadMemUInt(pH,PanelWaypointOffset+0x754)
  1083. PanelInstanceManagerOffset:=ReadMemUInt(pH,CheckBase+Offset8+0xB8) ;added by immor
  1084. PlayerStats.PanelInstanceManager:=ReadMemUInt(pH,PanelInstanceManagerOffset+0x754) ;added by immor
  1085. InCityOffset:=GetMultilevelPointer(pH,[CheckBase+Offset10,0x704,0x958])
  1086. PlayerStats.InCity:=ReadMemUInt(pH,InCityOffset+0x754)
  1087. MouseOnEnemyOffset:=GetMultilevelPointer(pH,[CheckBase+Offset11,0x8c4,0x7f4])
  1088. PlayerStats.MouseOnEnemyStatus:=ReadMemUInt(pH,MouseOnEnemyOffset+0x38)
  1089. EnemyNamePtr:=GetMultilevelPointer(ph,[CheckBase+Offset11,0x8c4,0xb30])
  1090. EnemyName:=ReadMemStr(ph,EnemyNamePtr,70,"UTF-16")
  1091. PlayerStats.EnemyName:=EnemyName
  1092. EnemyNamePtr2:=GetMultilevelPointer(ph,[CheckBase+Offset11,0x8c4,0xac8])
  1093. EnemyName2:=ReadMemStr(ph,EnemyNamePtr2+0x32,70,"UTF-16")
  1094. PlayerStats.EnemyName2:=EnemyName2
  1095.  
  1096. MapNameOffset:=GetMultilevelPointer(pH,[fBase+Offset1,0x8,0x4])
  1097. MapName:=ReadMemStr(ph,MapNameOffset,100,"UTF-16")
  1098. PlayerStats.MapName:=MapName
  1099. }
  1100.  
  1101. ReadFlasksData(hwnd, byRef FlasksData)
  1102. {
  1103. GetWindowBasics(hwnd, mBase, pH)
  1104.  
  1105. UiBase:=GetUiBase(hwnd)
  1106.  
  1107. If (!UiBase) ;not InGame
  1108. return
  1109.  
  1110. FlaskInvBase:=GetMultilevelPointer(pH,[UiBase+0x8b4,0x950,0x20])
  1111.  
  1112. Loop, 5
  1113. {
  1114. currFlaskPtr:=ReadMemUInt(pH,FlaskInvBase+(A_Index-1)*4)
  1115.  
  1116. If (currFlaskPtr!=0) ; there's a flask in said slot
  1117. {
  1118. FlasksData[A_Index]:={}
  1119.  
  1120. If A_Index = 1
  1121. {
  1122. IniRead, Slot1Disabled, Config.ini, DisableSlot, DisableSlot1, 0
  1123. If Slot1Disabled = 1
  1124. continue
  1125. }
  1126. Else If A_Index = 2
  1127. {
  1128. IniRead, Slot2Disabled, Config.ini, DisableSlot, DisableSlot2, 0
  1129. If Slot2Disabled = 1
  1130. continue
  1131. }
  1132. Else If A_Index = 3
  1133. {
  1134. IniRead, Slot3Disabled, Config.ini, DisableSlot, DisableSlot3, 0
  1135. If Slot3Disabled = 1
  1136. continue
  1137. }
  1138. Else If A_Index = 4
  1139. {
  1140. IniRead, Slot4Disabled, Config.ini, DisableSlot, DisableSlot4, 0
  1141. If Slot4Disabled = 1
  1142. continue
  1143. }
  1144. Else If A_Index = 5
  1145. {
  1146. IniRead, Slot5Disabled, Config.ini, DisableSlot, DisableSlot5, 0
  1147. If Slot5Disabled = 1
  1148. continue
  1149. }
  1150.  
  1151.  
  1152. FlaskChargesPtr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0xC])
  1153. FlasksData[A_Index].ChargesCurrent:=ReadMemUInt(pH,FlaskChargesPtr+0xC)
  1154. FlasksData[A_Index].ChargesPerUse:=ReadMemUInt(pH,ReadMemUInt(pH,FlaskChargesPtr+8)+0xC)
  1155.  
  1156. FlaskMod1Ptr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0x10,0x68,0x10,0x38])
  1157. FlaskMod1Str:=ReadMemStr(ph,FlaskMod1Ptr,70,"UTF-16")
  1158. FlasksData[A_Index].mod1:=FlaskMod1Str
  1159.  
  1160. FlaskMod2Ptr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x1C,4,4,0x10,0x68,0x24,0x38])
  1161. FlaskMod2Str:=ReadMemStr(ph,FlaskMod2Ptr,70,"UTF-16")
  1162. FlasksData[A_Index].mod2:=FlaskMod2Str
  1163.  
  1164. If (FlasksData[A_Index].ChargesCurrent < FlasksData[A_Index].ChargesPerUse) ; not enough charges in this flask to use it, don't bother
  1165. continue
  1166.  
  1167. FlaskMetadataPtr:=GetMultilevelPointer(ph,[currFlaskPtr,0,0x14])
  1168. FlaskMetadataStr:=ReadMemStr(ph,FlaskMetadataPtr,70,"UTF-16")
  1169. FlaskTypeStr:=SubStr(FlaskMetadataStr,23)
  1170. FlasksData[A_Index].type:=FlaskTypeStr
  1171.  
  1172. FlaskLocalstatsPtr:=GetMultilevelPointer(ph,[currFlaskPtr,4,0x18,0x14,0xC])
  1173.  
  1174. If InStr(FlaskTypeStr, "FlaskLife")
  1175. {
  1176. FlasksData[A_Index].HPRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
  1177. If ( InStr(FlasksData[A_Index].mod1,"Bubbling") || InStr(FlasksData[A_Index].mod2,"Bubbling") )
  1178. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1179. Else If ( InStr(FlasksData[A_Index].mod1,"起泡的*") || InStr(FlasksData[A_Index].mod2,"起泡的*") )
  1180. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1181. Else If ( InStr(FlasksData[A_Index].mod1,"Catalysed") || InStr(FlasksData[A_Index].mod2,"Catalysed") )
  1182. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1183. Else If ( InStr(FlasksData[A_Index].mod1,"催化的*") || InStr(FlasksData[A_Index].mod2,"催化的*") )
  1184. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1185. Else If ( InStr(FlasksData[A_Index].mod1,"Saturated") || InStr(FlasksData[A_Index].mod2,"Saturated") )
  1186. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1187. Else If ( InStr(FlasksData[A_Index].mod1,"飽和的*") || InStr(FlasksData[A_Index].mod2,"飽和的*") )
  1188. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1189. Else
  1190. FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)
  1191. }
  1192.  
  1193. If InStr(FlaskTypeStr, "FlaskMana")
  1194. {
  1195. FlasksData[A_Index].ManaRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
  1196. If ( InStr(FlasksData[A_Index].mod1,"Bubbling") || InStr(FlasksData[A_Index].mod2,"Bubbling") )
  1197. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1198. Else If ( InStr(FlasksData[A_Index].mod1,"起泡的*") || InStr(FlasksData[A_Index].mod2,"起泡的*") )
  1199. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1200. Else If ( InStr(FlasksData[A_Index].mod1,"Catalysed") || InStr(FlasksData[A_Index].mod2,"Catalysed") )
  1201. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1202. Else If ( InStr(FlasksData[A_Index].mod1,"催化的*") || InStr(FlasksData[A_Index].mod2,"催化的*") )
  1203. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1204. Else If ( InStr(FlasksData[A_Index].mod1,"Saturated") || InStr(FlasksData[A_Index].mod2,"Saturated") )
  1205. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1206. Else If ( InStr(FlasksData[A_Index].mod1,"飽和的*") || InStr(FlasksData[A_Index].mod2,"飽和的*") )
  1207. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1208. Else
  1209. FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)
  1210. }
  1211.  
  1212. If InStr(FlaskTypeStr, "FlaskHybrid")
  1213. {
  1214. FlasksData[A_Index].HPRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+4)
  1215. FlasksData[A_Index].ManaRegAmount:=ReadMemUInt(pH,FlaskLocalstatsPtr+0xC)
  1216. If ( InStr(FlasksData[A_Index].mod1,"Bubbling") || InStr(FlasksData[A_Index].mod2,"Bubbling") )
  1217. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1218. Else If ( InStr(FlasksData[A_Index].mod1,"起泡的*") || InStr(FlasksData[A_Index].mod2,"起泡的*") )
  1219. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/2.35)
  1220. Else If ( InStr(FlasksData[A_Index].mod1,"Catalysed") || InStr(FlasksData[A_Index].mod2,"Catalysed") )
  1221. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1222. Else If ( InStr(FlasksData[A_Index].mod1,"催化的*") || InStr(FlasksData[A_Index].mod2,"催化的*") )
  1223. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1224. Else If ( InStr(FlasksData[A_Index].mod1,"Saturated") || InStr(FlasksData[A_Index].mod2,"Saturated") )
  1225. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1226. Else If ( InStr(FlasksData[A_Index].mod1,"飽和的*") || InStr(FlasksData[A_Index].mod2,"飽和的*") )
  1227. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/0.67)
  1228. Else
  1229. FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)
  1230. }
  1231.  
  1232. If InStr(FlaskTypeStr, "FlaskUtility")
  1233. {
  1234. If ( InStr(FlasksData[A_Index].mod1,"Alchemist") || InStr(FlasksData[A_Index].mod2,"Alchemist") )
  1235. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1236. Else If ( InStr(FlasksData[A_Index].mod1,"鍊金的*") || InStr(FlasksData[A_Index].mod1,"鍊金的*") )
  1237. FlasksData[A_Index].EffectDuration:=(ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)/1.5)
  1238. Else
  1239. FlasksData[A_Index].EffectDuration:=ReadMemUInt(pH,FlaskLocalstatsPtr+0x14)
  1240. }
  1241. }
  1242. }
  1243. }
  1244.  
  1245. IsInGame(hwnd)
  1246. {
  1247. global Steam
  1248. global Offset3
  1249.  
  1250. If (hwnd=0 || hwnd="")
  1251. return false
  1252. GetWindowBasics(hwnd,mBase,pH)
  1253. If (mBase="" || mBase=0 || pH="" || pH=-1)
  1254. return false
  1255. fBase:=GetFrameBase(hwnd)
  1256. If (fBase="" || fBase=0)
  1257. return false
  1258. localConnection:=ReadMemUInt(pH,fBase+Offset3)
  1259. If (localConnection=0 || localConnection="")
  1260. return false
  1261. Else
  1262. return true
  1263. }
  1264.  
  1265. SetGameStateMenu(hwnd)
  1266. {
  1267. global Steam
  1268. global Offset3
  1269. global Offset5
  1270.  
  1271. If (hwnd=0 || hwnd="")
  1272. return false
  1273. GetWindowBasics(hwnd,mBase,pH)
  1274. If (mBase="" || mBase=0 || pH="" || pH=-1)
  1275. return false
  1276. fBase:=GetFrameBase(hwnd)
  1277. If (fBase="" || fBase=0)
  1278. return false
  1279. localConnection:=ReadMemUInt(pH,fBase+Offset3)
  1280. If (localConnection!="" && localConnection!=0)
  1281. {
  1282. WriteMemUInt(pH,localConnection+Offset5,1)
  1283. }
  1284. }
  1285.  
  1286. ReadHeroPos(hwnd,ByRef x, ByRef y)
  1287. {
  1288. global Steam
  1289. global Offset1
  1290. global Offset2
  1291.  
  1292. GetWindowBasics(hwnd,mBase,pH)
  1293. If (mBase!=0 && pH && pH!=-1)
  1294. {
  1295. FrameBase:=GetFrameBase(hwnd)
  1296.  
  1297. PlayerPosBase:=GetMultilevelPointer(pH,[FrameBase+Offset1,Offset2,0x24])
  1298.  
  1299. x:=ReadMemFloat(pH,PlayerPosBase+0x2c)
  1300. y:=ReadMemFloat(pH,PlayerPosBase+0x30)
  1301.  
  1302. return true
  1303. }
  1304. }
  1305.  
  1306. ScreenToClient(hwnd, ByRef x, ByRef y)
  1307. {
  1308. VarSetCapacity(pt, 8)
  1309. NumPut(x, pt, 0)
  1310. NumPut(y, pt, 4)
  1311. DllCall("ScreenToClient", "uint", hwnd, "uint", &pt)
  1312. x := NumGet(pt, 0, "int")
  1313. y := NumGet(pt, 4, "int")
  1314. VarSetCapacity(pt, 0)
  1315. }
  1316.  
  1317. GetClientCoords(byRef mx, byRef my)
  1318. {
  1319. hwnd:=WinActive("A")
  1320. CoordMode, Mouse, Screen
  1321. MouseGetPos, mx, my
  1322. ScreenToClient(hwnd,mx,my) ; x 580 y 435
  1323. }
  1324.  
  1325. QuitToLoginScreen(hwnd)
  1326. {
  1327. If (!IsInGame(hwnd))
  1328. {
  1329. return
  1330. }
  1331. SetGameStateMenu(hwnd)
  1332. }
  1333.  
  1334. GetMaxChargesFlaskOfType(ByRef FlasksData,TypeStr)
  1335. {
  1336. currMaxCharges:=0
  1337. Loop, 5
  1338. If (InStr(FlasksData[A_Index].type,TypeStr))
  1339. {
  1340. If ((FlasksData[A_Index].ChargesCurrent>currMaxCharges) && (FlasksData[A_Index].ChargesCurrent>=FlasksData[A_Index].ChargesPerUse))
  1341. {
  1342. currMaxI:=A_Index
  1343. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1344. }
  1345. }
  1346. return currMaxI
  1347. }
  1348.  
  1349. GetMaxChargesFlaskOfMod(ByRef FlasksData,ModStr)
  1350. {
  1351. currMaxCharges:=0
  1352. Loop, 5
  1353. If ((InStr(FlasksData[A_Index].mod1,ModStr)) || (InStr(FlasksData[A_Index].mod2,ModStr)))
  1354. {
  1355. If ((FlasksData[A_Index].ChargesCurrent>currMaxCharges) && (FlasksData[A_Index].ChargesCurrent>=FlasksData[A_Index].ChargesPerUse))
  1356. {
  1357. currMaxI:=A_Index
  1358. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1359. }
  1360. }
  1361. return currMaxI
  1362. }
  1363.  
  1364. GetMaxChargesFlaskQuickSilver(ByRef FlasksData,TypeStr)
  1365. {
  1366. currMaxCharges:=0
  1367. Loop, 5
  1368. If (InStr(FlasksData[A_Index].type,TypeStr))
  1369. {
  1370. If FlasksData[A_Index].ChargesCurrent>=40
  1371. {
  1372. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1373. {
  1374. currMaxI:=A_Index
  1375. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1376. }
  1377. }
  1378. }
  1379. return currMaxI
  1380. }
  1381.  
  1382. GetMaxChargesFlaskQuickSilver2(ByRef FlasksData,TypeStr)
  1383. {
  1384. currMaxCharges:=0
  1385. Loop, 5
  1386. If (InStr(FlasksData[A_Index].type,TypeStr))
  1387. {
  1388. If FlasksData[A_Index].ChargesCurrent>=20
  1389. {
  1390. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1391. {
  1392. currMaxI:=A_Index
  1393. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1394. }
  1395. }
  1396. }
  1397. return currMaxI
  1398. }
  1399.  
  1400. GetMaxChargesOfInstantFlask(ByRef FlasksData,TypeStr)
  1401. {
  1402. global PanickedTimer
  1403. currMaxCharges:=0
  1404. Loop, 5
  1405. If (InStr(FlasksData[A_Index].type,TypeStr))
  1406. {
  1407. If (InStr(FlasksData[A_Index].mod1,"Seething"))
  1408. {
  1409. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1410. {
  1411. currMaxI:=A_Index
  1412. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1413. }
  1414. }
  1415. Else If (InStr(FlasksData[A_Index].mod2,"Seething"))
  1416. {
  1417. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1418. {
  1419. currMaxI:=A_Index
  1420. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1421. }
  1422. }
  1423. Else If (InStr(FlasksData[A_Index].mod1,"沸騰的"))
  1424. {
  1425. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1426. {
  1427. currMaxI:=A_Index
  1428. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1429. }
  1430. }
  1431. Else If (InStr(FlasksData[A_Index].mod2,"沸騰的"))
  1432. {
  1433. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1434. {
  1435. currMaxI:=A_Index
  1436. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1437. }
  1438. }
  1439. Else If (InStr(FlasksData[A_Index].mod1,"Bubbling"))
  1440. {
  1441. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1442. {
  1443. currMaxI:=A_Index
  1444. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1445. }
  1446. }
  1447. Else If (InStr(FlasksData[A_Index].mod2,"Bubbling"))
  1448. {
  1449. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1450. {
  1451. currMaxI:=A_Index
  1452. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1453. }
  1454. }
  1455. Else If (InStr(FlasksData[A_Index].mod1," 起泡的"))
  1456. {
  1457. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1458. {
  1459. currMaxI:=A_Index
  1460. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1461. }
  1462. }
  1463. Else If (InStr(FlasksData[A_Index].mod2," 起泡的"))
  1464. {
  1465. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1466. {
  1467. currMaxI:=A_Index
  1468. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1469. }
  1470. }
  1471. Else If ((InStr(FlasksData[A_Index].mod1,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  1472. {
  1473. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1474. {
  1475. If (PanickedTimer>35)
  1476. {
  1477. currMaxI:=A_Index
  1478. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1479. PanickedTimer:= 0
  1480. }
  1481. }
  1482. }
  1483. Else If ((InStr(FlasksData[A_Index].mod2,"Panicked")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  1484. {
  1485. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1486. {
  1487. If (PanickedTimer>35)
  1488. {
  1489. currMaxI:=A_Index
  1490. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1491. PanickedTimer:= 0
  1492. }
  1493. }
  1494. }
  1495. Else If ((InStr(FlasksData[A_Index].mod1,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  1496. {
  1497. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1498. {
  1499. If (PanickedTimer>35)
  1500. {
  1501. currMaxI:=A_Index
  1502. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1503. PanickedTimer:= 0
  1504. }
  1505. }
  1506. }
  1507. Else If ((InStr(FlasksData[A_Index].mod2,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  1508. {
  1509. If FlasksData[A_Index].ChargesCurrent>currMaxCharges
  1510. {
  1511. If (PanickedTimer>35)
  1512. {
  1513. currMaxI:=A_Index
  1514. currMaxCharges:=FlasksData[A_Index].ChargesCurrent
  1515. PanickedTimer:= 0
  1516. }
  1517. }
  1518. }
  1519. }
  1520. return currMaxI
  1521. }
  1522.  
  1523. FileMD5( sFile="", cSz=4 )
  1524. { ; by SKAN www.autohotkey.com/community/viewtopic.php?t=64211
  1525. cSz := (cSz<0||cSz>8) ? 2**22 : 2**(18+cSz), VarSetCapacity( Buffer,cSz,0 ) ; 18-Jun-2009
  1526. hFil := DllCall( "CreateFile", Str,sFile,UInt,0x80000000, Int,3,Int,0,Int,3,Int,0,Int,0 )
  1527. IfLess,hFil,1, Return,hFil
  1528. hMod := DllCall( "LoadLibrary", Str,"advapi32.dll" )
  1529. DllCall( "GetFileSizeEx", UInt,hFil, UInt,&Buffer ), fSz := NumGet( Buffer,0,"Int64" )
  1530. VarSetCapacity( MD5_CTX,104,0 ), DllCall( "advapi32\MD5Init", UInt,&MD5_CTX )
  1531. Loop % ( fSz//cSz + !!Mod( fSz,cSz ) )
  1532. DllCall( "ReadFile", UInt,hFil, UInt,&Buffer, UInt,cSz, UIntP,bytesRead, UInt,0 )
  1533. , DllCall( "advapi32\MD5Update", UInt,&MD5_CTX, UInt,&Buffer, UInt,bytesRead )
  1534. DllCall( "advapi32\MD5Final", UInt,&MD5_CTX )
  1535. DllCall( "CloseHandle", UInt,hFil )
  1536. Loop % StrLen( Hex:="123456789ABCDEF0" )
  1537. N := NumGet( MD5_CTX,87+A_Index,"Char"), MD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1)
  1538. Return MD5, DllCall( "FreeLibrary", UInt,hMod )
  1539. }
  1540.  
  1541.  
  1542. Main()
  1543. {
  1544. global AutoFlaskWatchdogPeriod
  1545. global lagCompensation
  1546. global PlayerConfig
  1547. global WindowQueuedFlaskEffects
  1548. global cliname
  1549. global cliexe
  1550. global cliexesteam
  1551. global trayNotIfications
  1552. global autoQuitMode
  1553. global desync
  1554. global remaining
  1555. global hideout
  1556. global tradechat
  1557. global borderless
  1558. global ResyncTimer
  1559. global ResyncSpam
  1560. global RemainingTimer
  1561. global RemainingSpam
  1562. global tradechat
  1563. global TradeSpam
  1564. global TradeSpamTimer
  1565. global TradeTimer
  1566. global TradeChannel
  1567. global TradeStep
  1568. global PanickedTimer
  1569. global QuickSilverCheck
  1570. global QuickSilverCheck2
  1571. global AttackInPlaceCheck
  1572. global AttackInPlaceKeyUp
  1573. global ChatStatusTimer
  1574. global ChatCheckTimer
  1575. global Steam
  1576. global MovementTimer
  1577. global 20secsTimer
  1578. global FLaskHotkey1
  1579. global FLaskHotkey2
  1580. global FLaskHotkey3
  1581. global FLaskHotkey4
  1582. global FLaskHotkey5
  1583. global LastHP
  1584. global LastES
  1585. global LastMaxHP
  1586. global LastMaxES
  1587. global AttackInPlaceKey
  1588. global FlaskOnFrozenCheck
  1589. global FlaskOnShockedCheck
  1590. global FlaskOnIgnitedCheck
  1591. global QuicksilverBuff
  1592. global FlaskOnCurseCheck
  1593. global FlaskOnCorruptedBloodCheck
  1594. global HoldCtrlCheck
  1595. global CtrlkeyDown
  1596. global AttackInPlaceKeyDown
  1597. global Taiwan
  1598. global Singapore
  1599. global ClientServerMode
  1600. global ConfigPath
  1601.  
  1602. WinGet, WinID, List, %cliname%
  1603.  
  1604. Loop, %WinID%
  1605. {
  1606.  
  1607. WinGet, ProcModuleName, ProcessName, % "ahk_id" WinID%A_Index%
  1608.  
  1609. If (ProcModuleName!="PathOfExile.exe") And (ProcModuleName!="PathOfExileSteam.exe") ; 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
  1610. {
  1611. continue
  1612. }
  1613.  
  1614. If (ProcModuleName="PathOfExileSteam.exe")
  1615. {
  1616. Steam:=True
  1617. cliexe:="PathOfExileSteam.exe"
  1618. }
  1619.  
  1620. Else If (ProcModuleName="PathOfExile.exe")
  1621. {
  1622. Steam:=False
  1623. cliexe=PathOfExile.exe
  1624. }
  1625.  
  1626. If (WinID%A_Index%=WinActive("A"))
  1627. ThisID:=WinActive("A")
  1628.  
  1629. ;--------------Get keys Start---------------
  1630.  
  1631. If (A_TickCount>=20secsTimer+20000)
  1632. {
  1633. ;Loop, 5
  1634. ;{
  1635. FileRead, ProductionConfig, %ConfigPath%
  1636. ;FileReadLine, ProductionConfig, %ConfigPath%,
  1637.  
  1638. Loop, read, %ConfigPath%
  1639. {
  1640. Loop, parse, A_LoopReadLine, %A_Tab%
  1641. {
  1642. testfield = %A_LoopField%
  1643. testfield .= ""
  1644.  
  1645. IfInString, testfield, attack_in_place
  1646. {
  1647. StringGetPos, StringPos, testfield, =
  1648. vk := SubStr(testfield, StringPos+2)
  1649. SetFormat, IntegerFast, hex
  1650. vk += 0
  1651. vk .= ""
  1652. SetFormat, IntegerFast, d
  1653. AttackInPlaceKey=vk%vk%
  1654. continue
  1655. }
  1656. IfInString, testfield, use_flask_in_slot1
  1657. {
  1658. StringGetPos, StringPos, testfield, =
  1659. vk := SubStr(testfield, StringPos+2)
  1660. SetFormat, IntegerFast, hex
  1661. vk += 0
  1662. vk .= ""
  1663. SetFormat, IntegerFast, d
  1664. FlaskHotkey1={vk%vk%
  1665. continue
  1666. }
  1667. IfInString, testfield, use_flask_in_slot2
  1668. {
  1669. StringGetPos, StringPos, testfield, =
  1670. vk := SubStr(testfield, StringPos+2)
  1671. SetFormat, IntegerFast, hex
  1672. vk += 0
  1673. vk .= ""
  1674. SetFormat, IntegerFast, d
  1675. FlaskHotkey2={vk%vk%
  1676. continue
  1677. }
  1678. IfInString, testfield, use_flask_in_slot3
  1679. {
  1680. StringGetPos, StringPos, testfield, =
  1681. vk := SubStr(testfield, StringPos+2)
  1682. SetFormat, IntegerFast, hex
  1683. vk += 0
  1684. vk .= ""
  1685. SetFormat, IntegerFast, d
  1686. FlaskHotkey3={vk%vk%
  1687. continue
  1688. }
  1689. IfInString, testfield, use_flask_in_slot4
  1690. {
  1691. StringGetPos, StringPos, testfield, =
  1692. vk := SubStr(testfield, StringPos+2)
  1693. SetFormat, IntegerFast, hex
  1694. vk += 0
  1695. vk .= ""
  1696. SetFormat, IntegerFast, d
  1697. FlaskHotkey4={vk%vk%
  1698. continue
  1699. }
  1700. IfInString, testfield, use_flask_in_slot5
  1701. {
  1702. StringGetPos, StringPos, testfield, =
  1703. vk := SubStr(testfield, StringPos+2)
  1704. SetFormat, IntegerFast, hex
  1705. vk += 0
  1706. vk .= ""
  1707. SetFormat, IntegerFast, d
  1708. FlaskHotkey5={vk%vk%
  1709. continue
  1710. }
  1711. }
  1712. }
  1713. ;FlaskHotkey%A_Index%={vk%vk%
  1714. ;}
  1715.  
  1716. 20secsTimer:=A_TickCount
  1717. }
  1718.  
  1719. ;--------------Get keys End-----------------
  1720.  
  1721. PlayerStats:={}
  1722. ReadPlayerStats(WinID%A_Index%, PlayerStats)
  1723.  
  1724. CurrentConfig:=PlayerConfig["Default"]
  1725.  
  1726. If (PlayerStats.MaxHP<1 || PlayerStats.CurrHP=0) ;dead, don't bother
  1727. {
  1728. continue
  1729. }
  1730.  
  1731. If (!IsInGame(WinID%A_Index%))
  1732. {
  1733. LastHP:=0
  1734. LastES:=0
  1735. LastMaxHP:=0
  1736. LastMaxES:=0
  1737. continue
  1738. }
  1739.  
  1740. If PlayerStats.MaxEShield>0
  1741. {
  1742. currEShieldRatio:=PlayerStats.CurrEShield/PlayerStats.MaxEShield
  1743. LastEShieldRatio:=LastES/PlayerStats.MaxEShield
  1744. If (LastMaxES!=PlayerStats.MaxEShield)
  1745. {
  1746. LastEShieldRatio:=0
  1747. }
  1748. }
  1749. Else
  1750. {
  1751. currEShieldRatio:= 1
  1752. }
  1753.  
  1754. If (PlayerStats.MaxHP>1)
  1755. {
  1756. currLifeRatio:=PlayerStats.CurrHP/(PlayerStats.MaxHP-PlayerStats.ReservedHPFlat-PlayerStats.MaxHP*PlayerStats.ReservedHPPercent/100)
  1757. LastLifeRatio:=LastHP/(PlayerStats.MaxHP-PlayerStats.ReservedHPFlat-PlayerStats.MaxHP*PlayerStats.ReservedHPPercent/100)
  1758. If (LastMaxHP!=PlayerStats.MaxHP)
  1759. {
  1760. LastLifeRatio:=0
  1761. }
  1762. }
  1763. Else
  1764. {
  1765. currLifeRatio:=1
  1766. LastLifeRatio:=0
  1767. }
  1768.  
  1769. If (PlayerStats.MaxMana>0)
  1770. {
  1771. currManaRatio:=PlayerStats.CurrMana/(PlayerStats.MaxMana-PlayerStats.ReservedManaFlat-PlayerStats.MaxMana*PlayerStats.ReservedManaPercent/100)
  1772. }
  1773.  
  1774. If (currLifeRatio<CurrentConfig.minLifeRatioToQuit || currEShieldRatio<CurrentConfig.minEShieldRatioToQuit || (currLifeRatio<LastLifeRatio And ((LastLifeRatio-currLifeRatio)>CurrentConfig.maxLifeRatioPerHitToQuit) And (CurrentConfig.maxLifeRatioPerHitToQuit<1 And CurrentConfig.maxLifeRatioPerHitToQuit>0)) || (CurrentConfig.maxEShieldRatioPerHitToQuit>0 And currEShieldRatio<LastEShieldRatio And ((LastEShieldRatio-currEShieldRatio)>CurrentConfig.maxEShieldRatioPerHitToQuit)))
  1775. {
  1776. If (autoQuitMode=0)
  1777. {
  1778. QuitToLoginScreen(WinID%A_Index%)
  1779. continue
  1780. }
  1781. Else If (autoQuitMode=1)
  1782. {
  1783. run, cports.exe /close * * * * PathofExile.exe
  1784. continue
  1785. }
  1786. Else If (autoQuitMode=3)
  1787. {
  1788. WinActivate Path of Exile ahk_class POEWindowClass
  1789. IfWinActive Path of Exile ahk_class POEWindowClass
  1790. {
  1791. SendInput {ALT Down}
  1792. SendInput {F4}
  1793. SendInput {ALT Up}
  1794. }
  1795. continue
  1796. }
  1797. Else If (autoQuitMode=4)
  1798. {
  1799.  
  1800. }
  1801. }
  1802.  
  1803. If (PlayerStats.CurrHP>0)
  1804. {
  1805. LastHP:=PlayerStats.CurrHP
  1806. LastES:=PlayerStats.CurrEShield
  1807. LastMaxHP:=PlayerStats.MaxHP
  1808. LastMaxES:=PlayerStats.MaxEShield
  1809. }
  1810. Else
  1811. {
  1812. LastHP:=0
  1813. LastES:=0
  1814. LastMaxHP:=0
  1815. LastMaxES:=0
  1816. }
  1817.  
  1818.  
  1819. FlasksData:=[]
  1820. ReadFlasksData(WinID%A_Index%,FlasksData)
  1821.  
  1822. WinGet, CurrPID, PID, % "ahk_id" WinID%A_Index%
  1823. hwnd:=WinID%A_Index%
  1824. k="%hwnd%%CurrPid%"
  1825.  
  1826. If (!WindowQueuedFlaskEffects.HasKey(k))
  1827. {
  1828. WindowQueuedFlaskEffects[k]:={}
  1829. }
  1830.  
  1831. If (currLifeRatio>=0.90)
  1832. {
  1833. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount
  1834. WindowQueuedFlaskEffects[k].InstantQueueEndtime:=A_TickCount
  1835. }
  1836.  
  1837. If (currManaRatio>=0.90)
  1838. {
  1839. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount
  1840. }
  1841.  
  1842. If (PlayerStats.BuffAmount>100)
  1843. {
  1844. BuffAmount:=0
  1845. }
  1846. Else
  1847. {
  1848. BuffAmount:=PlayerStats.BuffAmount
  1849. }
  1850.  
  1851. QuicksilverBuff:=0
  1852.  
  1853. RemAilmentsTimer:=Round(CurrentConfig.RemAilmentsTimer/10,1)
  1854.  
  1855. LeavingArea:=0
  1856. GracePeriod:=0
  1857.  
  1858. TrayTip, , %Offset1%
  1859.  
  1860. loop, %BuffAmount%
  1861. {
  1862. If InStr(playerstats.BuffName[A_Index], "charged_attack")
  1863. {
  1864. BuffCharges:=PlayerStats.BuffCharges[A_Index]
  1865. If (BuffCharges = 6)
  1866. {
  1867. GetKeyState, state, RButton
  1868. Sendinput, {RButton Up}
  1869. if state = D
  1870. Sendinput, {RButton Down}
  1871. }
  1872. } BuffTimer:=PlayerStats.BuffTimer[A_Index]
  1873.  
  1874. If InStr(playerstats.BuffName[A_Index], "aura")
  1875. {
  1876. continue
  1877. }
  1878.  
  1879. Else If InStr(playerstats.BuffName[A_Index], "flask_utility_sprint")
  1880. {
  1881. QuicksilverBuff:=1
  1882. If (BuffTimer<0.25)
  1883. {
  1884. QuicksilverBuff:=0
  1885. BuffTimer:=0
  1886. }
  1887. continue
  1888. }
  1889.  
  1890.  
  1891. Else If (InStr(playerstats.BuffName[A_Index], "frozen") || InStr(playerstats.BuffName[A_Index], "冰凍"))
  1892. {
  1893. If ((FlaskOnFrozenCheck) && (BuffTimer>=RemAilmentsTimer))
  1894. {
  1895. If ((!WindowQueuedFlaskEffects[k].HasKey("FrozenQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].FrozenQueueEndtime-lagCompensation)))
  1896. {
  1897. If Taiwan
  1898. {
  1899. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"熱火之")
  1900. }
  1901. else
  1902. {
  1903. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Heat")
  1904. }
  1905.  
  1906. If (flaskNum!="")
  1907. {
  1908. WindowQueuedFlaskEffects[k].FrozenQueueEndtime:=A_TickCount+300
  1909.  
  1910. If (trayNotIfications)
  1911. {
  1912. TrayTip, PoE AutoFlask Using "of Heat" flask %flaskNum%, %A_Space% , 2
  1913. }
  1914. hKey:=FlaskHotkey%flaskNum%
  1915. IfWinActive Path of Exile ahk_class POEWindowClass
  1916. {
  1917. Sendinput, %hkey% Down}
  1918. Sendinput, %hkey% Up}
  1919. }
  1920. Else
  1921. {
  1922. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  1923. }
  1924. }
  1925. }
  1926. }
  1927. continue
  1928. }
  1929.  
  1930. Else If (InStr(playerstats.BuffName[A_Index], "shocked") || InStr(playerstats.BuffName[A_Index], "感電"))
  1931. {
  1932. If ((FlaskOnShockedCheck) && (BuffTimer>=RemAilmentsTimer))
  1933. {
  1934. If ((!WindowQueuedFlaskEffects[k].HasKey("ShockedQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].ShockedQueueEndtime-lagCompensation)))
  1935. {
  1936. If Taiwan
  1937. {
  1938. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"接地之")
  1939. }
  1940. else
  1941. {
  1942. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Grounding")
  1943. }
  1944.  
  1945. If (flaskNum!="")
  1946. {
  1947. WindowQueuedFlaskEffects[k].ShockedQueueEndtime:=A_TickCount+300
  1948.  
  1949. If (trayNotIfications)
  1950. {
  1951. TrayTip, PoE AutoFlask Using "of Grounding" flask %flaskNum%, %A_Space% , 2
  1952. }
  1953. hKey:=FlaskHotkey%flaskNum%
  1954. IfWinActive Path of Exile ahk_class POEWindowClass
  1955. {
  1956. Sendinput, %hkey% Down}
  1957. Sendinput, %hkey% Up}
  1958. }
  1959. Else
  1960. {
  1961. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  1962. }
  1963. }
  1964. }
  1965. }
  1966. continue
  1967. }
  1968.  
  1969. Else If (InStr(playerstats.BuffName[A_Index], "ignited") || InStr(playerstats.BuffName[A_Index], "燃燒"))
  1970. {
  1971. If ((FlaskOnIgnitedCheck) && (BuffTimer>=RemAilmentsTimer))
  1972. {
  1973. If ((!WindowQueuedFlaskEffects[k].HasKey("IgnitedQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].IgnitedQueueEndtime-lagCompensation)))
  1974. {
  1975. If Taiwan
  1976. {
  1977. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"澆熄之")
  1978. }
  1979. else
  1980. {
  1981. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Dousing")
  1982. }
  1983.  
  1984. If (flaskNum!="")
  1985. {
  1986. WindowQueuedFlaskEffects[k].IgnitedQueueEndtime:=A_TickCount+300
  1987.  
  1988. If (trayNotIfications)
  1989. {
  1990. TrayTip, PoE AutoFlask Using "of Dousing" flask %flaskNum%, %A_Space% , 2
  1991. }
  1992. hKey:=FlaskHotkey%flaskNum%
  1993. IfWinActive Path of Exile ahk_class POEWindowClass
  1994. {
  1995. Sendinput, %hkey% Down}
  1996. Sendinput, %hkey% Up}
  1997. }
  1998. Else
  1999. {
  2000. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2001. }
  2002. }
  2003. }
  2004. }
  2005. continue
  2006. }
  2007.  
  2008. Else If (((InStr(playerstats.BuffName[A_Index], "curse")) || InStr(playerstats.BuffName[A_Index], "冰凍")) And !(InStr(playerstats.BuffName[A_Index], "flask")) And !(PlayerStats.BuffTimer[A_Index]="1.#INF00"))
  2009. {
  2010. If (FlaskOnCurseCheck)
  2011. {
  2012. If ((!WindowQueuedFlaskEffects[k].HasKey("CurseQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].CurseQueueEndtime-lagCompensation)))
  2013. {
  2014. If Taiwan
  2015. {
  2016. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"守護之")
  2017. }
  2018. else
  2019. {
  2020. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Warding")
  2021. }
  2022.  
  2023. If (flaskNum!="")
  2024. {
  2025. WindowQueuedFlaskEffects[k].CurseQueueEndtime:=A_TickCount+300
  2026.  
  2027. If (trayNotIfications)
  2028. {
  2029. TrayTip, PoE AutoFlask Using "of Warding" flask %flaskNum%, %A_Space% , 2
  2030. }
  2031. hKey:=FlaskHotkey%flaskNum%
  2032. IfWinActive Path of Exile ahk_class POEWindowClass
  2033. {
  2034. Sendinput, %hkey% Down}
  2035. Sendinput, %hkey% Up}
  2036. }
  2037. Else
  2038. {
  2039. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2040. }
  2041. }
  2042. }
  2043. }
  2044. continue
  2045. }
  2046.  
  2047. Else If (InStr(playerstats.BuffName[A_Index], "corrupted_blood") || InStr(playerstats.BuffName[A_Index], "腐化之血"))
  2048. {
  2049. global RemoveCorruptedBloodCharges
  2050. BuffCharges:=PlayerStats.BuffCharges[A_Index]
  2051. If ((FlaskOnCorruptedBloodCheck) && (BuffCharges>=RemoveCorruptedBloodCharges))
  2052. {
  2053. If ((!WindowQueuedFlaskEffects[k].HasKey("CorruptedBloodQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].CorruptedBloodQueueEndtime-lagCompensation)))
  2054. {
  2055. If Taiwan
  2056. {
  2057. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"止血之")
  2058. }
  2059. else
  2060. {
  2061. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Staunching")
  2062. }
  2063.  
  2064. If (flaskNum!="")
  2065. {
  2066. WindowQueuedFlaskEffects[k].CorruptedBloodQueueEndtime:=A_TickCount+300
  2067.  
  2068. If (trayNotIfications)
  2069. {
  2070. TrayTip, PoE AutoFlask Using "of Staunching" flask %flaskNum%, %A_Space% , 2
  2071. }
  2072. hKey:=FlaskHotkey%flaskNum%
  2073. IfWinActive Path of Exile ahk_class POEWindowClass
  2074. {
  2075. Sendinput, %hkey% Down}
  2076. Sendinput, %hkey% Up}
  2077. }
  2078. Else
  2079. {
  2080. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2081. }
  2082. }
  2083. }
  2084. }
  2085. continue
  2086. }
  2087.  
  2088. Else If InStr(playerstats.BuffName[A_Index], "puncture")
  2089. {
  2090. If ((FlaskOnCorruptedBloodCheck))
  2091. {
  2092. If ((!WindowQueuedFlaskEffects[k].HasKey("CorruptedBloodQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].CorruptedBloodQueueEndtime-lagCompensation)))
  2093. {
  2094. If Taiwan
  2095. {
  2096. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"止血之")
  2097. }
  2098. else
  2099. {
  2100. flaskNum:=GetMaxChargesFlaskOfMod(FlasksData,"of Staunching")
  2101. }
  2102.  
  2103. If (flaskNum!="")
  2104. {
  2105. WindowQueuedFlaskEffects[k].CorruptedBloodQueueEndtime:=A_TickCount+300
  2106.  
  2107. If (trayNotIfications)
  2108. {
  2109. TrayTip, PoE AutoFlask Using "of Staunching" flask %flaskNum%, %A_Space% , 2
  2110. }
  2111. hKey:=FlaskHotkey%flaskNum%
  2112. IfWinActive Path of Exile ahk_class POEWindowClass
  2113. {
  2114. Sendinput, %hkey% Down}
  2115. Sendinput, %hkey% Up}
  2116. }
  2117. Else
  2118. {
  2119. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2120. }
  2121. }
  2122. }
  2123. }
  2124. continue
  2125. }
  2126. /* Lag dependent?
  2127. Else If InStr(playerstats.BuffName[A_Index], "flask_effect_Life")
  2128. {
  2129. If (BuffTimer)
  2130. {
  2131. WindowQueuedFlaskEffects[k].hpQueueEndtime:=(A_TickCount+(BuffTimer*100))
  2132. }
  2133. continue
  2134. }
  2135.  
  2136. Else If InStr(playerstats.BuffName[A_Index], "flask_effect_mana")
  2137. {
  2138. If (BuffTimer)
  2139. {
  2140. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=(A_TickCount+(BuffTimer*100))
  2141. }
  2142. continue
  2143. }
  2144. */
  2145.  
  2146. Else If InStr(playerstats.BuffName[A_Index], "leaving_area_protection")
  2147. {
  2148. LeavingArea:=1
  2149. continue
  2150. }
  2151. Else If InStr(playerstats.BuffName[A_Index], "grace_period")
  2152. {
  2153. GracePeriod:=1
  2154. continue
  2155. }
  2156.  
  2157.  
  2158. /* ;Others
  2159. Else If InStr(playerstats.BuffName[A_Index], "chilled")
  2160. {
  2161. TrayTip, test , THIS BUFF IS CHILLED!!! buff%A_Index%
  2162. continue
  2163. }
  2164.  
  2165. Else If InStr(playerstats.BuffName[A_Index], "puncture")
  2166. {
  2167. TrayTip, test, THIS BUFF IS PUNCTURE!!! buff%A_Index%
  2168. continue
  2169. }
  2170.  
  2171. Else If InStr(playerstats.BuffName[A_Index], "endurance_charge")
  2172. {
  2173. BuffCharges:=PlayerStats.BuffCharges[A_Index]
  2174. TrayTip, test, Endurance Charge has %BuffCharges% charges ;charges test
  2175. continue
  2176. }
  2177. */
  2178. }
  2179.  
  2180. If (!GracePeriod && !LeavingArea)
  2181. {
  2182. If (currLifeRatio<CurrentConfig.minLifeRatioToInstant)
  2183. {
  2184. If ((!WindowQueuedFlaskEffects[k].HasKey("InstantQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].InstantQueueEndtime)))
  2185. {
  2186. tflaskNum2:=GetMaxChargesOfInstantFlask(FlasksData,"FlaskLife")
  2187. If (tflaskNum2!="")
  2188. {
  2189. flaskNum:=tflaskNum2
  2190. }
  2191. If (flaskNum!="")
  2192. {
  2193. IfDelay:= (CurrentConfig.IflaskDelay*10)
  2194. WindowQueuedFlaskEffects[k].InstantQueueEndtime:=A_TickCount+IfDelay
  2195. If (trayNotIfications)
  2196. {
  2197. TrayTip, PoE AutoFlask Using HP Flask %flaskNum%, %A_Space% , 2
  2198. }
  2199. hKey:=FlaskHotkey%flaskNum%
  2200. IfWinActive Path of Exile ahk_class POEWindowClass
  2201. {
  2202. Sendinput, %hkey% Down}
  2203. Sendinput, %hkey% Up}
  2204. }
  2205. Else
  2206. {
  2207. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2208. }
  2209. break
  2210. }
  2211. }
  2212. }
  2213.  
  2214. If (currLifeRatio<CurrentConfig.minLifeRatioToDrink)
  2215. {
  2216. If ((!WindowQueuedFlaskEffects[k].HasKey("hpQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].hpQueueEndtime-lagCompensation)))
  2217. {
  2218. tflaskNum2:=GetMaxChargesFlaskOfType(FlasksData,"FlaskLife")
  2219. tflaskNum1:=GetMaxChargesFlaskOfType(FlasksData,"FlaskHybrid")
  2220. If ((tflaskNum1!=) && (tflaskNum2!=))
  2221. {
  2222. flaskNum:=(FlasksData[tflaskNum1].ChargesCurrent>FlasksData[tflaskNum2].ChargesCurrent) ? tflaskNum1 : tflaskNum2
  2223. }
  2224. Else
  2225. {
  2226. If (tflaskNum1!="")
  2227. {
  2228. flaskNum:=tflaskNum1
  2229. }
  2230. If (tflaskNum2!="")
  2231. {
  2232. flaskNum:=tflaskNum2
  2233. }
  2234. }
  2235. If (flaskNum!="")
  2236. {
  2237. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2238. If (InStr(FlasksData[flaskNum].mod1,"Seething"))
  2239. {
  2240. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2241. }
  2242. Else If (InStr(FlasksData[flaskNum].mod2,"Seething"))
  2243. {
  2244. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2245. }
  2246. Else If (InStr(FlasksData[flaskNum].mod1,"沸騰的"))
  2247. {
  2248. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2249. }
  2250. Else If (InStr(FlasksData[flaskNum].mod2,"沸騰的"))
  2251. {
  2252. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2253. }
  2254. 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
  2255. {
  2256. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2257. }
  2258. 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
  2259. {
  2260. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2261. }
  2262. Else If ((InStr(FlasksData[flaskNum].mod1,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  2263. {
  2264. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2265. }
  2266. Else If ((InStr(FlasksData[flaskNum].mod2,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  2267. {
  2268. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+500
  2269. }
  2270. Else
  2271. {
  2272. WindowQueuedFlaskEffects[k].hpQueueEndtime:=A_TickCount+EffectDuration*100
  2273. }
  2274. If (trayNotIfications)
  2275. {
  2276. TrayTip, PoE AutoFlask Using HP flask %flaskNum%, %A_Space% , 2
  2277. }
  2278. hKey:=FlaskHotkey%flaskNum%
  2279. IfWinActive Path of Exile ahk_class POEWindowClass
  2280. {
  2281. Sendinput, %hkey% Down}
  2282. Sendinput, %hkey% Up}
  2283. }
  2284. Else
  2285. {
  2286. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2287. }
  2288. Break
  2289. }
  2290. }
  2291. }
  2292.  
  2293. If (currLifeRatio<CurrentConfig.minLifeRatioToPopJade || currEShieldRatio<CurrentConfig.minEShieldRatioToPopJade)
  2294. {
  2295. If ((!WindowQueuedFlaskEffects[k].HasKey("jadeQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].jadeQueueEndtime-lagCompensation)))
  2296. {
  2297. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility9") ; Jade Flask
  2298. If (flaskNum!="")
  2299. {
  2300. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2301. WindowQueuedFlaskEffects[k].jadeQueueEndtime:=A_TickCount+EffectDuration*100
  2302. If (trayNotIfications)
  2303. {
  2304. TrayTip, PoE AutoFlask Using Jade Flask %flaskNum%, %A_Space% , 2
  2305. }
  2306. hKey:=FlaskHotkey%flaskNum%
  2307. IfWinActive Path of Exile ahk_class POEWindowClass
  2308. {
  2309. Sendinput, %hkey% Down}
  2310. Sendinput, %hkey% Up}
  2311. }
  2312. Else
  2313. {
  2314. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2315. }
  2316. break
  2317. }
  2318. }
  2319. If ((!WindowQueuedFlaskEffects[k].HasKey("GraniteQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].GraniteQueueEndtime-lagCompensation)))
  2320. {
  2321. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility1") ; Basalt Flask
  2322. If (flaskNum = "")
  2323. {
  2324. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility5") ; Granite Flask
  2325. }
  2326. If (flaskNum!="")
  2327. {
  2328. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2329. WindowQueuedFlaskEffects[k].GraniteQueueEndtime:=A_TickCount+EffectDuration*100
  2330. If (trayNotIfications)
  2331. {
  2332. TrayTip, PoE AutoFlask Using Granite/Basalt Flask %flaskNum%, %A_Space% , 2
  2333. }
  2334. hKey:=FlaskHotkey%flaskNum%
  2335. IfWinActive Path of Exile ahk_class POEWindowClass
  2336. {
  2337. Sendinput, %hkey% Down}
  2338. Sendinput, %hkey% Up}
  2339. }
  2340. Else
  2341. {
  2342. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2343. }
  2344. break
  2345. }
  2346. }
  2347. }
  2348.  
  2349. If (currLifeRatio<CurrentConfig.minLifeRatioToPopElementalResist || currEShieldRatio<CurrentConfig.minEShieldRatioToPopElementalResist)
  2350. {
  2351. If ((!WindowQueuedFlaskEffects[k].HasKey("RubyQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].RubyQueueEndtime-lagCompensation)))
  2352. {
  2353. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility2") ; Ruby flask
  2354. If (flaskNum!="")
  2355. {
  2356. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2357. WindowQueuedFlaskEffects[k].RubyQueueEndtime:=A_TickCount+EffectDuration*100
  2358. If (trayNotIfications)
  2359. {
  2360. TrayTip, PoE AutoFlask Using Ruby Flask %flaskNum%, %A_Space% , 2
  2361. }
  2362. hKey:=FlaskHotkey%flaskNum%
  2363. IfWinActive Path of Exile ahk_class POEWindowClass
  2364. {
  2365. Sendinput, %hkey% Down}
  2366. Sendinput, %hkey% Up}
  2367. }
  2368. Else
  2369. {
  2370. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2371. }
  2372. break
  2373. }
  2374. }
  2375.  
  2376. If ((!WindowQueuedFlaskEffects[k].HasKey("TopazQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].TopazQueueEndtime-lagCompensation)))
  2377. {
  2378. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility4") ; Topaz flask
  2379. If (flaskNum!="")
  2380. {
  2381. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2382. WindowQueuedFlaskEffects[k].TopazQueueEndtime:=A_TickCount+EffectDuration*100
  2383. If (trayNotIfications)
  2384. {
  2385. TrayTip, PoE AutoFlask Using Topaz Flask %flaskNum%, %A_Space% , 2
  2386. }
  2387. hKey:=FlaskHotkey%flaskNum%
  2388. IfWinActive Path of Exile ahk_class POEWindowClass
  2389. {
  2390. Sendinput, %hkey% Down}
  2391. Sendinput, %hkey% Up}
  2392. }
  2393. Else
  2394. {
  2395. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2396. }
  2397. break
  2398. }
  2399. }
  2400.  
  2401. If ((!WindowQueuedFlaskEffects[k].HasKey("SapphireQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].SapphireQueueEndtime-lagCompensation)))
  2402. {
  2403. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility3") ; Sapphire flask
  2404. If (flaskNum!="")
  2405. {
  2406. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2407. WindowQueuedFlaskEffects[k].SapphireQueueEndtime:=A_TickCount+EffectDuration*100
  2408. If (trayNotIfications)
  2409. {
  2410. TrayTip, PoE AutoFlask Using Sapphire flask %flaskNum%, %A_Space% , 2
  2411. }
  2412. hKey:=FlaskHotkey%flaskNum%
  2413. IfWinActive Path of Exile ahk_class POEWindowClass
  2414. {
  2415. Sendinput, %hkey% Down}
  2416. Sendinput, %hkey% Up}
  2417. }
  2418. Else
  2419. {
  2420. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2421. }
  2422. break
  2423. }
  2424. }
  2425.  
  2426. If ((!WindowQueuedFlaskEffects[k].HasKey("AmethystQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].AmethystQueueEndtime-lagCompensation)))
  2427. {
  2428. flaskNum:=GetMaxChargesFlaskOfType(FlasksData,"FlaskUtility7") ; Amethyst flask
  2429. If (flaskNum!="")
  2430. {
  2431. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2432. WindowQueuedFlaskEffects[k].AmethystQueueEndtime:=A_TickCount+EffectDuration*100
  2433. If (trayNotIfications)
  2434. {
  2435. TrayTip, PoE AutoFlask Using Amethyst Flask %flaskNum%, %A_Space% , 2
  2436. }
  2437. hKey:=FlaskHotkey%flaskNum%
  2438. IfWinActive Path of Exile ahk_class POEWindowClass
  2439. {
  2440. Sendinput, %hkey% Down}
  2441. Sendinput, %hkey% Up}
  2442. }
  2443. Else
  2444. {
  2445. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2446. }
  2447. break
  2448. }
  2449. }
  2450. }
  2451.  
  2452. If (PlayerStats.MaxMana>0 && (currManaRatio<CurrentConfig.minManaRatioToDrink || PlayerStats.CurrMana<CurrentConfig.minManaToDrink))
  2453. {
  2454. If ((!WindowQueuedFlaskEffects[k].HasKey("ManaQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].ManaQueueEndtime-lagCompensation)))
  2455. {
  2456. tflaskNum2:=GetMaxChargesFlaskOfType(FlasksData,"FlaskMana")
  2457. tflaskNum1:=GetMaxChargesFlaskOfType(FlasksData,"FlaskHybrid")
  2458.  
  2459. If ((tflaskNum1!=) && (tflaskNum2!=))
  2460. {
  2461. flaskNum:=(FlasksData[tflaskNum1].ChargesCurrent>FlasksData[tflaskNum2].ChargesCurrent) ? tflaskNum1 : tflaskNum2
  2462. }
  2463. Else
  2464. {
  2465. If (tflaskNum1!="")
  2466. {
  2467. flaskNum:=tflaskNum1
  2468. }
  2469. If (tflaskNum2!="")
  2470. {
  2471. flaskNum:=tflaskNum2
  2472. }
  2473. }
  2474.  
  2475. If (flaskNum!="")
  2476. {
  2477. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2478. If (InStr(FlasksData[flaskNum].mod1,"Seething"))
  2479. {
  2480. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2481. }
  2482. Else If (InStr(FlasksData[flaskNum].mod2,"Seething"))
  2483. {
  2484. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2485. }
  2486. Else If (InStr(FlasksData[flaskNum].mod1,"沸騰的"))
  2487. {
  2488. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2489. }
  2490. Else If (InStr(FlasksData[flaskNum].mod2,"沸騰的"))
  2491. {
  2492. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2493. }
  2494. 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
  2495. {
  2496. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2497. }
  2498. 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
  2499. {
  2500. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2501. }
  2502. Else If ((InStr(FlasksData[flaskNum].mod1,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  2503. {
  2504. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2505. }
  2506. Else If ((InStr(FlasksData[flaskNum].mod2,"恐慌的")) And ((PlayerStats.CurrHP/PlayerStats.MaxHP)<=0.35)) ; "Low Life" can be caused by auras hp reservation from blood magic
  2507. {
  2508. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+500
  2509. }
  2510. Else
  2511. {
  2512. WindowQueuedFlaskEffects[k].ManaQueueEndtime:=A_TickCount+EffectDuration*100
  2513. }
  2514. If (trayNotIfications)
  2515. {
  2516. TrayTip, PoE AutoFlask Using Mana Flask %flaskNum%, %A_Space% , 2
  2517. }
  2518. hKey:=FlaskHotkey%flaskNum%
  2519. IfWinActive Path of Exile ahk_class POEWindowClass
  2520. {
  2521. Sendinput, %hkey% Down}
  2522. Sendinput, %hkey% Up}
  2523. }
  2524. Else
  2525. {
  2526. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2527. }
  2528. Break
  2529. }
  2530. }
  2531. }
  2532. }
  2533.  
  2534. If (PlayerStats.PlayerActionID!="" && PlayerStats.PlayerActionID!=128 && PlayerStats.PlayerActionID!=90)
  2535. {
  2536. MovementTimer:= A_TickCount
  2537. }
  2538. ;TODO MovementTimer%A_Index%
  2539.  
  2540. If(QuickSilverCheck && QuicksilverBuff=0)
  2541. {
  2542. If (PlayerStats.InCity!="" && PlayerStats.InCity=65537)
  2543. {
  2544. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2545. {
  2546. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2547. {
  2548. If (PlayerStats.PlayerActionID!="" && (PlayerStats.PlayerActionID=128 || PlayerStats.PlayerActionID=90))
  2549. {
  2550. If (A_TickCount>=MovementTimer+CurrentConfig.QuickSilverTimer)
  2551. {
  2552. If ((!WindowQueuedFlaskEffects[k].HasKey("QuickQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].QuickQueueEndtime-lagCompensation)))
  2553. {
  2554. flaskNum:=GetMaxChargesFlaskQuickSilver(FlasksData,"FlaskUtility6") ; QuickSilver flask
  2555. If (flaskNum!="")
  2556. {
  2557. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2558. WindowQueuedFlaskEffects[k].QuickQueueEndtime:=A_TickCount+EffectDuration*100
  2559. If (trayNotIfications)
  2560. {
  2561. TrayTip, PoE AutoFlask Using QuickSilver Flask %flaskNum%, %A_Space% , 2
  2562. }
  2563. hKey:=FlaskHotkey%flaskNum%
  2564. IfWinActive Path of Exile ahk_class POEWindowClass
  2565. {
  2566. Sendinput, %hkey% Down}
  2567. Sendinput, %hkey% Up}
  2568. }
  2569. Else
  2570. {
  2571. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2572. }
  2573. break
  2574. }
  2575. }
  2576. }
  2577. }
  2578. }
  2579. }
  2580. }
  2581. }
  2582.  
  2583. If(QuickSilverCheck2 && QuicksilverBuff=0)
  2584. {
  2585. If (PlayerStats.InCity!="" && PlayerStats.InCity=65537)
  2586. {
  2587. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2588. {
  2589. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2590. {
  2591. If (PlayerStats.PlayerActionID!="" && (PlayerStats.PlayerActionID=128 || PlayerStats.PlayerActionID=90))
  2592. {
  2593. If (A_TickCount>=MovementTimer+CurrentConfig.QuickSilverTimer)
  2594. {
  2595. If ((!WindowQueuedFlaskEffects[k].HasKey("QuickQueueEndtime")) || (A_TickCount>=(WindowQueuedFlaskEffects[k].QuickQueueEndtime-lagCompensation)))
  2596. {
  2597. flaskNum:=GetMaxChargesFlaskQuickSilver2(FlasksData,"FlaskUtility6") ; QuickSilver flask
  2598. If (flaskNum!="")
  2599. {
  2600. EffectDuration:=FlasksData[flaskNum].EffectDuration
  2601. WindowQueuedFlaskEffects[k].QuickQueueEndtime:=A_TickCount+EffectDuration*100
  2602. If (trayNotIfications)
  2603. {
  2604. TrayTip, PoE AutoFlask Using QuickSilver flask %flaskNum%, %A_Space% , 2
  2605. }
  2606. hKey:=FlaskHotkey%flaskNum%
  2607. IfWinActive Path of Exile ahk_class POEWindowClass
  2608. {
  2609. Sendinput, %hkey% Down}
  2610. Sendinput, %hkey% Up}
  2611. }
  2612. Else
  2613. {
  2614. ControlSend,,%hkey% Down %hkey% Up}, % "ahk_id" hwnd
  2615. }
  2616. break
  2617. }
  2618. }
  2619. }
  2620. }
  2621. }
  2622. }
  2623. }
  2624. }
  2625.  
  2626. If(AttackInPlaceCheck)
  2627. {
  2628. If (IsInGame(hwnd))
  2629. {
  2630. If (PlayerStats.InCity!="" && PlayerStats.InCity=65537)
  2631. {
  2632. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2633. {
  2634. If (PlayerStats.MouseOnEnemyStatus!="" && PlayerStats.MouseOnEnemyStatus=4)
  2635. {
  2636. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2637. {
  2638. If (PlayerStats.EnemyName!="")
  2639. {
  2640. If (PlayerStats.EnemyName2!="Oak}" && PlayerStats.EnemyName2!="Alira}" && PlayerStats.EnemyName2!="Kraityn}")
  2641. {
  2642. If (InStr(PlayerStats.EnemyName2,"Shrine") || InStr(PlayerStats.EnemyName2,"(Level)"))
  2643. {
  2644. AttackInPlaceKeyUp:=1
  2645. }
  2646. Else
  2647. {
  2648. IfWinActive Path of Exile ahk_class POEWindowClass
  2649. {
  2650. GetKeyState, stateSH, %AttackInPlaceKey%
  2651. If stateSH = U
  2652. {
  2653. Sendinput, {%AttackInPlaceKey% DOWN}
  2654. AttackInPlaceKeyUp:=0
  2655. AttackInPlaceKeyDown:=1
  2656. }
  2657. }
  2658. Else
  2659. {
  2660. AttackInPlaceKeyUp:=1
  2661. }
  2662. }
  2663. }
  2664. Else
  2665. {
  2666. AttackInPlaceKeyUp:=1
  2667. }
  2668. }
  2669. Else
  2670. {
  2671. AttackInPlaceKeyUp:=1
  2672. }
  2673. }
  2674. Else
  2675. {
  2676. AttackInPlaceKeyUp:=1
  2677. }
  2678. }
  2679. Else
  2680. {
  2681. AttackInPlaceKeyUp:=1
  2682. }
  2683. }
  2684. Else
  2685. {
  2686. AttackInPlaceKeyUp:=1
  2687. }
  2688. }
  2689. Else
  2690. {
  2691. AttackInPlaceKeyUp:=1
  2692. }
  2693. }
  2694. Else
  2695. {
  2696. AttackInPlaceKeyUp:=1
  2697. }
  2698. If (AttackInPlaceKeyUp=1 && AttackInPlaceKeyDown=1)
  2699. {
  2700. GetKeyState, stateSH, %AttackInPlaceKey%
  2701. If stateSH = D
  2702. {
  2703. Sendinput, {%AttackInPlaceKey% UP}
  2704. }
  2705. AttackInPlaceKeyUp:=0
  2706. }
  2707. }
  2708.  
  2709. If(HoldCtrlCheck)
  2710. {
  2711. If (IsInGame(hwnd))
  2712. {
  2713. If (PlayerStats.PanelWaypoint=65537 && PlayerStats.PanelInstanceManager=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2714. {
  2715. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2716. {
  2717. If (LeavingArea=0)
  2718. {
  2719. IfWinActive Path of Exile ahk_class POEWindowClass
  2720. {
  2721. GetKeyState, stateRCtrl, RCtrl
  2722. If stateRCtrl = U
  2723. {
  2724. Sendinput, {RCtrl Down}
  2725. CtrlKeyUp:=0
  2726. CtrlkeyDown:=1
  2727. If (trayNotIfications)
  2728. {
  2729. TrayTip, , CTRL key: DOWN, 1
  2730. }
  2731. }
  2732. }
  2733. Else
  2734. {
  2735. CtrlKeyUp:=1
  2736. }
  2737. }
  2738. Else
  2739. {
  2740. CtrlKeyUp:=1
  2741. }
  2742. }
  2743. Else
  2744. {
  2745. CtrlKeyUp:=1
  2746. }
  2747. }
  2748. Else
  2749. {
  2750. CtrlKeyUp:=1
  2751. }
  2752. }
  2753. Else
  2754. {
  2755. CtrlKeyUp:=1
  2756. }
  2757. If (CtrlKeyUp=1 && CtrlkeyDown=1)
  2758. {
  2759. GetKeyState, stateRCtrl, RCtrl
  2760. If stateRCtrl = D
  2761. {
  2762. Sendinput, {RCtrl Up}
  2763. If (trayNotIfications)
  2764. {
  2765. TrayTip,, CTRL key: UP, 1
  2766. }
  2767. CtrlkeyDown=0
  2768. CtrlKeyUp:=0
  2769. }
  2770. }
  2771. }
  2772.  
  2773.  
  2774.  
  2775. ;If (PlayerStats.PlayerActionID!="" && PlayerStats.PlayerActionID=2176) ;2048 not
  2776. ;If ((autoQuit=1) && (ThisID!="") && (ThisID!=WinActive("A")))
  2777. ;WinActivate, % "ahk_id" ThisID
  2778.  
  2779. ++PanickedTimer ;TODO better way
  2780.  
  2781.  
  2782. If desync = 1
  2783. {
  2784. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2785. {
  2786. If (IsInGame(hwnd))
  2787. {
  2788. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2789. {
  2790. IfWinActive Path of Exile ahk_class POEWindowClass
  2791. {
  2792. SendInput {NumpadEnter}/oos{NumpadEnter}
  2793. }
  2794. Else
  2795. {
  2796. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2797. SetKeyDelay, 40, 20
  2798. ControlSend,,`/oos, % "ahk_id" hwnd
  2799. SetKeyDelay, 0, 0
  2800. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2801. }
  2802. }
  2803. }
  2804. }
  2805. desync := 0
  2806. }
  2807.  
  2808. If remaining = 1
  2809. {
  2810. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2811. {
  2812. If (IsInGame(hwnd))
  2813. {
  2814. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2815. {
  2816. IfWinActive Path of Exile ahk_class POEWindowClass
  2817. {
  2818. SendInput {NumpadEnter}/remaining{NumpadEnter}
  2819. }
  2820. Else
  2821. {
  2822. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2823. SetKeyDelay, 40, 20
  2824. ControlSend,,`/remaining, % "ahk_id" hwnd
  2825. SetKeyDelay, 0, 0
  2826. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2827. }
  2828. }
  2829. }
  2830. remaining := 0
  2831. break
  2832. }
  2833. }
  2834.  
  2835. If hideout = 1
  2836. {
  2837. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2838. {
  2839. If (IsInGame(hwnd))
  2840. {
  2841. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2842. {
  2843. IfWinActive Path of Exile ahk_class POEWindowClass
  2844. {
  2845. SendInput {NumpadEnter}/hideout{NumpadEnter}
  2846. }
  2847. Else
  2848. {
  2849. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2850. SetKeyDelay, 40, 20
  2851. ControlSend,,`/hideout, % "ahk_id" hwnd
  2852. SetKeyDelay, 0, 0
  2853. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2854. }
  2855. }
  2856. }
  2857. hideout := 0
  2858. break
  2859. }
  2860. }
  2861.  
  2862. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2863. {
  2864. ChatCheckTimer:= 1
  2865. }
  2866.  
  2867. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65537)
  2868. {
  2869. If (A_TickCount>=(ChatStatusTimer+50))
  2870. {
  2871. If (IsInGame(hwnd))
  2872. {
  2873. IfWinActive Path of Exile ahk_class POEWindowClass
  2874. {
  2875. ResyncTimer:= 0
  2876. TradeSpam:= 0
  2877. GuiControl, , TradeSpam, 0
  2878. GuiControl, , TradeSpamUpdate, 0
  2879. IniWrite, 0 , Config.ini, Config, TradeSpam
  2880. TradeChannel:= 1
  2881. tradechat:= 0
  2882. TradeTimer:= 0
  2883. TradeStep:= 3
  2884. TradeSpamTimer:= 3
  2885. }
  2886. }
  2887. }
  2888. Else
  2889. {
  2890. If ChatCheckTimer = 1
  2891. {
  2892. ChatStatusTimer:= A_TickCount
  2893. ChatCheckTimer:= 0
  2894. }
  2895. }
  2896. }
  2897.  
  2898. If TradeSpam>0
  2899. {
  2900. If (A_TickCount>=(TradeSpamTimer+TradeSpam*60000))
  2901. {
  2902. tradechat:= 1
  2903. TradeSpamTimer:= A_TickCount
  2904. }
  2905. Else If TradeSpamTimer = 3
  2906. {
  2907. tradechat:= 1
  2908. TradeSpamTimer:= A_TickCount
  2909. }
  2910. }
  2911.  
  2912. If tradechat = 1
  2913. {
  2914. SendMode, Input
  2915. If (A_TickCount>=TradeTimer+1000+(TradeSpam*2000))
  2916. {
  2917. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  2918. {
  2919. If (IsInGame(hwnd))
  2920. {
  2921. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  2922. {
  2923. IfWinActive Path of Exile ahk_class POEWindowClass
  2924. {
  2925. SendMode Input
  2926. GetKeyState, stateSH, SHIfT
  2927. If stateSH = D
  2928. {
  2929. Sendinput {SHIfT up}
  2930. }
  2931. If (TradeStep = 1)
  2932. {
  2933. Send {NumpadEnter}
  2934. Send /trade %TradeChannel%
  2935. Send {NumpadEnter}
  2936. TradeStep:= 2
  2937. TradeTimer:= A_TickCount
  2938. }
  2939. Else If (TradeStep = 2)
  2940. {
  2941. Send {NumpadEnter}{Up 2}{NumpadEnter}
  2942. TradeStep:= 3
  2943. TradeTimer:= A_TickCount
  2944. }
  2945. Else If (TradeStep = 3)
  2946. {
  2947. If (TradeChannel<10)
  2948. {
  2949. TradeChannel++
  2950. TradeStep:= 1
  2951. TradeTimer:= A_TickCount
  2952. }
  2953. Else
  2954. {
  2955. TradeChannel:= 1
  2956. tradechat:= 0
  2957. TradeTimer:= 0
  2958. TradeStep:= 1
  2959. }
  2960. }
  2961. }
  2962. Else
  2963. {
  2964. SendMode Input
  2965. GetKeyState, stateSH, SHIfT
  2966. If stateSH = D
  2967. {
  2968. Sendinput {SHIfT up}
  2969. }
  2970. If (TradeStep = 1)
  2971. {
  2972. SetKeyDelay, 60, 20
  2973. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2974. ControlSendRaw,,`/trade %TradeChannel%, % "ahk_id" hwnd
  2975. ControlSend,,{NumpadEnter}, % "ahk_id" hwnd
  2976. SetKeyDelay, 0, 0
  2977. TradeStep:= 2
  2978. TradeTimer:= A_TickCount
  2979. }
  2980. Else If (TradeStep = 2)
  2981. {
  2982. SetKeyDelay, 20, 20
  2983. ControlSend,,{NumpadEnter}{Up 2}{NumpadEnter}, % "ahk_id" hwnd
  2984. SetKeyDelay, 0, 0
  2985. TradeStep:= 3
  2986. TradeTimer:= A_TickCount
  2987. }
  2988. Else If (TradeStep = 3)
  2989. {
  2990. If (TradeChannel<10)
  2991. {
  2992. TradeChannel++
  2993. TradeStep:= 1
  2994. TradeTimer:= A_TickCount
  2995. }
  2996. Else
  2997. {
  2998. TradeChannel:= 1
  2999. tradechat:= 0
  3000. TradeTimer:= 0
  3001. TradeStep:= 1
  3002. }
  3003. }
  3004. }
  3005. }
  3006. }
  3007. ChatStatusTimer:= A_TickCount+99999999999
  3008. ChatCheckTimer:= 1
  3009. }
  3010. }
  3011. }
  3012. Else
  3013. {
  3014. If (A_TickCount>=(ResyncTimer+ResyncSpam*1000) And (ResyncSpam>0))
  3015. {
  3016. If (PlayerStats.InCity!="" && PlayerStats.InCity=65537)
  3017. {
  3018. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  3019. {
  3020. If (IsInGame(hwnd))
  3021. {
  3022. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  3023. {
  3024. IfWinActive Path of Exile ahk_class POEWindowClass
  3025. {
  3026. GetKeyState, stateSH, SHIfT
  3027. If stateSH = D
  3028. {
  3029. Sendinput {SHIfT up}
  3030. }
  3031. Sendinput {NumpadEnter}/oos{NumpadEnter}
  3032. }
  3033. }
  3034. }
  3035. }
  3036. }
  3037. ResyncTimer:= A_TickCount
  3038. }
  3039.  
  3040. If (A_TickCount>=(RemainingTimer+RemainingSpam*1000) And (RemainingSpam>0))
  3041. {
  3042. If (PlayerStats.InCity!="" && PlayerStats.InCity=65537)
  3043. {
  3044. If (PlayerStats.ChatStatus!="" && PlayerStats.ChatStatus=65536)
  3045. {
  3046. If (IsInGame(hwnd))
  3047. {
  3048. If (PlayerStats.PanelWaypoint=65536 && PlayerStats.PanelInventory=65536 && PlayerStats.PanelSkillTree=65536 && PlayerStats.PanelSocial=65536)
  3049. {
  3050. IfWinActive Path of Exile ahk_class POEWindowClass
  3051. {
  3052. GetKeyState, stateSH, SHIfT
  3053. If stateSH = D
  3054. {
  3055. Sendinput {SHIfT up}
  3056. }
  3057. Sendinput {NumpadEnter}/remaining{NumpadEnter}
  3058. }
  3059. }
  3060. }
  3061. }
  3062. }
  3063. RemainingTimer:= A_TickCount
  3064. }
  3065. }
  3066.  
  3067. ;--------------Debug Window Update------------------
  3068.  
  3069. IfWinExist, Debug Window
  3070. {
  3071. MaxHPvalue:=PlayerStats.MaxHP
  3072. GuiControl,4: , MaxHPvar , %MaxHPvalue%
  3073. CurrHPvalue:=PlayerStats.CurrHP
  3074. GuiControl,4: , CurrHPvar , %CurrHPvalue%
  3075. ReservedHPFlatvalue:=PlayerStats.ReservedHPFlat
  3076. GuiControl,4: , ReservedHPFlatvar , %ReservedHPFlatvalue%
  3077. ReservedHPPercentvalue:=PlayerStats.ReservedHPPercent
  3078. GuiControl,4: , ReservedHPPercentvar , %ReservedHPPercentvalue%
  3079. MaxManavalue:=PlayerStats.MaxMana
  3080. GuiControl,4: , MaxManavar , %MaxManavalue%
  3081. CurrManavalue:=PlayerStats.CurrMana
  3082. GuiControl,4: , CurrManavar , %CurrManavalue%
  3083. ReservedManaFlatvalue:=PlayerStats.ReservedManaFlat
  3084. GuiControl,4: , ReservedManaFlatvar , %ReservedManaFlatvalue%
  3085. ReservedManaPercentvalue:=PlayerStats.ReservedManaPercent
  3086. GuiControl,4: , ReservedManaPercentvar , %ReservedManaPercentvalue%
  3087. MaxEShieldvalue:=PlayerStats.MaxEShield
  3088. GuiControl,4: , MaxEShieldvar , %MaxEShieldvalue%
  3089. CurrEShieldvalue:=PlayerStats.CurrEShield
  3090. GuiControl,4: , CurrEShieldvar , %CurrEShieldvalue%
  3091. PlayerActionIDvalue:=PlayerStats.PlayerActionID
  3092. If (PlayerActionIDvalue=128 || PlayerActionIDvalue=90)
  3093. {
  3094. GuiControl,4: , PlayerActionIDvar , %PlayerActionIDvalue% (Moving)
  3095. }
  3096. Else If (PlayerActionIDvalue=2 || PlayerActionIDvalue=10 || PlayerActionIDvalue=12)
  3097. {
  3098. GuiControl,4: , PlayerActionIDvar , %PlayerActionIDvalue% (Attacking)
  3099. }
  3100. Else If (PlayerActionIDvalue=0)
  3101. {
  3102. GuiControl,4: , PlayerActionIDvar , %PlayerActionIDvalue% (Nothing)
  3103. }
  3104. Else If (PlayerActionIDvalue=64)
  3105. {
  3106. GuiControl,4: , PlayerActionIDvar , %PlayerActionIDvalue% (Dead)
  3107. }
  3108. Else
  3109. {
  3110. GuiControl,4: , PlayerActionIDvar , %PlayerActionIDvalue% (Unknown)
  3111. }
  3112. ChatStatusvalue:=PlayerStats.ChatStatus
  3113. If (ChatStatusvalue=65537)
  3114. {
  3115. GuiControl,4: , ChatStatusvar , Opened
  3116. }
  3117. Else If (ChatStatusvalue=65536)
  3118. {
  3119. GuiControl,4: , ChatStatusvar , Closed
  3120. }
  3121. MouseOnEnemyStatusvalue:=PlayerStats.MouseOnEnemyStatus
  3122. If (MouseOnEnemyStatusvalue=4)
  3123. {
  3124. GuiControl,4: , MouseOnEnemyStatusvar , Yes
  3125. }
  3126. Else If (MouseOnEnemyStatusvalue=3)
  3127. {
  3128. GuiControl,4: , MouseOnEnemyStatusvar , No
  3129. }
  3130. PanelWaypointvalue:=PlayerStats.PanelWaypoint
  3131. If (PanelWaypointvalue=65537)
  3132. {
  3133. GuiControl,4: , PanelWaypointvar , Opened
  3134. }
  3135. Else If (PanelWaypointvalue=65536)
  3136. {
  3137. GuiControl,4: , PanelWaypointvar , Closed
  3138. }
  3139. PanelInventoryvalue:=PlayerStats.PanelInventory
  3140. If (PanelInventoryvalue=65537)
  3141. {
  3142. GuiControl,4: , PanelInventoryvar , Opened
  3143. }
  3144. Else If (PanelInventoryvalue=65536)
  3145. {
  3146. GuiControl,4: , PanelInventoryvar , Closed
  3147. }
  3148. PanelSkillTreevalue:=PlayerStats.PanelSkillTree
  3149. If (PanelSkillTreevalue=65537)
  3150. {
  3151. GuiControl,4: , PanelSkillTreevar , Opened
  3152. }
  3153. Else If (PanelSkillTreevalue=65536)
  3154. {
  3155. GuiControl,4: , PanelSkillTreevar , Closed
  3156. }
  3157. PanelSocialvalue:=PlayerStats.PanelSocial
  3158. If (PanelSocialvalue=65537)
  3159. {
  3160. GuiControl,4: , PanelSocialvar , Opened
  3161. }
  3162. Else If (PanelSkillTreevalue=65536)
  3163. {
  3164. GuiControl,4: , PanelSocialvar , Closed
  3165. }
  3166. InCityvalue:=PlayerStats.InCity
  3167. If (InCityvalue=65537)
  3168. {
  3169. GuiControl,4: , InCityvar , No
  3170. }
  3171. Else If (InCityvalue=65536)
  3172. {
  3173. GuiControl,4: , InCityvar , Yes
  3174. }
  3175. PanelInstanceManagervalue:=PlayerStats.PanelInstanceManager
  3176. If (PanelInstanceManagervalue=65537)
  3177. {
  3178. GuiControl,4: , PanelInstanceManagervar , Opened
  3179. }
  3180. Else If (PanelInstanceManagervalue=65536)
  3181. {
  3182. GuiControl,4: , PanelInstanceManagervar , Closed
  3183. }
  3184.  
  3185. EnemyNamevalue:=PlayerStats.EnemyName
  3186. GuiControl,4: , EnemyNamevar , %EnemyNamevalue%
  3187. EnemyName2value:=PlayerStats.EnemyName2
  3188. GuiControl,4: , EnemyName2var , %EnemyName2value%
  3189. MapNamevalue:=PlayerStats.MapName
  3190. GuiControl,4: , MapNamevar , %MapNamevalue%
  3191.  
  3192. Loop, 5
  3193. {
  3194. Flask%A_Index%Typevalue:=FlasksData[A_Index].type
  3195. value:=Flask%A_Index%Typevalue
  3196. GuiControl,4: , Flask%A_Index%Typevar , %value%
  3197.  
  3198. Flask%A_Index%ChargesCurrentvalue:=FlasksData[A_Index].ChargesCurrent
  3199. value:=Flask%A_Index%ChargesCurrentvalue
  3200. GuiControl,4: , Flask%A_Index%ChargesCurrentvar , %value%
  3201.  
  3202. Flask%A_Index%ChargesPerUsevalue:=FlasksData[A_Index].ChargesPerUse
  3203. value:=Flask%A_Index%ChargesPerUsevalue
  3204. GuiControl,4: , Flask%A_Index%ChargesPerUsevar , %value%
  3205.  
  3206. Flask%A_Index%mod1value:=FlasksData[A_Index].mod1
  3207. value:=Flask%A_Index%mod1value
  3208. GuiControl,4: , Flask%A_Index%mod1var , %value%
  3209.  
  3210. Flask%A_Index%mod2value:=FlasksData[A_Index].mod2
  3211. value:=Flask%A_Index%mod2value
  3212. GuiControl,4: , Flask%A_Index%mod2var , %value%
  3213. }
  3214.  
  3215. BuffAmountvalue:=round(PlayerStats.BuffAmount)
  3216. GuiControl,4: , BuffAmountvar , %BuffAmountvalue%
  3217.  
  3218. Loop, 8
  3219. {
  3220.  
  3221. BuffName%A_Index%value:=PlayerStats.BuffName[A_Index]
  3222. value:=BuffName%A_Index%value
  3223. GuiControl,4: , Buff%A_Index%Namevar , %value%
  3224.  
  3225. BuffCharges%A_Index%value:=PlayerStats.BuffCharges[A_Index]
  3226. value:=BuffCharges%A_Index%value
  3227. GuiControl,4: , Buff%A_Index%Chargesvar , %value%
  3228.  
  3229. BuffTimer%A_Index%value:=PlayerStats.BuffTimer[A_Index]
  3230. value:=BuffTimer%A_Index%value
  3231. If (value="1.#INF00")
  3232. {
  3233. GuiControl,4: , Buff%A_Index%Timervar , Infinite
  3234. }
  3235. Else
  3236. {
  3237. GuiControl,4: , Buff%A_Index%Timervar , %value%
  3238. }
  3239. }
  3240. }
  3241. ;--------------Debug Window Update------------------
  3242. Sleep, %AutoFlaskWatchdogPeriod%
  3243. }
  3244. Sleep, 1
  3245. }
  3246.  
  3247. ;-------MAIN FUNCTIONS-----------------MAIN FUNCTIONS-----------------MAIN FUNCTIONS-----------------
  3248.  
  3249. ;-------TEST FUNCTIONS-----------------TEST FUNCTIONS-----------------TEST FUNCTIONS-----------------
  3250.  
  3251.  
  3252. UsePortal()
  3253. {
  3254. IfWinActive Path of Exile ahk_class POEWindowClass
  3255. {
  3256. BlockInput On
  3257. SendMode Input
  3258. hwnd:=WinActive("A")
  3259. GetKeyState, stateR, RButton
  3260. If stateR = D
  3261. {
  3262. Send {RButton up}
  3263. }
  3264. GetKeyState, stateL, LButton
  3265. If stateL = D
  3266. {
  3267. Send {LButton up}
  3268. }
  3269. GetKeyState, stateM, MButton
  3270. If stateM = D
  3271. {
  3272. Send {MButton up}
  3273. }
  3274. GetKeyState, stateQ, Q
  3275. If stateQ = D
  3276. {
  3277. Send {Q up}
  3278. }
  3279. GetKeyState, stateW, W
  3280. If stateW = D
  3281. {
  3282. Send {W up}
  3283. }
  3284. GetKeyState, stateE, E
  3285. If stateE = D
  3286. {
  3287. Send {E up}
  3288. }
  3289. GetKeyState, stateR, R
  3290. If stateR = D
  3291. {
  3292. Send {R up}
  3293. }
  3294. GetKeyState, stateT, T
  3295. If stateT = D
  3296. {
  3297. Send {T up}
  3298. }
  3299. GetKeyState, stateI, I
  3300. If stateI = D
  3301. {
  3302. Send {I up}
  3303. }
  3304. GetKeyState, stateSP, SPACE
  3305. If stateSP = D
  3306. {
  3307. Send {SPACE up}
  3308. }
  3309. GetKeyState, stateSH, SHIfT
  3310. If stateSH = D
  3311. {
  3312. Send {SHIfT up}
  3313. }
  3314. ReadClientResolution(hwnd,w,h)
  3315. Send {SPACE}
  3316. Send {NumpadEnter}
  3317. Send {Raw} /oos
  3318. Send {NumpadEnter}
  3319. Send {i}
  3320. ErrorLevel = 1
  3321. Sleep, 50
  3322. ScrollX:= (w/2)
  3323. ScrollY:= (h/2)
  3324. PixElsearch, ScrollX, ScrollY, ScrollX, ScrollY, w, h, 0xFFFFFF, 1, fast ;2b1d35 312238
  3325. If ErrorLevel = 0
  3326. {
  3327. MouseMove, (ScrollX), (ScrollY),0
  3328. If PortalInvCheck() = true
  3329. {
  3330.  
  3331. }
  3332. Else If PortalInvCheck() = false
  3333. {
  3334. ScrollX:= (w/2)
  3335. Loop
  3336. {
  3337. ErrorLevel = 1
  3338. PixElsearch, ScrollX2, ScrollY2, ScrollX, ScrollY, (ScrollX+50), (ScrollY+10), 0xFFFFFF, 1, fast ;0xFBFBFB, 4, fast ;2b1d35 312238
  3339. If ErrorLevel = 0
  3340. {
  3341. MouseMove, (ScrollX2), (ScrollY2),0
  3342. If PortalInvCheck() = true
  3343. Break
  3344. Else If PortalInvCheck() = false
  3345. {
  3346. Send {SPACE}
  3347. MouseMove, (w/2), (h/2), 0
  3348. BlockInput Off
  3349. Return
  3350. }
  3351. }
  3352. Else
  3353. {
  3354. ScrollX:= (ScrollX+50)
  3355. Continue
  3356. }
  3357. }
  3358. }
  3359. }
  3360. Send {RButton}
  3361. Send {SPACE}
  3362. Sleep, 50
  3363. MouseMove, (w/2), (h/2),0
  3364. Sleep, 50
  3365. Send {LButton}
  3366. sleep, 250
  3367. Loop
  3368. {
  3369. ErrorLevel = 1
  3370. PixElsearch, PixX, PixY, (w/4), (h/10), ((w/4)*3), h, 0xddbb30, 34, fast ;0xdcc8c8 text color
  3371. If ErrorLevel = 0
  3372. {
  3373. MouseMove, (PixX), (PixY),0
  3374. Sleep, 20
  3375. Send {LButton}
  3376. Loop ;only search for portals when not moving
  3377. {
  3378. ReadHeroPos(hwnd,PosX1,PosY1)
  3379. sleep, 30
  3380. ReadHeroPos(hwnd,PosX2,PosY2)
  3381. If PosX1 = %PosX2%
  3382. {
  3383. If PosY1 = %PosY2%
  3384. {
  3385. break
  3386. }
  3387.  
  3388. }
  3389. Else
  3390. sleep, 30
  3391. }
  3392. }
  3393. Else
  3394. {
  3395. Break
  3396. }
  3397. }
  3398. Sleep, 50
  3399. MouseMove, (w/2), (h/2),0
  3400. Sleep, 50
  3401. Send {LButton}
  3402. Sleep, 50
  3403. BlockInput Off
  3404. }
  3405. Else
  3406. return
  3407. }
  3408.  
  3409. ; Poe Default Style 0x14CF0000
  3410.  
  3411. Toggle_Window(window)
  3412. {
  3413. global ClientX, ClientY, ClientW, ClientH
  3414. IfWinActive Path of Exile ahk_class POEWindowClass
  3415. {
  3416. WinGet, S, Style, % "ahk_id " window ; Get the style of the window
  3417. If (S & +0x840000) ; If not borderless
  3418. {
  3419. WinGetPos, ClientX, ClientY, ClientW, ClientH
  3420. hwnd:=WinActive("A")
  3421. ReadClientResolution(hwnd,w,h)
  3422.  
  3423. WinSet, Style, -0x840000, % "ahk_id " window ; Remove borders
  3424. WinSet, Style, -0x400000, % "ahk_id " window
  3425.  
  3426. WinMove, % "ahk_id " window,, %ClientX%, %ClientY%, %w%, %h%
  3427. Confine := !Confine
  3428. ClipCursor(Confine, (ClientX), (ClientY), (ClientX+w),(ClientY+h))
  3429. return
  3430. }
  3431. If (S & -0x840000) ; If borderless
  3432. {
  3433. WinSet, Style, +0x840000, % "ahk_id " window ; Reapply borders
  3434. WinSet, Style, +0x400000, % "ahk_id " window
  3435. WinMove, % "ahk_id " window,, %ClientX%, %ClientY%, %ClientW%, %ClientW%
  3436. Confine := !Confine
  3437. ClipCursor(Confine, 0, 0, A_ScreenWidth, A_ScreenHeight)
  3438. return
  3439. }
  3440. }
  3441. }
  3442.  
  3443. ClipCursor( Confine=True, x1=0 , y1=0, x2=1, y2=1 )
  3444. {
  3445. VarSetCapacity(R,16,0), NumPut(x1,&R+0),NumPut(y1,&R+4),NumPut(x2,&R+8),NumPut(y2,&R+12)
  3446. Return Confine ? DllCall( "ClipCursor", UInt,&R ) : DllCall( "ClipCursor" )
  3447. }
  3448.  
  3449. ; Parse clipboard content for item level and dps
  3450. Webgrab()
  3451. {
  3452. global Rarity
  3453. IfWinActive Path of Exile ahk_class POEWindowClass
  3454. {
  3455. SendMode Input
  3456. clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
  3457. ErrorLevel = 0
  3458. Send ^c
  3459. ClipWait, 0.05 ; Wait for the clipboard to contain text.
  3460. If ErrorLevel = 1
  3461. {
  3462. return
  3463. }
  3464. NameIsDone := False
  3465. ItemName :=
  3466.  
  3467. Loop, Parse, Clipboard, `n, `r
  3468. {
  3469. ; Clipboard must have "Rarity:" in the first line
  3470. If A_Index = 1
  3471. {
  3472. IfNotInString, A_LoopField, Rarity:
  3473. {
  3474. Exit
  3475. }
  3476. IfInString, A_LoopField, Rarity: Magic
  3477. {
  3478. Rarity:= 2
  3479. }
  3480. IfInString, A_LoopField, Rarity: Rare
  3481. {
  3482. Rarity:= 3
  3483. }
  3484. Else
  3485. {
  3486. Continue
  3487. }
  3488.  
  3489. }
  3490.  
  3491. ; Get name
  3492. If Not NameIsDone
  3493. {
  3494. If A_LoopField = --------
  3495. {
  3496. NameIsDone := True
  3497. }
  3498. Else
  3499. {
  3500. ItemName%A_Index% = %A_LoopField%
  3501. }
  3502. Continue
  3503. }
  3504.  
  3505. If (Rarity = 2)
  3506. {
  3507. IfInString, ItemName2, Flask
  3508. {
  3509. ItemName2 = Flask
  3510. Run http://pathofexile.gamepedia.com/%ItemName2%
  3511. Rarity:= 0
  3512. return
  3513. }
  3514. Run http://www.poemods.com
  3515. Rarity:= 0
  3516. return
  3517. }
  3518.  
  3519.  
  3520. If (Rarity = 3)
  3521. {
  3522. Run http://www.poemods.com
  3523. Rarity:= 0
  3524. return
  3525. }
  3526. Else
  3527. {
  3528. StringReplace, ItemName2_, ItemName2, %A_SPACE%, _, All
  3529. Run http://pathofexile.gamepedia.com/%ItemName2_%
  3530. Rarity:= 0
  3531. return
  3532. }
  3533. }
  3534. }
  3535. return
  3536. }
  3537.  
  3538.  
  3539. PortalInvCheck()
  3540. {
  3541. IfWinActive Path of Exile ahk_class POEWindowClass
  3542. {
  3543. SendMode Input
  3544. clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
  3545. ErrorLevel = 0
  3546. Send ^c
  3547. ClipWait, 0.05 ; Wait for the clipboard to contain text.
  3548. If ErrorLevel = 1
  3549. {
  3550. return false
  3551. }
  3552.  
  3553. ItemLevel := ""
  3554. Name := ""
  3555. Type := ""
  3556. Quality := 0
  3557. AttackSpeed := 0
  3558. PhysicalDamageLow := 0
  3559. PhysicalDamageHigh := 0
  3560. IncreasedPhysicalDamage := 0
  3561. FireDamageLow := 0
  3562. FireDamageHigh := 0
  3563. ColdDamageLow := 0
  3564. ColdDamageHigh := 0
  3565. LightningDamageLow := 0
  3566. LightningDamageHigh := 0
  3567. ChaosDamageLow := 0
  3568. ChaosDamageHigh := 0
  3569. Armour := 0
  3570. EvasionRating := 0
  3571. EnergyShield := 0
  3572.  
  3573.  
  3574. Loop, parse, Clipboard, `n, `r ; Goes through a loop with the lines of text found in the clipboard
  3575. {
  3576. If (A_Index = 1)
  3577. {
  3578. IfNotInString, A_Loopfield, Rarity: ; Starts a check whether it has "Rarity:" in the first line, otherwise exit
  3579. {
  3580. Exit
  3581. }
  3582. }
  3583. Else If (A_Index = 2)
  3584. {
  3585. Name := A_Loopfield
  3586. }
  3587. Else If (A_Index = 3)
  3588. {
  3589. Type := A_Loopfield
  3590. }
  3591. Else If (!ItemLevel && RegExMatch(A_Loopfield, "Itemlevel: (\d*)", SubPat))
  3592. {
  3593. ItemLevel := SubPat1
  3594. }
  3595. Else If (!Quality && RegExMatch(A_Loopfield, "Quality: \+(\d*)\%", SubPat))
  3596. {
  3597. Quality := SubPat1/100
  3598. }
  3599.  
  3600. Else If (!AttackSpeed && RegExMatch(A_Loopfield, "Attacks per Second: (\d\.\d*)", SubPat))
  3601. {
  3602. AttackSpeed := SubPat1
  3603. }
  3604. Else If (!PhysicalDamageLow && RegExMatch(A_Loopfield, "Physical Damage: (\d*)-(\d*)", SubPat))
  3605. {
  3606. PhysicalDamageLow := SubPat1
  3607. PhysicalDamageHigh := SubPat2
  3608. }
  3609. Else If (!IncreasedPhysicalDamage && RegExMatch(A_Loopfield, "(\d*)\% increased Physical Damage", SubPat))
  3610. {
  3611. IncreasedPhysicalDamage := SubPat1/100
  3612. }
  3613.  
  3614. Else If (!FireDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Fire Damage", SubPat))
  3615. {
  3616. FireDamageLow := SubPat1
  3617. FireDamageHigh := SubPat2
  3618. }
  3619. Else If (!ColdDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Cold Damage", SubPat))
  3620. {
  3621. ColdDamageLow := SubPat1
  3622. ColdDamageHigh := SubPat2
  3623. }
  3624. Else If (!LightningDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Lightning Damage", SubPat))
  3625. {
  3626. LightningDamageLow := SubPat1
  3627. LightningDamageHigh := SubPat2
  3628. }
  3629. Else If (!ChaosDamageLow && RegExMatch(A_Loopfield, "Adds (\d*)-(\d*) Chaos Damage", SubPat))
  3630. {
  3631. ChaosDamageLow := SubPat1
  3632. ChaosDamageHigh := SubPat2
  3633. }
  3634.  
  3635. Else If (!Armour && RegExMatch(A_Loopfield, "Armour: (\d*)", SubPat))
  3636. {
  3637. Armour:= SubPat1
  3638. }
  3639. Else If (!EvasionRating && RegExMatch(A_Loopfield, "Evasion Rating: (\d*)", SubPat))
  3640. {
  3641. EvasionRating:= SubPat1
  3642. }
  3643. Else If (!EnergyShield && RegExMatch(A_Loopfield, "Energy Shield: (\d*)", SubPat))
  3644. {
  3645. EnergyShield:= SubPat1
  3646. }
  3647. }
  3648.  
  3649. If (!ItemLevel) ; If we didn't get the itemlevel...
  3650. {
  3651. Portal := "Portal Scroll"
  3652. If Portal = %name%
  3653. return true
  3654. Else
  3655. return false
  3656. }
  3657. }
  3658. return false
  3659. }
  3660.  
  3661. ;-------TEST FUNCTIONS-----------------TEST FUNCTIONS-----------------TEST FUNCTIONS-----------------
  3662.  
  3663. ;-------GUI UPDATE FUNCTIONS--------------GUI UPDATE FUNCTIONS--------------GUI UPDATE FUNCTIONS-----
  3664.  
  3665. GuiUpdate:
  3666. Gui, Submit, NoHide
  3667.  
  3668. GuiControl, , QuickSilverMovementTimerUpdate, % Round(QuickSilverMovementTimer/10,1)
  3669. GuiControl, , RemoveAilmentsTimerUpdate, % Round(RemoveAilmentsTimer/10,1)
  3670. GuiControl, , RemoveCorruptedBloodChargesUpdate, %RemoveCorruptedBloodCharges%
  3671.  
  3672. If (minLifePercentToQuit=0)
  3673. {
  3674. GuiControl, , minLifePercentToQuitUpdate, N/A
  3675. GuiControl, , minLifePercentToQuitUpdatePercent,
  3676. }
  3677. Else
  3678. {
  3679. GuiControl, , minLifePercentToQuitUpdate, %minLifePercentToQuit%
  3680. GuiControl, , minLifePercentToQuitUpdatePercent, `%
  3681. }
  3682. If (minESPercentToQuit=0)
  3683. {
  3684. GuiControl, , minESPercentToQuitUpdate, N/A
  3685. GuiControl, , minESPercentToQuitUpdatePercent,
  3686. }
  3687. Else
  3688. {
  3689. GuiControl, , minESPercentToQuitUpdate, %minESPercentToQuit%
  3690. GuiControl, , minESPercentToQuitUpdatePercent, `%
  3691. }
  3692. If (maxLifePercentPerHitToQuit=0 || maxLifePercentPerHitToQuit=100)
  3693. {
  3694. GuiControl, , maxLifePercentPerHitToQuitUpdate, N/A
  3695. GuiControl, , maxLifePercentPerHitToQuitUpdatePercent,
  3696. }
  3697. Else
  3698. {
  3699. GuiControl, , maxLifePercentPerHitToQuitUpdate, %maxLifePercentPerHitToQuit%
  3700. GuiControl, , maxLifePercentPerHitToQuitUpdatePercent, `%
  3701. }
  3702. If (maxESPercentPerHitToQuit=0)
  3703. {
  3704. GuiControl, , maxESPercentPerHitToQuitUpdate, N/A
  3705. GuiControl, , maxESPercentPerHitToQuitUpdatePercent,
  3706. }
  3707. Else
  3708. {
  3709. GuiControl, , maxESPercentPerHitToQuitUpdate, %maxESPercentPerHitToQuit%
  3710. GuiControl, , maxESPercentPerHitToQuitUpdatePercent, `%
  3711. }
  3712. If (minLifePercentToJade=0)
  3713. {
  3714. GuiControl, , minLifePercentToJadeUpdate, N/A
  3715. GuiControl, , minLifePercentToJadeUpdatePercent,
  3716. }
  3717. Else
  3718. {
  3719. GuiControl, , minLifePercentToJadeUpdate, %minLifePercentToJade%
  3720. GuiControl, , minLifePercentToJadeUpdatePercent, `%
  3721. }
  3722. If (minESPercentToJade=0)
  3723. {
  3724. GuiControl, , minESPercentToJadeUpdate, N/A
  3725. GuiControl, , minESPercentToJadeUpdatePercent,
  3726. }
  3727. Else
  3728. {
  3729. GuiControl, , minESPercentToJadeUpdate, %minESPercentToJade%
  3730. GuiControl, , minESPercentToJadeUpdatePercent, `%
  3731. }
  3732. If (minLifePercentToElementalResist=0)
  3733. {
  3734. GuiControl, , minLifePercentToElementalResistUpdate, N/A
  3735. GuiControl, , minLifePercentToElementalResistUpdatePercent,
  3736. }
  3737. Else
  3738. {
  3739. GuiControl, , minLifePercentToElementalResistUpdate, %minLifePercentToElementalResist%
  3740. GuiControl, , minLifePercentToElementalResistUpdatePercent, `%
  3741. }
  3742. If (minESPercentToElementalResist=0)
  3743. {
  3744. GuiControl, , minESPercentToElementalResistUpdate, N/A
  3745. GuiControl, , minESPercentToElementalResistUpdatePercent,
  3746. }
  3747. Else
  3748. {
  3749. GuiControl, , minESPercentToElementalResistUpdate, %minESPercentToElementalResist%
  3750. GuiControl, , minESPercentToElementalResistUpdatePercent, `%
  3751. }
  3752. If (minLifePercentToDrink=0)
  3753. {
  3754. GuiControl, , minLifePercentToDrinkUpdate, N/A
  3755. GuiControl, , minLifePercentToDrinkUpdatePercent,
  3756. }
  3757. Else
  3758. {
  3759. GuiControl, , minLifePercentToDrinkUpdate, %minLifePercentToDrink%
  3760. GuiControl, , minLifePercentToDrinkUpdatePercent, `%
  3761. }
  3762. If (minManaPercentToDrink=0)
  3763. {
  3764. GuiControl, , minManaPercentToDrinkUpdate, N/A
  3765. GuiControl, , minManaPercentToDrinkUpdatePercent,
  3766. }
  3767. Else
  3768. {
  3769. GuiControl, , minManaPercentToDrinkUpdate, %minManaPercentToDrink%
  3770. GuiControl, , minManaPercentToDrinkUpdatePercent, `%
  3771. }
  3772. If (minManaToDrinkPot=0)
  3773. {
  3774. GuiControl, , minManaToDrinkPotUpdate, N/A
  3775. }
  3776. Else
  3777. {
  3778. GuiControl, , minManaToDrinkPotUpdate, %minManaToDrinkPot%
  3779. }
  3780. If (InstantFlaskDelay=0)
  3781. {
  3782. GuiControl, , InstantFlaskDelayUpdate, N/A
  3783. GuiControl, , InstantFlaskDelayUpdatePercent,
  3784. }
  3785. Else
  3786. {
  3787. GuiControl, , InstantFlaskDelayUpdate, % Round(InstantFlaskDelay/100,2)
  3788. GuiControl, , InstantFlaskDelayUpdatePercent, s
  3789.  
  3790. }
  3791. If (minLifePercentToSpam=0)
  3792. {
  3793. GuiControl, , minLifePercentToSpamUpdate, N/A
  3794. GuiControl, , minLifePercentToSpamUpdatePercent,
  3795. }
  3796. Else
  3797. {
  3798. GuiControl, , minLifePercentToSpamUpdate, %minLifePercentToSpam%
  3799. GuiControl, , minLifePercentToSpamUpdatePercent, `%
  3800. }
  3801. If (TradeSpam=0)
  3802. {
  3803. GuiControl, , TradeSpamUpdate, N/A
  3804. GuiControl, , TradeSpamUpdatePercent,
  3805. }
  3806. Else
  3807. {
  3808. GuiControl, , TradeSpamUpdate, %TradeSpam%
  3809. GuiControl, , TradeSpamUpdatePercent, m
  3810. }
  3811. If (ResyncSpam=0)
  3812. {
  3813. GuiControl, , ResyncSpamUpdate, N/A
  3814. GuiControl, , ResyncSpamUpdatePercent,
  3815. }
  3816. Else
  3817. {
  3818. GuiControl, , ResyncSpamUpdate, %ResyncSpam%
  3819. GuiControl, , ResyncSpamUpdatePercent, s
  3820. }
  3821. If (RemainingSpam=0)
  3822. {
  3823. GuiControl, , RemainingSpamUpdate, N/A
  3824. GuiControl, , RemainingSpamUpdatePercent,
  3825. }
  3826. Else
  3827. {
  3828. GuiControl, , RemainingSpamUpdate, %RemainingSpam%
  3829. GuiControl, , RemainingSpamUpdatePercent, s
  3830. }
  3831.  
  3832. Loop, 5
  3833. {
  3834. If ConfigChoice = %A_Index%
  3835. {
  3836. IniWrite, %minLifePercentToQuit% , Config.ini, Config%A_Index%, minLifePercentToQuit
  3837. IniWrite, %minESPercentToQuit% , Config.ini, Config%A_Index%, minESPercentToQuit
  3838. IniWrite, %maxLifePercentPerHitToQuit% , Config.ini, Config%A_Index%, maxLifePercentPerHitToQuit
  3839. IniWrite, %maxESPercentPerHitToQuit% , Config.ini, Config%A_Index%, maxESPercentPerHitToQuit
  3840. IniWrite, %minLifePercentToJade% , Config.ini, Config%A_Index%, minLifePercentToJade
  3841. IniWrite, %minESPercentToJade% , Config.ini, Config%A_Index%, minESPercentToJade
  3842. IniWrite, %minLifePercentToElementalResist% , Config.ini, Config%A_Index%, minLifePercentToElementalResist
  3843. IniWrite, %minESPercentToElementalResist% , Config.ini, Config%A_Index%, minESPercentToElementalResist
  3844. IniWrite, %minLifePercentToDrink% , Config.ini, Config%A_Index%, minLifePercentToDrink
  3845. IniWrite, %minManaPercentToDrink% , Config.ini, Config%A_Index%, minManaPercentToDrink
  3846. IniWrite, %minManaToDrinkPot% , Config.ini, Config%A_Index%, minManaToDrinkPot
  3847. IniWrite, %minLifePercentToSpam% , Config.ini, Config%A_Index%, minLifePercentToSpam
  3848. IniWrite, %InstantFlaskDelay% , Config.ini, Config%A_Index%, InstantFlaskDelay
  3849. IniWrite, %QuickSilverMovementTimer% , Config.ini, Config%A_Index%, QuickSilverMovementTimer
  3850. IniWrite, %RemoveAilmentsTimer% , Config.ini, Config%A_Index%, RemoveAilmentsTimer
  3851. IniWrite, %ResyncSpam% , Config.ini, Config%A_Index%, ResyncSpam
  3852. IniWrite, %RemainingSpam% , Config.ini, Config%A_Index%, RemainingSpam
  3853. IniWrite, %RemoveCorruptedBloodCharges% , Config.ini, Config%A_Index%, RemoveCorruptedBloodCharges
  3854. }
  3855. }
  3856.  
  3857.  
  3858. IniWrite, %InstantFlaskDelay% , Config.ini, Config, InstantFlaskDelay
  3859. IfDelay:= InstantFlaskDelay
  3860.  
  3861. PlayerConfig["Default"]:={RemCorruptedBloodCharges:RemoveCorruptedBloodCharges,RemAilmentsTimer:RemoveAilmentsTimer,QuickSilverTimer:QuickSilverMovementTimer*100, minLifeRatioToInstant: minLifePercentToSpam/100, IflaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopElementalResist: minLifePercentToElementalResist/100,minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100,maxLifeRatioPerHitToQuit: maxLifePercentPerHitToQuit/100,maxEShieldRatioPerHitToQuit: maxESPercentPerHitToQuit/100,minEShieldRatioToQuit: minESPercentToQuit/100, minEShieldRatioToPopElementalResist: minESPercentToElementalResist/100, minEShieldRatioToPopJade: minESPercentToJade/100}
  3862.  
  3863.  
  3864. return
  3865.  
  3866. ExitSub:
  3867. If A_ExitReason not in Logoff,Shutdown ; Avoid spaces around the comma in this line.
  3868. {
  3869. IniWrite, %TabChoice%, Config.ini, Config, LastTab
  3870. }
  3871. ExitApp
  3872.  
  3873. TabFunc:
  3874. Gui, Submit, NoHide
  3875. return
  3876.  
  3877. Default:
  3878. Gui, Submit, NoHide
  3879.  
  3880. Loop, 5
  3881. {
  3882. If ConfigChoice = %A_Index%
  3883. {
  3884. IniDelete, Config.ini, Config%A_Index%
  3885. }
  3886. }
  3887.  
  3888. Reload
  3889. Sleep, 2000
  3890. MsgBox,0,, An error ocurred, reloading script.
  3891. ExitApp
  3892.  
  3893. DefaultHotkeys:
  3894. Gui, Submit, NoHide
  3895.  
  3896. IniDelete, Config.ini, Hotkeys
  3897.  
  3898.  
  3899. Reload
  3900. Sleep, 2000
  3901. MsgBox,0,, An error ocurred, reloading script.
  3902. ExitApp
  3903.  
  3904.  
  3905. AutoQuitList:
  3906. Gui, Submit, NoHide
  3907. If AutoQuitChoice = 1
  3908. autoQuitMode:=1
  3909. If AutoQuitChoice = 2
  3910. autoQuitMode:=0
  3911. If AutoQuitChoice = 3
  3912. autoQuitMode:=3
  3913. If AutoQuitChoice = 4
  3914. autoQuitMode:=4
  3915.  
  3916. IniWrite, %AutoQuitChoice% , Config.ini, Config, AutoQuitMethod
  3917. return
  3918.  
  3919. ClientServerList:
  3920. Gui, Submit, NoHide
  3921. If ClientServerChoice = 1
  3922. ClientServerMode:=1
  3923. If ClientServerChoice = 2
  3924. ClientServerMode:=2
  3925. If ClientServerChoice = 3
  3926. ClientServerMode:=3
  3927. If ClientServerChoice = 4
  3928. ClientServerMode:=4
  3929.  
  3930. IniWrite, %ClientServerChoice% , Config.ini, Config, ClientServer
  3931. reload
  3932.  
  3933. ConfigList:
  3934. Gui, Submit, NoHide
  3935.  
  3936.  
  3937. Loop, 5
  3938. {
  3939. If ConfigChoice = %A_Index%
  3940. {
  3941. IniRead, minLifePercentToQuit , Config.ini, Config%A_Index%, minLifePercentToQuit, 35
  3942. IniRead, minESPercentToQuit , Config.ini, Config%A_Index%, minESPercentToQuit, 0
  3943. IniRead, maxLifePercentPerHitToQuit , Config.ini, Config%A_Index%, maxLifePercentPerHitToQuit, 50
  3944. IniRead, maxESPercentPerHitToQuit , Config.ini, Config%A_Index%, maxESPercentPerHitToQuit, 0
  3945. IniRead, minLifePercentToJade , Config.ini, Config%A_Index%, minLifePercentToJade, 70
  3946. IniRead, minLifePercentToJade , Config.ini, Config%A_Index%, minLifePercentToJade, 70
  3947. IniRead, minESPercentToJade , Config.ini, Config%A_Index%, minESPercentToJade, 0
  3948. IniRead, minLifePercentToElementalResist , Config.ini, Config%A_Index%, minLifePercentToElementalResist, 70
  3949. IniRead, minESPercentToElementalResist , Config.ini, Config%A_Index%, minESPercentToElementalResist, 0
  3950. IniRead, minLifePercentToDrink , Config.ini, Config%A_Index%, minLifePercentToDrink, 55
  3951. IniRead, minManaPercentToDrink , Config.ini, Config%A_Index%, minManaPercentToDrink, 25
  3952. IniRead, minManaToDrinkPot , Config.ini, Config%A_Index%, minManaToDrinkPot, 15
  3953. IniRead, minLifePercentToSpam, Config.ini, Config%A_Index%, minLifePercentToSpam, 35
  3954. IniRead, ResyncSpam, Config.ini, Config%A_Index%, ResyncSpam, 0
  3955. IniRead, RemainingSpam, Config.ini, Config%A_Index%, RemainingSpam, 0
  3956. IniRead, InstantFlaskDelay, Config.ini, Config%A_Index%, InstantFlaskDelay, 0
  3957. IniRead, QuickSilverMovementTimer , Config.ini, Config%A_Index%, QuickSilverMovementTimer, 15
  3958. IniRead, RemoveAilmentsTimer , Config.ini, Config%A_Index%, RemoveAilmentsTimer, 10
  3959. IniRead, RemoveCorruptedBloodCharges, Config.ini, Config%A_Index%, RemoveCorruptedBloodCharges, 10
  3960. IniWrite, %A_Index%, Config.ini, Config, ConfigNumber
  3961. }
  3962. }
  3963.  
  3964.  
  3965. GuiControl, , minLifePercentToQuit, %minLifePercentToQuit%
  3966. GuiControl, , maxLifePercentPerHitToQuit, %maxLifePercentPerHitToQuit%
  3967. GuiControl, , maxESPercentPerHitToQuit, %maxESPercentPerHitToQuit%
  3968. GuiControl, , minESPercentToQuit, %minESPercentToQuit%
  3969. GuiControl, , minLifePercentToJade, %minLifePercentToJade%
  3970. GuiControl, , minESPercentToJade, %minESPercentToJade%
  3971. GuiControl, , minLifePercentToElementalResist, %minLifePercentToElementalResist%
  3972. GuiControl, , minESPercentToElementalResist, %minESPercentToElementalResist%
  3973. GuiControl, , minLifePercentToDrink, %minLifePercentToDrink%
  3974. GuiControl, , minManaPercentToDrink, %minManaPercentToDrink%
  3975. GuiControl, , minManaToDrinkPot, %minManaToDrinkPot%
  3976. GuiControl, , minLifePercentToSpam, %minLifePercentToSpam%
  3977. GuiControl, , ResyncSpam, %ResyncSpam%
  3978. GuiControl, , RemainingSpam, %RemainingSpam%
  3979. GuiControl, , InstantFlaskDelay, %InstantFlaskDelay%
  3980. GuiControl, , QuickSilverMovementTimer, %QuickSilverMovementTimer%
  3981. GuiControl, , RemoveAilmentsTimer, %RemoveAilmentsTimer%
  3982. GuiControl, , RemoveCorruptedBloodCharges, %RemoveCorruptedBloodCharges%
  3983.  
  3984.  
  3985. GuiControl, , QuickSilverMovementTimerUpdate, % Round(QuickSilverMovementTimer/10,1)
  3986. GuiControl, , RemoveAilmentsTimerUpdate, % Round(RemoveAilmentsTimer/10,1)
  3987. GuiControl, , RemoveCorruptedBloodChargesUpdate, %RemoveCorruptedBloodCharges%
  3988.  
  3989. If (minLifePercentToQuit=0)
  3990. {
  3991. GuiControl, , minLifePercentToQuitUpdate, N/A
  3992. GuiControl, , minLifePercentToQuitUpdatePercent,
  3993. }
  3994. Else
  3995. {
  3996. GuiControl, , minLifePercentToQuitUpdate, %minLifePercentToQuit%
  3997. GuiControl, , minLifePercentToQuitUpdatePercent, `%
  3998. }
  3999. If (minESPercentToQuit=0)
  4000. {
  4001. GuiControl, , minESPercentToQuitUpdate, N/A
  4002. GuiControl, , minESPercentToQuitUpdatePercent,
  4003. }
  4004. Else
  4005. {
  4006. GuiControl, , minESPercentToQuitUpdate, %minESPercentToQuit%
  4007. GuiControl, , minESPercentToQuitUpdatePercent, `%
  4008. }
  4009. If (maxLifePercentPerHitToQuit=0 || maxLifePercentPerHitToQuit=100)
  4010. {
  4011. GuiControl, , maxLifePercentPerHitToQuitUpdate, N/A
  4012. GuiControl, , maxLifePercentPerHitToQuitUpdatePercent,
  4013. }
  4014. Else
  4015. {
  4016. GuiControl, , maxLifePercentPerHitToQuitUpdate, %maxLifePercentPerHitToQuit%
  4017. GuiControl, , maxLifePercentPerHitToQuitUpdatePercent, `%
  4018. }
  4019. If (maxESPercentPerHitToQuit=0)
  4020. {
  4021. GuiControl, , maxESPercentPerHitToQuitUpdate, N/A
  4022. GuiControl, , maxESPercentPerHitToQuitUpdatePercent,
  4023. }
  4024. Else
  4025. {
  4026. GuiControl, , maxESPercentPerHitToQuitUpdate, %maxESPercentPerHitToQuit%
  4027. GuiControl, , maxESPercentPerHitToQuitUpdatePercent, `%
  4028. }
  4029. If (minLifePercentToJade=0)
  4030. {
  4031. GuiControl, , minLifePercentToJadeUpdate, N/A
  4032. GuiControl, , minLifePercentToJadeUpdatePercent,
  4033. }
  4034. Else
  4035. {
  4036. GuiControl, , minLifePercentToJadeUpdate, %minLifePercentToJade%
  4037. GuiControl, , minLifePercentToJadeUpdatePercent, `%
  4038. }
  4039. If (minESPercentToJade=0)
  4040. {
  4041. GuiControl, , minESPercentToJadeUpdate, N/A
  4042. GuiControl, , minESPercentToJadeUpdatePercent,
  4043. }
  4044. Else
  4045. {
  4046. GuiControl, , minESPercentToJadeUpdate, %minESPercentToJade%
  4047. GuiControl, , minESPercentToJadeUpdatePercent, `%
  4048. }
  4049. If (minLifePercentToElementalResist=0)
  4050. {
  4051. GuiControl, , minLifePercentToElementalResistUpdate, N/A
  4052. GuiControl, , minLifePercentToElementalResistUpdatePercent,
  4053. }
  4054. Else
  4055. {
  4056. GuiControl, , minLifePercentToElementalResistUpdate, %minLifePercentToElementalResist%
  4057. GuiControl, , minLifePercentToElementalResistUpdatePercent, `%
  4058. }
  4059. If (minESPercentToElementalResist=0)
  4060. {
  4061. GuiControl, , minESPercentToElementalResistUpdate, N/A
  4062. GuiControl, , minESPercentToElementalResistUpdatePercent,
  4063. }
  4064. Else
  4065. {
  4066. GuiControl, , minESPercentToElementalResistUpdate, %minESPercentToElementalResist%
  4067. GuiControl, , minESPercentToElementalResistUpdatePercent, `%
  4068. }
  4069. If (minLifePercentToDrink=0)
  4070. {
  4071. GuiControl, , minLifePercentToDrinkUpdate, N/A
  4072. GuiControl, , minLifePercentToDrinkUpdatePercent,
  4073. }
  4074. Else
  4075. {
  4076. GuiControl, , minLifePercentToDrinkUpdate, %minLifePercentToDrink%
  4077. GuiControl, , minLifePercentToDrinkUpdatePercent, `%
  4078. }
  4079. If (minManaPercentToDrink=0)
  4080. {
  4081. GuiControl, , minManaPercentToDrinkUpdate, N/A
  4082. GuiControl, , minManaPercentToDrinkUpdatePercent,
  4083. }
  4084. Else
  4085. {
  4086. GuiControl, , minManaPercentToDrinkUpdate, %minManaPercentToDrink%
  4087. GuiControl, , minManaPercentToDrinkUpdatePercent, `%
  4088. }
  4089. If (minManaToDrinkPot=0)
  4090. {
  4091. GuiControl, , minManaToDrinkPotUpdate, N/A
  4092. }
  4093. Else
  4094. {
  4095. GuiControl, , minManaToDrinkPotUpdate, %minManaToDrinkPot%
  4096. }
  4097. If (InstantFlaskDelay=0)
  4098. {
  4099. GuiControl, , InstantFlaskDelayUpdate, N/A
  4100. GuiControl, , InstantFlaskDelayUpdatePercent,
  4101. }
  4102. Else
  4103. {
  4104. GuiControl, , InstantFlaskDelayUpdate, % Round(InstantFlaskDelay/100,2)
  4105. GuiControl, , InstantFlaskDelayUpdatePercent, s
  4106.  
  4107. }
  4108. If (minLifePercentToSpam=0)
  4109. {
  4110. GuiControl, , minLifePercentToSpamUpdate, N/A
  4111. GuiControl, , minLifePercentToSpamUpdatePercent,
  4112. }
  4113. Else
  4114. {
  4115. GuiControl, , minLifePercentToSpamUpdate, %minLifePercentToSpam%
  4116. GuiControl, , minLifePercentToSpamUpdatePercent, `%
  4117. }
  4118. If (TradeSpam=0)
  4119. {
  4120. GuiControl, , TradeSpamUpdate, N/A
  4121. GuiControl, , TradeSpamUpdatePercent,
  4122. }
  4123. Else
  4124. {
  4125. GuiControl, , TradeSpamUpdate, %TradeSpam%
  4126. GuiControl, , TradeSpamUpdatePercent, m
  4127. }
  4128. If (ResyncSpam=0)
  4129. {
  4130. GuiControl, , ResyncSpamUpdate, N/A
  4131. GuiControl, , ResyncSpamUpdatePercent,
  4132. }
  4133. Else
  4134. {
  4135. GuiControl, , ResyncSpamUpdate, %ResyncSpam%
  4136. GuiControl, , ResyncSpamUpdatePercent, s
  4137. }
  4138. If (RemainingSpam=0)
  4139. {
  4140. GuiControl, , RemainingSpamUpdate, N/A
  4141. GuiControl, , RemainingSpamUpdatePercent,
  4142. }
  4143. Else
  4144. {
  4145. GuiControl, , RemainingSpamUpdate, %RemainingSpam%
  4146. GuiControl, , RemainingSpamUpdatePercent, s
  4147. }
  4148.  
  4149. PlayerConfig["Default"]:={RemCorruptedBloodCharges:RemoveCorruptedBloodCharges,RemAilmentsTimer:RemoveAilmentsTimer,QuickSilverTimer:QuickSilverMovementTimer*100, minLifeRatioToInstant: minLifePercentToSpam/100, IflaskDelay: InstantFlaskDelay,minLifeRatioToDrink: minLifePercentToDrink/100, minManaRatioToDrink: minManaPercentToDrink/100, minManaToDrink: minManaToDrinkPot, minLifeRatioToPopElementalResist: minLifePercentToElementalResist/100,minLifeRatioToPopJade: minLifePercentToJade/100, minLifeRatioToQuit: minLifePercentToQuit/100,maxLifeRatioPerHitToQuit: maxLifePercentPerHitToQuit/100,maxEShieldRatioPerHitToQuit: maxESPercentPerHitToQuit/100,minEShieldRatioToQuit: minESPercentToQuit/100, minEShieldRatioToPopElementalResist: minESPercentToElementalResist/100, minEShieldRatioToPopJade: minESPercentToJade/100}
  4150.  
  4151. return
  4152.  
  4153. TrayNotIficationsCheck:
  4154. Gui, Submit, NoHide
  4155. If TrayCheckBox = 0
  4156. {
  4157. TrayNotIficationsCheck = 0
  4158. trayNotIfications:=true
  4159. }
  4160. If TrayCheckBox = 1
  4161. {
  4162. TrayNotIficationsCheck = 1
  4163. trayNotIfications:=false
  4164. }
  4165. IniWrite, %TrayNotIficationsCheck% , Config.ini, Config, TrayNotIficationsCheck
  4166. return
  4167.  
  4168. QuickSilverCheck:
  4169. Gui, Submit, NoHide
  4170. If QuickSilverCheckBox = 0
  4171. {
  4172. QuickSilverCheck = 0
  4173. IniWrite, 0 , Config.ini, Config, QuickSilverCheck
  4174. }
  4175. If QuickSilverCheckBox = 1
  4176. {
  4177. QuickSilverCheck = 1
  4178. IniWrite, 1 , Config.ini, Config, QuickSilverCheck
  4179. }
  4180. IniWrite, %QuickSilverCheck% , Config.ini, Config, QuickSilverCheck
  4181. return
  4182.  
  4183. QuickSilverCheck2:
  4184. Gui, Submit, NoHide
  4185. If QuickSilverCheckBox2 = 0
  4186. {
  4187. QuickSilverCheck2 = 0
  4188. IniWrite, 0 , Config.ini, Config, QuickSilverCheck2
  4189. }
  4190. If QuickSilverCheckBox2 = 1
  4191. {
  4192. QuickSilverCheck2 = 1
  4193. IniWrite, 1 , Config.ini, Config, QuickSilverCheck2
  4194. }
  4195. IniWrite, %QuickSilverCheck2% , Config.ini, Config, QuickSilverCheck2
  4196. return
  4197.  
  4198. FlaskOnFrozenCheck:
  4199. Gui, Submit, NoHide
  4200. If FlaskOnFrozenCheckBox = 0
  4201. {
  4202. FlaskOnFrozenCheck = 0
  4203. IniWrite, 0 , Config.ini, Config, FlaskOnFrozenCheck
  4204. }
  4205. If FlaskOnFrozenCheckBox = 1
  4206. {
  4207. FlaskOnFrozenCheck = 1
  4208. IniWrite, 1 , Config.ini, Config, FlaskOnFrozenCheck
  4209. }
  4210. IniWrite, %FlaskOnFrozenCheck% , Config.ini, Config, FlaskOnFrozenCheck
  4211. return
  4212.  
  4213. FlaskOnShockedCheck:
  4214. Gui, Submit, NoHide
  4215. If FlaskOnShockedCheckBox = 0
  4216. {
  4217. FlaskOnShockedCheck = 0
  4218. IniWrite, 0 , Config.ini, Config, FlaskOnShockedCheck
  4219. }
  4220. If FlaskOnShockedCheckBox = 1
  4221. {
  4222. FlaskOnShockedCheck = 1
  4223. IniWrite, 1 , Config.ini, Config, FlaskOnShockedCheck
  4224. }
  4225. IniWrite, %FlaskOnShockedCheck% , Config.ini, Config, FlaskOnShockedCheck
  4226. return
  4227.  
  4228. FlaskOnIgnitedCheck:
  4229. Gui, Submit, NoHide
  4230. If FlaskOnIgnitedCheckBox = 0
  4231. {
  4232. FlaskOnIgnitedCheck = 0
  4233. IniWrite, 0 , Config.ini, Config, FlaskOnIgnitedCheck
  4234. }
  4235. If FlaskOnIgnitedCheckBox = 1
  4236. {
  4237. FlaskOnIgnitedCheck = 1
  4238. IniWrite, 1 , Config.ini, Config, FlaskOnIgnitedCheck
  4239. }
  4240. IniWrite, %FlaskOnIgnitedCheck% , Config.ini, Config, FlaskOnIgnitedCheck
  4241. return
  4242.  
  4243. FlaskOnCurseCheck:
  4244. Gui, Submit, NoHide
  4245. If FlaskOnCurseCheckBox = 0
  4246. {
  4247. FlaskOnCurseCheck = 0
  4248. IniWrite, 0 , Config.ini, Config, FlaskOnCurseCheck
  4249. }
  4250. If FlaskOnCurseCheckBox = 1
  4251. {
  4252. FlaskOnCurseCheck = 1
  4253. IniWrite, 1 , Config.ini, Config, FlaskOnCurseCheck
  4254. }
  4255. IniWrite, %FlaskOnCurseCheck% , Config.ini, Config, FlaskOnCurseCheck
  4256. return
  4257.  
  4258. FlaskOnCorruptedBloodCheck:
  4259. Gui, Submit, NoHide
  4260. If FlaskOnCorruptedBloodCheckBox = 0
  4261. {
  4262. FlaskOnCorruptedBloodCheck = 0
  4263. IniWrite, 0 , Config.ini, Config, FlaskOnCorruptedBloodCheck
  4264. }
  4265. If FlaskOnCorruptedBloodCheckBox = 1
  4266. {
  4267. FlaskOnCorruptedBloodCheck = 1
  4268. IniWrite, 1 , Config.ini, Config, FlaskOnCorruptedBloodCheck
  4269. }
  4270. IniWrite, %FlaskOnCorruptedBloodCheck% , Config.ini, Config, FlaskOnCorruptedBloodCheck
  4271. return
  4272.  
  4273. AttackInPlaceCheck:
  4274. Gui, Submit, NoHide
  4275. If AttackInPlaceCheckBox = 0
  4276. {
  4277. AttackInPlaceCheck = 0
  4278. IniWrite, 0 , Config.ini, Config, AttackInPlaceCheck
  4279. }
  4280. If AttackInPlaceCheckBox = 1
  4281. {
  4282. AttackInPlaceCheck = 1
  4283. IniWrite, 1 , Config.ini, Config, AttackInPlaceCheck
  4284. }
  4285. IniWrite, %AttackInPlaceCheck% , Config.ini, Config, AttackInPlaceCheck
  4286. return
  4287.  
  4288. HoldCtrlCheck:
  4289. Gui, Submit, NoHide
  4290. If HoldCtrlCheckBox = 0
  4291. {
  4292. HoldCtrlCheck = 0
  4293. IniWrite, 0 , Config.ini, Config, HoldCtrlCheck
  4294. }
  4295. If HoldCtrlCheckBox = 1
  4296. {
  4297. HoldCtrlCheck = 1
  4298. IniWrite, 1 , Config.ini, Config, HoldCtrlCheck
  4299. }
  4300. IniWrite, %HoldCtrlCheck% , Config.ini, Config, HoldCtrlCheck
  4301. return
  4302.  
  4303.  
  4304. DPSCheck:
  4305. Gui, Submit, NoHide
  4306. If DPSCheckBox = 0
  4307. {
  4308. IniWrite, 0 , Config.ini, Config, DPSCheck
  4309. }
  4310. If DPSCheckBox = 1
  4311. {
  4312. IniWrite, 1 , Config.ini, Config, DPSCheck
  4313. }
  4314. Return
  4315.  
  4316. showgui:
  4317. Gui, Show, x760 y198 h665 w474
  4318. Return
  4319.  
  4320. showgui2:
  4321.  
  4322. Gui, 2:Show,,Hotkeys
  4323.  
  4324. ; Set GUI State
  4325. LoadSettings()
  4326.  
  4327. ; Enable defined hotkeys
  4328. EnableHotkeys()
  4329. Return
  4330.  
  4331. showgui4:
  4332.  
  4333. Gui, 4:Show,,Debug Window
  4334.  
  4335. Return
  4336.  
  4337. DisableSlot:
  4338. Gui, Submit, NoHide
  4339. Loop, 5
  4340. {
  4341. If DisableSlot%A_Index% = 0
  4342. {
  4343. IniWrite, 0 , Config.ini, DisableSlot, DisableSlot%A_Index%
  4344. }
  4345. Else If DisableSlot%A_Index% = 1
  4346. {
  4347. IniWrite, 1 , Config.ini, DisableSlot, DisableSlot%A_Index%
  4348. }
  4349. }
  4350. return
  4351.  
  4352. ReadMe:
  4353. MsgBox, ------------------------------HOTKEYS------------------------------`n`n[F1] --- Use Resync Command`n[F2] --- Use Remaining Command`n[F3] --- Over an Item for DPSCalc`n[Ctrl+F3] --- Over an Item for More info on the Internet`n[F4] --- Test Exit to Log In Screen`n[Ctrl+F4] -- Test Use Portal`n[F10] -- Send Last Chat Message to Trade Channels 1-10`n[Alt + W] - Change Window to Bordeless, and locks mouse on window.`n[MIDDLE MOUSE] - Send Hideout command.`n`n------------------------------CREDITS------------------------------`n`n Base Script Created by Wrongusername.`n`n GUI and 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`nThe link has been coppied to the clipboard.
  4354. clipboard = http://www.ownedcore.com/forums/mmo/path-of-exile/poe-bots-programs/451206-poe-autoflask-autoscript-improvements-updates.html
  4355. return
  4356.  
  4357. Donate:
  4358. Run "https://donate.doctorswithoutborders.org/onetime.cfm"
  4359. return
  4360.  
  4361. GuiClose:
  4362. Gui, Submit
  4363. If (trayNotIfications)
  4364. {
  4365. TrayTip, Script is Still Running in the Background, %A_Space% , 2
  4366. }
  4367. return
  4368.  
  4369.  
  4370.  
  4371. ;-------GUI UPDATE FUNCTIONS--------------GUI UPDATE FUNCTIONS--------------GUI UPDATE FUNCTIONS-----
  4372.  
  4373. ;-------HOTKEYS-----------------HOTKEYS-----------------HOTKEYS-----------------HOTKEYS--------------
  4374. ; Test that bound hotkeys work
  4375. ;These labels may contain any commands for their respective hotkeys to perform.
  4376. DoHotkey1:
  4377. desync:=1
  4378. return
  4379.  
  4380. DoHotkey2:
  4381. remaining:=1
  4382. return
  4383.  
  4384. DoHotkey3:
  4385. DPSCalc()
  4386. return
  4387.  
  4388. DoHotkey4:
  4389. Webgrab()
  4390. return
  4391.  
  4392. DoHotkey5:
  4393.  
  4394. If (autoQuitMode=0)
  4395. {
  4396. QuitToLoginScreen(WinActive("A"))
  4397. }
  4398. Else If (autoQuitMode=1)
  4399. {
  4400. run, cports.exe /close * * * * PathofExile.exe
  4401. }
  4402. Else If (autoQuitMode=3)
  4403. {
  4404. WinActivate Path of Exile ahk_class POEWindowClass
  4405. IfWinActive Path of Exile ahk_class POEWindowClass
  4406. {
  4407. SendInput {ALT Down}
  4408. SendInput {F4}
  4409. SendInput {ALT Up}
  4410. }
  4411. }
  4412. Else If (autoQuitMode=4)
  4413. {
  4414. run, cports.exe /close * * * * PathofExile.exe
  4415. }
  4416. return
  4417.  
  4418. DoHotkey6:
  4419. UsePortal()
  4420. return
  4421.  
  4422. DoHotkey7:
  4423. tradechat:=1
  4424. return
  4425.  
  4426. DoHotkey8:
  4427. WinGet, window, ID, A ; Use the ID of the active window.
  4428. Toggle_Window(window)
  4429. return
  4430.  
  4431. DoHotkey9:
  4432. hideout:=1
  4433. return
  4434.  
  4435. ;-------HOTKEYS-----------------HOTKEYS-----------------HOTKEYS-----------------HOTKEYS--------------
  4436.  
  4437. ; Something changed - rebuild
  4438. OptionChanged:
  4439. OptionChanged()
  4440. return
  4441.  
  4442. OptionChanged()
  4443. {
  4444. global HotkeyList
  4445.  
  4446. Gui, 2:Submit, NoHide
  4447. ; Disable Hotkeys
  4448. DisableHotkeys()
  4449.  
  4450. Loop % HotkeyList.MaxIndex(){
  4451. ;HotkeyList[A_Index].block := Block%A_Index%
  4452. HotkeyList[A_Index].wild := Wild%A_Index%
  4453. }
  4454.  
  4455. EnableHotkeys()
  4456.  
  4457. SaveSettings()
  4458. }
  4459.  
  4460. ; Detects a pressed key combination
  4461. Bind:
  4462. Gui, 2:Submit, NoHide
  4463. Bind(substr(A_GuiControl,5))
  4464. return
  4465.  
  4466. Bind(ctrlnum)
  4467. {
  4468. global HKModIfierState
  4469. global BindMode
  4470. global EXTRA_KEY_LIST
  4471. global HKControlType
  4472. global HKSecondaryInput
  4473. global HKLastHotkey
  4474.  
  4475. global HotkeyList
  4476.  
  4477. ; init vars
  4478. HKControlType := 0
  4479. HKModIfierState := {ctrl: 0, alt: 0, shIft: 0, win: 0}
  4480.  
  4481. ; Disable existing hotkeys
  4482. DisableHotkeys()
  4483.  
  4484. ; Enable Joystick detection hotkeys
  4485. JoystickDetection(1)
  4486.  
  4487. ; Start Bind Mode - this starts detection for mouse buttons and modIfier keys
  4488. BindMode := 1
  4489.  
  4490. ; Show the prompt
  4491. prompt := "Please press the desired key combination.`n`n"
  4492. prompt .= "Supports most keyboard keys and all mouse buttons. Also Ctrl, Alt, ShIft, Win as modIfiers or individual keys.`n"
  4493. prompt .= "Joystick buttons are also supported, but currently not with modIfiers.`n"
  4494. prompt .= "`nHit Escape to cancel."
  4495. prompt .= "`nHold Escape to clear a binding."
  4496. Gui, 3:Add, text, center, %prompt%
  4497. Gui, 3:-Border +AlwaysOnTop
  4498. Gui, 3:Show
  4499.  
  4500. outhk := ""
  4501.  
  4502. Input, detectedkey, L1 M, %EXTRA_KEY_LIST%
  4503.  
  4504. If (substr(ErrorLevel,1,7) == "EndKey:"){
  4505. ; A "Special" (Non-printable) key was pressed
  4506. tmp := substr(ErrorLevel,8)
  4507. detectedkey := tmp
  4508. If (tmp == "Escape"){
  4509. ; Detection ended by Escape
  4510. If (HKControlType > 0){
  4511. ; The Escape key was sent because a special button was used
  4512. detectedkey := HKSecondaryInput
  4513. } Else {
  4514. detectedkey := ""
  4515. ; Start listening to key up event for Escape, to see If it was held
  4516. HKLastHotkey := ctrlnum
  4517. hotkey, Escape up, EscapeReleased, ON
  4518. SetTimer, DeleteHotkey, 1000
  4519. }
  4520. }
  4521. }
  4522.  
  4523. ; Stop listening to mouse, keyboard etc
  4524. BindMode := 0
  4525. JoystickDetection(0)
  4526.  
  4527. ; Hide prompt
  4528. Gui, 3:Submit
  4529.  
  4530.  
  4531. ; Process results
  4532.  
  4533. modct := CurrentModIfierCount()
  4534.  
  4535. If (detectedkey && modct && HKControlType == 3){
  4536. msgbox ,,Error, ModIfiers (Ctrl, Alt, ShIft, Win) are currently not supported with Joystick buttons.
  4537. detectedkey := ""
  4538. }
  4539.  
  4540. If (detectedkey)
  4541. {
  4542. ; Update the hotkey object
  4543. outhk := BuildHotkeyString(detectedkey,HKControlType)
  4544. tmp := {hk: outhk, type: HKControlType, status: 0}
  4545.  
  4546. clash := 0
  4547. Loop % HotkeyList.MaxIndex(){
  4548. If (A_Index == ctrlnum)
  4549. {
  4550. continue
  4551. }
  4552. If (StripPrefix(HotkeyList[A_Index].hk) == StripPrefix(tmp.hk))
  4553. {
  4554. clash := 1
  4555. }
  4556. }
  4557. If (clash)
  4558. {
  4559. msgbox You cannot bind the same hotkey to two dIfferent actions. Aborting...
  4560. }
  4561. Else
  4562. {
  4563. HotkeyList[ctrlnum] := tmp
  4564. }
  4565.  
  4566. ; Rebuild rest of hotkey object, save settings etc
  4567. OptionChanged()
  4568. ; Write settings to INI file
  4569. ;SaveSettings()
  4570.  
  4571. ; Update the GUI control
  4572. UpdateHotkeyControls()
  4573.  
  4574. ; Enable the hotkeys
  4575. ;EnableHotkeys()
  4576. }
  4577. Else
  4578. {
  4579. ; Escape was pressed - resotre original hotkey, If any
  4580. EnableHotkeys()
  4581. }
  4582. return
  4583. }
  4584.  
  4585. DeleteHotkey:
  4586. SetTimer, DeleteHotkey, Off
  4587. DeleteHotKey(HKLastHotkey)
  4588. return
  4589.  
  4590. DeleteHotkey(hk)
  4591. {
  4592. global HotkeyList
  4593. global DefaultHKObject
  4594.  
  4595. soundbeep
  4596. DisableHotkeys()
  4597. HotkeyList[hk] := DefaultHKObject
  4598.  
  4599. OptionChanged()
  4600.  
  4601. UpdateHotkeyControls()
  4602. return
  4603. }
  4604.  
  4605. EscapeReleased:
  4606. hotkey, Escape up, EscapeReleased, OFF
  4607. SetTimer, DeleteHotkey, Off
  4608. return
  4609.  
  4610. ; Enables User-Defined Hotkeys
  4611. EnableHotkeys()
  4612. {
  4613. global HotkeyList
  4614. Loop % HotkeyList.MaxIndex()
  4615. {
  4616. status := HotkeyList[A_Index].status
  4617. hk := HotkeyList[A_Index].hk
  4618. If (hk != "" && status == 0){
  4619. prefix := BuildPrefix(HotkeyList[A_Index])
  4620. ;Msgbox % "ADDING: " prefix "," hk
  4621. hotkey, %prefix%%hk%, DoHotkey%A_Index%, ON
  4622. HotkeyList[A_Index].status := 1
  4623. }
  4624. }
  4625. }
  4626.  
  4627. ; Disables User-Defined Hotkeys
  4628. DisableHotkeys()
  4629. {
  4630. global HotkeyList
  4631.  
  4632. Loop % HotkeyList.MaxIndex(){
  4633. status := HotkeyList[A_Index].status
  4634. hk := HotkeyList[A_Index].hk
  4635. If (hk != "" && status == 1){
  4636. prefix := BuildPrefix(HotkeyList[A_Index])
  4637. ;Msgbox % "REMOVING: " prefix "," hk
  4638. hotkey, %prefix%%hk%, DoHotkey%A_Index%, OFF
  4639. ;hotkey, %hk%, DoHotkey%A_Index%, OFF
  4640. HotkeyList[A_Index].status := 0
  4641. }
  4642. }
  4643. }
  4644.  
  4645. ; Builds the prefix for a given hotkey object
  4646. BuildPrefix(hk)
  4647. {
  4648. prefix := "~"
  4649. ;If (!hk.block){
  4650. ; prefix .= "~"
  4651. ;}
  4652. If (hk.wild){
  4653. prefix .= "*"
  4654. }
  4655. return prefix
  4656. }
  4657.  
  4658. ; Removes ~ * etc prefixes (But NOT modIfiers!) from a hotkey object for comparison
  4659. StripPrefix(hk)
  4660. {
  4661. Loop {
  4662. chr := substr(hk,1,1)
  4663. If (chr == "~" || chr == "*" || chr == "$"){
  4664. hk := substr(hk,2)
  4665. } Else {
  4666. break
  4667. }
  4668. }
  4669. return hk
  4670. }
  4671.  
  4672. ; Write settings to the INI
  4673. SaveSettings()
  4674. {
  4675. global ININame
  4676. global NumHotkeys
  4677. global HotkeyList
  4678.  
  4679. Loop % HotkeyList.MaxIndex(){
  4680. hk := HotkeyList[A_Index].hk
  4681. type := HotkeyList[A_Index].type
  4682. ;block := HotkeyList[A_Index].block
  4683. wild := HotkeyList[A_Index].wild
  4684.  
  4685. ;If (hk != ""){
  4686. iniwrite, %hk%, %ININame%, Hotkeys, hk_%A_Index%_hk
  4687. iniwrite, %type%, %ININame%, Hotkeys, hk_%A_Index%_type
  4688. ;iniwrite, %block%, %ININame%, Hotkeys, hk_%A_Index%_block
  4689. iniwrite, %wild%, %ININame%, Hotkeys, hk_%A_Index%_wild
  4690. ;}
  4691. }
  4692. return
  4693. }
  4694.  
  4695.  
  4696. ; Read settings from the INI
  4697. LoadSettings()
  4698. {
  4699. global ININame
  4700. global NumHotkeys
  4701. global HotkeyList
  4702. global DefaultHKObject
  4703.  
  4704. Loop % NumHotkeys
  4705. {
  4706. ; Init array so all items exist
  4707. HotkeyList[A_Index] := DefaultHKObject
  4708.  
  4709. IniRead, type, %ININame% , Hotkeys, hk_%A_Index%_type,
  4710.  
  4711. If A_index=1
  4712. {
  4713. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,F1
  4714. }
  4715. If A_index=2
  4716. {
  4717. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,F2
  4718. }
  4719. If A_index=3
  4720. {
  4721. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,F3
  4722. }
  4723. If A_index=4
  4724. {
  4725. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,^F3
  4726. }
  4727. If A_index=5
  4728. {
  4729. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,F4
  4730. }
  4731. If A_index=6
  4732. {
  4733. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,^F4
  4734. }
  4735. If A_index=7
  4736. {
  4737. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,F10
  4738. }
  4739. If A_index=8
  4740. {
  4741. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,!W
  4742. }
  4743. If A_index=9
  4744. {
  4745. IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,mbutton
  4746. }
  4747.  
  4748. ;IniRead, val, %ININame% , Hotkeys, hk_%A_Index%_hk,
  4749.  
  4750. If (val != "ERROR")
  4751. {
  4752. If A_index=9
  4753. {
  4754. IniRead, type, %ININame% , Hotkeys, hk_%A_Index%_type,2
  4755. }
  4756. Else
  4757. {
  4758. IniRead, type, %ININame% , Hotkeys, hk_%A_Index%_type, 0
  4759. }
  4760. ;IniRead, block, %ININame% , Hotkeys, hk_%A_Index%_block, 0
  4761. IniRead, wild, %ININame% , Hotkeys, hk_%A_Index%_wild, 0
  4762.  
  4763. HotkeyList[A_Index] := {hk: val, type: type, wild: wild, status: 0}
  4764. }
  4765. }
  4766. UpdateHotkeyControls()
  4767. Gui, 2:Submit, NoHide
  4768. }
  4769.  
  4770. ; Update the GUI controls with the hotkey names
  4771. UpdateHotkeyControls()
  4772. {
  4773. global HotkeyList
  4774.  
  4775. Loop % HotkeyList.MaxIndex()
  4776. {
  4777. If (HotkeyList[A_Index].hk != "")
  4778. {
  4779. tmp := BuildHotkeyName(HotkeyList[A_Index].hk,HotkeyList[A_Index].type)
  4780. GuiControl, 2:, HotkeyName%A_Index%, %tmp%
  4781. }
  4782. Else
  4783. {
  4784. GuiControl, 2:, HotkeyName%A_Index%, None
  4785. }
  4786. ;tmp := HotkeyList[A_Index].block
  4787. ;GuiControl,, Block%A_Index%, %tmp%
  4788.  
  4789. tmp := HotkeyList[A_Index].wild
  4790. GuiControl, 2:, Wild%A_Index%, %tmp%
  4791. }
  4792. Gui, 2:Submit, NoHide
  4793. }
  4794.  
  4795. ; Builds an AHK String (eg "^c" for CTRL + C) from the last detected hotkey
  4796. BuildHotkeyString(str, type := 0)
  4797. {
  4798. global HKModIfierState
  4799.  
  4800. outhk := ""
  4801. modct := CurrentModIfierCount()
  4802.  
  4803. If (type == 1){
  4804. ; Solitary modIfier key used (eg Left / Right Alt)
  4805. outhk := str
  4806. } Else {
  4807. If (modct){
  4808. ; ModIfiers used in combination with something Else - List modIfiers in a specIfic order
  4809. modIfiers := ["CTRL","ALT","SHIfT","WIN"]
  4810.  
  4811. Loop, 4 {
  4812. key := modIfiers[A_Index]
  4813. value := HKModIfierState[modIfiers[A_Index]]
  4814. If (value){
  4815. If (key == "CTRL"){
  4816. outhk .= "^"
  4817. } Else If (key == "ALT"){
  4818. outhk .= "!"
  4819. } Else If (key == "SHIfT"){
  4820. outhk .= "+"
  4821. } Else If (key == "WIN"){
  4822. outhk .= "#"
  4823. }
  4824. }
  4825. }
  4826. }
  4827. ; ModIfiers etc processed, complete the string
  4828. outhk .= str
  4829. }
  4830.  
  4831. return outhk
  4832. }
  4833.  
  4834. ; Builds a Human-Readable form of a Hotkey string (eg "^C" -> "CTRL + C")
  4835. BuildHotkeyName(hk,ctrltype)
  4836. {
  4837. outstr := ""
  4838. modctr := 0
  4839. stringupper, hk, hk
  4840.  
  4841. Loop % strlen(hk) {
  4842. chr := substr(hk,1,1)
  4843. mod := 0
  4844.  
  4845. If (chr == "^"){
  4846. ; Ctrl
  4847. mod := "CTRL"
  4848. modctr++
  4849. } Else If (chr == "!"){
  4850. ; Alt
  4851. mod := "ALT"
  4852. modctr++
  4853. } Else If (chr == "+"){
  4854. ; ShIft
  4855. mod := "SHIfT"
  4856. modctr++
  4857. } Else If (chr == "#"){
  4858. ; Win
  4859. mod := "WIN"
  4860. modctr++
  4861. } Else {
  4862. break
  4863. }
  4864. If (mod){
  4865. If (modctr > 1){
  4866. outstr .= " + "
  4867. }
  4868. outstr .= mod
  4869. ; shIft character out
  4870. hk := substr(hk,2)
  4871. }
  4872. }
  4873. If (modctr){
  4874. outstr .= " + "
  4875. }
  4876.  
  4877. If (ctrltype == 1){
  4878. ; Solitary ModIfiers
  4879. pfx := substr(hk,1,1)
  4880. If (pfx == "L"){
  4881. outstr .= "LEFT "
  4882. } Else {
  4883. outstr .= "RIGHT "
  4884. }
  4885. outstr .= substr(hk,2)
  4886. } Else If (ctrltype == 2){
  4887. ; Mouse Buttons
  4888. If (hk == "LBUTTON") {
  4889. outstr .= "LEFT MOUSE"
  4890. } Else If (hk == "RBUTTON") {
  4891. outstr .= "RIGHT MOUSE"
  4892. } Else If (hk == "MBUTTON") {
  4893. outstr .= "MIDDLE MOUSE"
  4894. } Else If (hk == "XBUTTON1") {
  4895. outstr .= "MOUSE THUMB 1"
  4896. } Else If (hk == "XBUTTON2") {
  4897. outstr .= "MOUSE THUMB 2"
  4898. } Else If (hk == "WHEELUP") {
  4899. outstr .= "MOUSE WHEEL U"
  4900. } Else If (hk == "WHEELDOWN") {
  4901. outstr .= "MOUSE WHEEL D"
  4902. } Else If (hk == "WHEELLEFT") {
  4903. outstr .= "MOUSE WHEEL L"
  4904. } Else If (hk == "WHEELRIGHT") {
  4905. outstr .= "MOUSE WHEEL R"
  4906. }
  4907. } Else If (ctrltype == 3){
  4908. ; Joystick Buttons
  4909. pos := instr(hk,"JOY")
  4910. id := substr(hk,1,pos-1)
  4911. button := substr(hk,5)
  4912. outstr .= "JOYSTICK " id " BTN " button
  4913. } Else {
  4914. ; Keyboard Keys
  4915. tmp := instr(hk,"NUMPAD")
  4916. If (tmp){
  4917. outstr .= "NUMPAD " substr(hk,7)
  4918. } Else {
  4919. ; Replace underscores with spaces (In case of key name like MEDIA_PLAY_PAUSE)
  4920. StringReplace, hk, hk, _ , %A_SPACE%, All
  4921. outstr .= hk
  4922. }
  4923. }
  4924.  
  4925.  
  4926. return outstr
  4927. }
  4928.  
  4929. ; Detects ModIfiers and Mouse Buttons in BindMode
  4930. #If BindMode
  4931. ; Detect key down of modIfier keys
  4932. *lctrl::
  4933. *rctrl::
  4934. *lalt::
  4935. *ralt::
  4936. *lshIft::
  4937. *rshIft::
  4938. *lwin::
  4939. *rwin::
  4940. mod := substr(A_ThisHotkey,2)
  4941. SetModIfier(mod,1)
  4942. return
  4943.  
  4944. ; Detect key up of modIfier keys
  4945. *lctrl up::
  4946. *rctrl up::
  4947. *lalt up::
  4948. *ralt up::
  4949. *lshIft up::
  4950. *rshIft up::
  4951. *lwin up::
  4952. *rwin up::
  4953. ; Strip * from beginning, " up" from end etc
  4954. mod := substr(substr(A_ThisHotkey,2),1,strlen(A_ThisHotkey) -4)
  4955. If (CurrentModIfierCount() == 1){
  4956. ; If CurrentModIfierCount is 1 when an up is received, then that is a Solitary ModIfier
  4957. ; It cannot be a modIfier + normal key, as this code would have quit on keydown of normal key
  4958.  
  4959. HKControlType := 1
  4960. HKSecondaryInput := mod
  4961.  
  4962. ; Send Escape - This will cause the Input command to quit with an EndKey of Escape
  4963. ; But we stored the modIfier key, so we will know it was not really escape
  4964. Send {Escape}
  4965. }
  4966. SetModIfier(mod,0)
  4967. return
  4968.  
  4969. ; Detect Mouse buttons
  4970. lbutton::
  4971. rbutton::
  4972. mbutton::
  4973. xbutton1::
  4974. xbutton2::
  4975. wheelup::
  4976. wheeldown::
  4977. wheelleft::
  4978. wheelright::
  4979. HKControlType := 2
  4980. HKSecondaryInput := A_ThisHotkey
  4981. Send {Escape}
  4982. return
  4983. #If
  4984.  
  4985. ; Adds / removes hotkeys to detect Joystick Buttons in BindMode
  4986. JoystickDetection(mode := 1)
  4987. {
  4988. If (mode){
  4989. mode := "ON"
  4990. } Else {
  4991. mode := "OFF"
  4992. }
  4993. Loop , 16 {
  4994. stickid := A_Index
  4995. Loop, 32 {
  4996. buttonid := A_Index
  4997. hotkey, %stickid%Joy%buttonid%, JoystickPressed, %mode%
  4998. }
  4999. }
  5000. }
  5001.  
  5002. ; A Joystick button was pressed while in Binding mode
  5003. JoystickPressed:
  5004. HKControlType := 3
  5005. HKSecondaryInput := A_ThisHotkey
  5006. Send {Escape}
  5007. return
  5008.  
  5009. ; Sets the state of the HKModIfierState object to reflect the state of the modIfier keys
  5010. SetModIfier(hk,state)
  5011. {
  5012. global HKModIfierState
  5013.  
  5014. If (hk == "lctrl" || hk == "rctrl"){
  5015. HKModIfierState.ctrl := state
  5016. } Else If (hk == "lalt" || hk == "ralt"){
  5017. HKModIfierState.alt := state
  5018. } Else If (hk == "lshIft" || hk == "rshIft"){
  5019. HKModIfierState.shIft := state
  5020. } Else If (hk == "lwin" || hk == "rwin"){
  5021. HKModIfierState.win := state
  5022. }
  5023. return
  5024. }
  5025.  
  5026. ; Counts how many modIfier keys are currently held
  5027. CurrentModIfierCount()
  5028. {
  5029. global HKModIfierState
  5030.  
  5031. return HKModIfierState.ctrl + HKModIfierState.alt + HKModIfierState.shIft + HKModIfierState.win
  5032. }
  5033.  
  5034. ; Takes the start of the file name (before .ini or .exe and replaces it with .ini)
  5035. BuildIniName()
  5036. {
  5037. tmp := A_Scriptname
  5038. Stringsplit, tmp, tmp,.
  5039. ini_name := ""
  5040. last := ""
  5041. Loop, % tmp0
  5042. {
  5043. ; build the string up to the last period (.)
  5044. If (last != ""){
  5045. If (ini_name != ""){
  5046. ini_name := ini_name "."
  5047. }
  5048. ini_name := ini_name last
  5049. }
  5050. last := tmp%A_Index%
  5051. }
  5052. ;this.ini_name := ini_name ".ini"
  5053. return ini_name ".ini"
  5054. }
  5055.  
  5056. ;-------NOT MY FUNCTIONS--------------NOT MY FUNCTIONS--------------NOT MY FUNCTIONS-----------------
  5057.  
  5058. ; DPS Calculator Script
  5059. ; This script can be found here:
  5060. ; https://www.pathofexile.com/forum/view-thread/594346
  5061. ; If you have any questions or comments please post them there as well. If you think you can help
  5062. ; improve this project. I am looking for contributors. So Pm me If you think you can help.
  5063. ;
  5064. ;
  5065. ; If you have a issue please post what version you are using.
  5066. ; Reason being is that something that might be a issue might already be fixed.
  5067. ; Version: 1.2d
  5068.  
  5069. ;DPSCalc Credits:
  5070. ;Nipper4369, creator of DPSCalc
  5071. ;mcpower for the base iLVL display of the script 5months ago before Immo.
  5072. ;Immo for the base iLVL display of the script.(Which was taken from mcpower.)
  5073. ;olop4444 for helping Nipper4369 figure out the calculations for Q20 items.
  5074. ;Aeons for a rewrite and fancy tooltips.
  5075. ;kongyuyu for base item level display.
  5076. ;Fayted for testing the script.
  5077.  
  5078. ; Creates a font for later use
  5079. CreateFont()
  5080. {
  5081. global FontSize
  5082. Options :=
  5083. If (!(FontSize = ""))
  5084. {
  5085. Options = s%FontSize%
  5086. }
  5087. Gui Font, %Options%, Courier New
  5088. Gui Font, %Options%, Consolas
  5089. Gui Add, Text, HwndHidden,
  5090. SendMessage, 0x31,,,, ahk_id %Hidden%
  5091. return ErrorLevel
  5092. }
  5093.  
  5094. ; Sets the font for a created ahk tooltip
  5095. SetFont(Font)
  5096. {
  5097. SendMessage, 0x30, Font, 1,, ahk_class tooltips_class32 ahk_exe autohotkey.exe
  5098. }
  5099.  
  5100. ; Parse elemental damage
  5101. ParseDamage(String, DmgType, ByRef DmgLo, ByRef DmgHi)
  5102. {
  5103. IfInString, String, %DmgType% Damage
  5104. {
  5105. IfInString, String, Converted to or IfInString, String, taken as
  5106. Return
  5107. IfNotInString, String, increased
  5108. {
  5109. StringSplit, Arr, String, %A_Space%
  5110. StringSplit, Arr, Arr2, -
  5111. DmgLo := Arr1
  5112. DmgHi := Arr2
  5113. }
  5114. }
  5115. }
  5116.  
  5117. ; Parse clipboard content for item level and dps
  5118. DPSCalc()
  5119. {
  5120. Global DPS
  5121. If DPS
  5122. return
  5123. IfWinActive Path of Exile ahk_class POEWindowClass
  5124. {
  5125. SendMode Input
  5126. clipboard = ; Start off empty to allow ClipWait to detect when the text has arrived.
  5127. ErrorLevel = 0
  5128. Send ^c
  5129. ClipWait, 0.05 ; Wait for the clipboard to contain text.
  5130. If ErrorLevel = 1
  5131. {
  5132. return
  5133. }
  5134. NameIsDone := False
  5135. ItemName :=
  5136. ItemLevel := -1
  5137. IsWeapon := False
  5138. PhysLo := 0
  5139. PhysHi := 0
  5140. Quality := 0
  5141. AttackSpeed := 0
  5142. PhysMult := 0
  5143. ChaoLo := 0
  5144. ChaoHi := 0
  5145. ColdLo := 0
  5146. ColdHi := 0
  5147. FireLo := 0
  5148. FireHi := 0
  5149. LighLo := 0
  5150. LighHi := 0
  5151.  
  5152. Loop, Parse, Clipboard, `n, `r
  5153. {
  5154. ; Clipboard must have "Rarity:" in the first line
  5155. If A_Index = 1
  5156. {
  5157. IfNotInString, A_LoopField, Rarity:
  5158. {
  5159. Exit
  5160. }
  5161. Else
  5162. {
  5163. Continue
  5164. }
  5165. }
  5166.  
  5167. ; Get name
  5168. If Not NameIsDone
  5169. {
  5170. If A_LoopField = --------
  5171. {
  5172. NameIsDone := True
  5173. }
  5174. Else
  5175. {
  5176. ItemName := ItemName . A_LoopField . "`n" ; Add a line of name
  5177. }
  5178. Continue
  5179. }
  5180.  
  5181. ; Get item level
  5182. IfInString, A_LoopField, Item level:
  5183. {
  5184. StringSplit, ItemLevelArray, A_LoopField, %A_Space%
  5185. ItemLevel := ItemLevelArray3
  5186. Continue
  5187. }
  5188.  
  5189. ; Get quality
  5190. IfInString, A_LoopField, Quality:
  5191. {
  5192. StringSplit, Arr, A_LoopField, %A_Space%, +`%
  5193. Quality := Arr2
  5194. Continue
  5195. }
  5196.  
  5197. ; Get total physical damage
  5198. IfInString, A_LoopField, Physical Damage:
  5199. {
  5200. IsWeapon = True
  5201. StringSplit, Arr, A_LoopField, %A_Space%
  5202. StringSplit, Arr, Arr3, -
  5203. PhysLo := Arr1
  5204. PhysHi := Arr2
  5205. Continue
  5206. }
  5207. ;Fix for Elemental damage only weapons. Like the Oro's SacrIfice
  5208. IfInString, A_LoopField, Elemental Damage:
  5209. {
  5210. IsWeapon = True
  5211. Continue
  5212. }
  5213.  
  5214. ; These only make sense for weapons
  5215. If IsWeapon
  5216. {
  5217. ; Get attack speed
  5218. IfInString, A_LoopField, Attacks per Second:
  5219. {
  5220. StringSplit, Arr, A_LoopField, %A_Space%
  5221. AttackSpeed := Arr4
  5222. Continue
  5223. }
  5224.  
  5225. ; Get percentage physical damage increase
  5226. IfInString, A_LoopField, increased Physical Damage
  5227. {
  5228. StringSplit, Arr, A_LoopField, %A_Space%, `%
  5229. PhysMult := Arr1
  5230. Continue
  5231. }
  5232.  
  5233. ;Lines to skip fix for converted type damage. Like the Voltaxic RIft
  5234. IfInString, A_LoopField, Converted to
  5235. Goto, SkipDamageParse
  5236. IfInString, A_LoopField, can Shock
  5237. Goto, SkipDamageParse
  5238.  
  5239. ; Parse elemental damage
  5240. ParseDamage(A_LoopField, "Chaos", ChaoLo, ChaoHi)
  5241. ParseDamage(A_LoopField, "Cold", ColdLo, ColdHi)
  5242. ParseDamage(A_LoopField, "Fire", FireLo, FireHi)
  5243. ParseDamage(A_LoopField, "Lightning", LighLo, LighHi)
  5244.  
  5245. SkipDamageParse:
  5246. }
  5247. }
  5248. If ItemLevel = -1 ; Something without an itemlevel
  5249. {
  5250. Exit
  5251. }
  5252. ; Get position of mouse cursor
  5253. global X
  5254. global Y
  5255. MouseGetPos, X, Y
  5256.  
  5257. ; All items should show name and item level
  5258. ; Pad to 3 places
  5259. ItemLevel := " " + ItemLevel
  5260. StringRight, ItemLevel, ItemLevel, 3
  5261. TT = %ItemName%Item lvl: %ItemLevel%
  5262.  
  5263. ; DPS calculations
  5264. If IsWeapon {
  5265. SetFormat, FloatFast, 5.1
  5266.  
  5267. PhysDps := ((PhysLo + PhysHi) / 2) * AttackSpeed
  5268. EleDps := ((ChaoLo + ChaoHi + ColdLo + ColdHi + FireLo + FireHi + LighLo + LighHi) / 2) * AttackSpeed
  5269. TotalDps := PhysDps + EleDps
  5270.  
  5271. TT = %TT%`nPhys DPS: %PhysDps%`nElem DPS: %EleDps%`nTotal DPS: %TotalDps%
  5272.  
  5273. ; Only show Q20 values If item is not Q20
  5274. If Quality < 20
  5275. {
  5276. TotalPhysMult := (PhysMult + Quality + 100) / 100
  5277. BasePhysDps := PhysDps / TotalPhysMult
  5278. Q20Dps := BasePhysDps * ((PhysMult + 120) / 100) + EleDps
  5279.  
  5280. TT = %TT%`nQ20 DPS: %Q20Dps%
  5281. }
  5282. }
  5283.  
  5284. ; Replaces Clipboard with tooltip data
  5285. StringReplace, clipboard, TT, `n, %A_SPACE% , All
  5286.  
  5287. ; Show tooltip, with fixed width font
  5288. ToolTip, %TT%, X + 35, Y + 35
  5289. ;global FixedFont
  5290. ;SetFont(FixedFont)
  5291. ; Set up count variable and start timer for tooltip timeout
  5292. global ToolTipTimeout := 0
  5293. SetTimer, ToolTipTimer, 100
  5294. }
  5295. }
  5296.  
  5297. ; Tick every 100 ms
  5298. ; Remove tooltip If mouse is moved or 5 seconds pass
  5299. ToolTipTimer:
  5300. ToolTipTimeout += 1
  5301. MouseGetPos, CurrX, CurrY
  5302. MouseMoved := (CurrX - X)**2 + (CurrY - Y)**2 > 40**2
  5303. If (MouseMoved or ToolTipTimeout >= 50)
  5304. {
  5305. SetTimer, ToolTipTimer, Off
  5306. ToolTip
  5307. }
  5308. return
  5309.  
  5310. ;-------NOT MY FUNCTIONS--------------NOT MY FUNCTIONS--------------NOT MY FUNCTIONS-----------------
  5311.  
  5312. ;-------END--------------END--------------END--------------END--------------END----------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement