Guest User

Untitled

a guest
Apr 18th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.88 KB | None | 0 0
  1. ; made by /u/lutcikaur
  2. ; As always, test the logout before you run into hardcore.
  3. ; If you find some errors, the list is at the bottom. Search for the error code.
  4. ; GUI's in use : 1, 2, 3, 4, 5, 6
  5.  
  6. ; you probably shouldn't touch much of this
  7.  
  8. #NoEnv
  9. #SingleInstance force
  10.  
  11. FileEncoding , UTF-8
  12. SendMode Input
  13. SetTitleMatchMode, 3
  14. macroVersion := 140
  15.  
  16. If (A_AhkVersion <= "1.1.23")
  17. {
  18. msgbox, You need AutoHotkey v1.1.23 or later to run this script. `n`nPlease go to http://ahkscript.org/download and download a recent version.
  19. ExitApp
  20. }
  21.  
  22. IfNotExist %A_MyDocuments%\AutoHotKey
  23. {
  24. FileCreateDir, %A_MyDocuments%\AutoHotKey
  25. }
  26.  
  27. SetWorkingDir %A_MyDocuments%\AutoHotKey
  28.  
  29. elog := A_Now . " " . A_AhkVersion . " " . macroVersion "`n"
  30. FileAppend, %elog% , error.txt, UTF-16
  31.  
  32. IfNotExist, Lib
  33. {
  34. FileCreateDir, Lib
  35. }
  36.  
  37. FileDelete, Lib\QDL.ahk
  38. str := "#NoTrayIcon`nSetWorkingDir %A_MyDocuments%\AutoHotKey`nUrlDownloadToFile,%1%,%2%`nIfNotExist, %2%`n{`nFileAppend,ERROR,%2%`n}"
  39. FileAppend, %str%, Lib\QDL.ahk
  40.  
  41. UrlDownloadToFile, http://lutbot.com/ahk/version.html, version.html
  42. if ErrorLevel
  43. GuiControl,1:, guiErr, ED06
  44.  
  45. FileRead, newestVersion, version.html
  46.  
  47. if ( macroVersion < newestVersion ) {
  48. UrlDownloadToFile, http://lutbot.com/ahk/changelog.txt, changelog.txt
  49. if ErrorLevel
  50. GuiControl,1:, guiErr, ED08
  51. Gui, 4:Add, Text,, Update Available.`nYoure running version %macroVersion%. The newest is version %newestVersion%`nProceed with update? It will only take a moment, and the script will automatically restart.
  52. FileRead, changelog, changelog.txt
  53. Gui, 4:Add, Edit, w600 h200 +ReadOnly, %changelog%
  54. Gui, 4:Add, Button, section default grunUpdate, Update
  55. Gui, 4:Add, Button, ys gdontUpdate, Skip Update
  56. Gui, 4:Show
  57. }
  58.  
  59. If !A_IsAdmin {
  60. Run *RunAs "%A_ScriptFullPath%"
  61. ExitApp
  62. }
  63.  
  64. GetTable := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Iphlpapi.dll", "Ptr"), Astr, "GetExtendedTcpTable", "Ptr")
  65. SetEntry := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Iphlpapi.dll", "Ptr"), Astr, "SetTcpEntry", "Ptr")
  66. EnumProcesses := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Psapi.dll", "Ptr"), Astr, "EnumProcesses", "Ptr")
  67. preloadPsapi := DllCall("LoadLibrary", "Str", "Psapi.dll", "Ptr")
  68. OpenProcessToken := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Advapi32.dll", "Ptr"), Astr, "OpenProcessToken", "Ptr")
  69. LookupPrivilegeValue := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Advapi32.dll", "Ptr"), Astr, "LookupPrivilegeValue", "Ptr")
  70. AdjustTokenPrivileges := DllCall("GetProcAddress", Ptr, DllCall("LoadLibrary", Str, "Advapi32.dll", "Ptr"), Astr, "AdjustTokenPrivileges", "Ptr")
  71.  
  72. IfNotExist, cports.exe
  73. {
  74. UrlDownloadToFile, http://lutbot.com/ahk/cports.exe, cports.exe
  75. if ErrorLevel
  76. msgbox, We couldn't download cports.exe, this is used as a fallback to the normal logout method. The logout functionality may not work until this is resolved. Please download cports.exe from http://lutbot.com/ahk/cports.exe and place it in %A_MyDocuments%\AutoHotKey.
  77. UrlDownloadToFile, http://lutbot.com/ahk/cports.chm, cports.chm
  78. if ErrorLevel
  79. error("ED03")
  80. UrlDownloadToFile, http://lutbot.com/ahk/readme.txt, readme.txt
  81. if ErrorLevel
  82. error("ED04")
  83. }
  84.  
  85. IfNotExist, settings.ini
  86. {
  87. defaultIni := "[variables]`n"
  88. defaultIni .= "CharacterName=Lutbot`n"
  89. defaultIni .= "League=standard`n"
  90. defaultIni .= "PoeSteam=0`n"
  91. defaultIni .= "UpdateTimer=1000`n"
  92. defaultIni .= "XOffset=0`n"
  93. defaultIni .= "YOffset=0`n"
  94. defaultIni .= "MonitorWhispers=0`n"
  95. defaultIni .= "MonitorWhispersDelay=10000`n"
  96. defaultIni .= "LogFileLocation=ERROR PLEASE SELECT LOG FILE`n"
  97. defaultIni .= "OverlayToggle=0`n"
  98. defaultIni .= "SoundSelector=*-1`n"
  99. defaultIni .= "Beta=1`n"
  100. defaultIni .= "Diablo2=0`n"
  101. defaultIni .= "HighBits=0`n"
  102. defaultIni .= "[whisperMessages]`n"
  103. defaultIni .= "wm1=One moment, I'm in a map.`n"
  104. defaultIni .= "wm2=Sorry, That item has already been sold.`n"
  105. defaultIni .= "wm3=Type a sentence here`n"
  106. defaultIni .= "wm4=Type a sentence here`n"
  107. defaultIni .= "wm5=Type a sentence here`n"
  108. defaultIni .= "[partyMessages]`n"
  109. defaultIni .= "pm1=Type messages here`n"
  110. defaultIni .= "pm2=Accepts regular messages like this`n"
  111. defaultIni .= "pm3=#or global messages like this`n"
  112. defaultIni .= "pm4=%also party messages`n"
  113. defaultIni .= "pm5=&don't spam your guild!`n"
  114. defaultIni .= "pm6=we can use commands too`n"
  115. defaultIni .= "pm7=/passives`n"
  116. defaultIni .= "pm8=or go afk`n"
  117. defaultIni .= "pm9=/afk i gotta poo`n"
  118. defaultIni .= "pm10=the possibilties are endless`n"
  119. defaultIni .= "[hotkeys]`n"
  120. defaultIni .= "logout=```n"
  121. defaultIni .= "superLogout=F12`n"
  122. defaultIni .= "oos=F2`n"
  123. defaultIni .= "remaining=F3`n"
  124. defaultIni .= "whois=F4`n"
  125. defaultIni .= "hideout=F5`n"
  126. defaultIni .= "invite=F6`n"
  127. defaultIni .= "toggleOverlay=F9`n"
  128. defaultIni .= "options=F10`n"
  129. defaultIni .= "wm1=^1`n"
  130. defaultIni .= "wm2=^2`n"
  131. defaultIni .= "wm3=^3`n"
  132. defaultIni .= "wm4=^4`n"
  133. defaultIni .= "wm5=^5`n"
  134. defaultIni .= "pm1=!1`n"
  135. defaultIni .= "pm2=!2`n"
  136. defaultIni .= "pm3=!3`n"
  137. defaultIni .= "pm4=!4`n"
  138. defaultIni .= "pm5=!5`n"
  139. defaultIni .= "pm6=!6`n"
  140. defaultIni .= "pm7=!7`n"
  141. defaultIni .= "pm8=!8`n"
  142. defaultIni .= "pm9=!9`n"
  143. defaultIni .= "pm10=!0"
  144.  
  145. FileAppend, %defaultIni%, settings.ini, UTF-16
  146. }
  147.  
  148. getLeagueListing()
  149.  
  150. readFromFile()
  151.  
  152. current := 0
  153. phase := 0
  154. lastWhisperTimeRecieved := 0
  155.  
  156. ;timers
  157. updateTrackingTimer := 5000 ; 5 seconds
  158. baseUpdateTrackingTimer := 600000 ; 10 minutes
  159. verifyLogoutTimer := 0
  160. baseVerifyLogoutTimer := 180000 ; 3 minutes
  161. processWarningFound := 0
  162. overlayTimer := 0
  163. baseOverlayTimer := sleepTime
  164. updateTrackingTimerActive := true
  165. overlayTimerActive := true
  166. lastUpdated := 1
  167. preloadCportsTimer := 0
  168. basePreloadCportsTimer := 180000 ; 3 minutes
  169. preloadCportsCall := "cports.exe /stext TEMP"
  170.  
  171. ;Ranking Overlay
  172. Gui, 1:+ToolWindow
  173. Gui, 1:Font, s8
  174. Gui, 1:Add, Text, x3 y2 vguiErr, Working
  175. Gui, 1:Add, Text, x3 y17, Settings:F10
  176. Gui, 1:Font, s14
  177. Gui, 1:Add, Text, x67 y4 w120 vguiRank, Rank: N/A
  178. Gui, 1:Add, Text, x175 y4 w55 vguiMovedRanks,
  179. Gui, 1:Font, s7
  180. Gui, 1:Add, Text, x3 y32, Ranks, Class:
  181. Gui, 1:Add, Text, x72 y32 w33 vguiClassRank, N/A
  182. Gui, 1:Add, Text, x115 y32, Alive:
  183. Gui, 1:Add, Text, x145 y32 w33 vguiAliveRank, N/A
  184. Gui, 1:Add, Text, x3 y47, Exp Above :
  185. Gui, 1:Add, Text, x3 y62, Exp Below :
  186. Gui, 1:Add, Text, x66 y47 w66 vguiAbove1, N/A
  187. Gui, 1:Add, Text, x135 y47 w66 vguiAbove2, N/A
  188. Gui, 1:Add, Text, x66 y62 w66 vguiBelow1, N/A
  189. Gui, 1:Add, Text, x135 y62 w66 vguiBelow2, N/A
  190. Gui, 1:Font, s14
  191.  
  192. Gui, 1:Show, x0 y0 w225 h37, poeGUI
  193. Gui, 1:-Caption +AlwaysOnTop +Disabled +E0x20 +LastFound
  194. Winset,TransColor, 0xFFFFFF
  195.  
  196. ;Menu
  197. Gui, 2:Add, Text,, CharacterName:
  198. Gui, 2:Add, Text,, Char's League:
  199. Gui, 2:Add, Text,cc61919, Steam Client:
  200. Gui, 2:Add, Text,cc61919, Dx11 (x64) Client:
  201. Gui, 2:Add, Text,, UpdateTimer(ms):
  202. Gui, 2:Add, Text,, Overlay X Offset:
  203. Gui, 2:Add, Text,, Overlay Y Offset:
  204. Gui, 2:Add, Text,, Beta version:
  205. Gui, 2:Add, Text,h34, D2 logout?:
  206.  
  207. Gui, 2:Add, Text,, Logout:
  208. Gui, 2:Add, Text,, ForceLogout:
  209. Gui, 2:Add, Text,, /Oos:
  210. Gui, 2:Add, Text,, /Remaining :
  211. Gui, 2:Add, Text,, /whois :
  212. Gui, 2:Add, Text,, Travel to Hideout :
  213. Gui, 2:Add, Text,, Invite Player :
  214. Gui, 2:Add, Text,, Toggle Overlay Size:
  215. Gui, 2:Add, Text,, Options (This GUI) :
  216.  
  217.  
  218. Gui, 2:Add, Edit, vguiChar ym w100 h20, %charName%
  219. Gui, 2:Add, DropDownList, vguiLeague w100, %leagueString%
  220. ;GuiControl, 2:ChooseString, guiLeague, %league%
  221. Gui, 2:Add, Checkbox, vguiSteam w100 h20 Checked%steam%
  222. Gui, 2:Add, Checkbox, vguihighBits h20 Checked%highBits%
  223. Gui, 2:Add, Edit, vguiUpdate w100 h20, %sleepTime%
  224. Gui, 2:Add, Edit, vguiXOffset w100 h20, %xOffset%
  225. Gui, 2:Add, Edit, vguiYOffset w100 h20, %yOffset%
  226. Gui, 2:Add, Checkbox, vguibeta h20 Checked%beta%
  227. Gui, 2:Add, Checkbox, vguidiablo2 h20 Checked%diablo2%
  228.  
  229. Gui, 2:Add, Text, w100 h20, Hotkey:
  230. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyLogout , %hotkeyLogout%
  231. Gui, 2:Add, Hotkey, w100 h20 vguihotkeySuperLogout , %hotkeySuperLogout%
  232. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyOos , %hotkeyOos%
  233. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyRemaining , %hotkeyRemaining%
  234. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyWhois , %hotkeyWhois%
  235. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyHideout , %hotkeyHideout%
  236. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyInvite , %hotkeyInvite%
  237. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyToggleOverlay , %hotkeyToggleOverlay%
  238. Gui, 2:Add, Hotkey, w100 h20 vguihotkeyOptions , %hotkeyOptions%
  239.  
  240. Gui, 2:Add, Text, ym, Whisper Hotkeys:
  241. Gui, 2:Add, Hotkey, vguihotkeywm1 w100 h20 , %hotkeywm1%
  242. Gui, 2:Add, Hotkey, vguihotkeywm2 w100 h20 , %hotkeywm2%
  243. Gui, 2:Add, Hotkey, vguihotkeywm3 w100 h20 , %hotkeywm3%
  244. Gui, 2:Add, Hotkey, vguihotkeywm4 w100 h20 , %hotkeywm4%
  245. Gui, 2:Add, Hotkey, vguihotkeywm5 w100 h20 , %hotkeywm5%
  246.  
  247. Gui, 2:Add, Text,, General Hotkeys:
  248. Gui, 2:Add, Hotkey, vguihotkeypm1 w100 h20 , %hotkeypm1%
  249. Gui, 2:Add, Hotkey, vguihotkeypm2 w100 h20 , %hotkeypm2%
  250. Gui, 2:Add, Hotkey, vguihotkeypm3 w100 h20 , %hotkeypm3%
  251. Gui, 2:Add, Hotkey, vguihotkeypm4 w100 h20 , %hotkeypm4%
  252. Gui, 2:Add, Hotkey, vguihotkeypm5 w100 h20 , %hotkeypm5%
  253. Gui, 2:Add, Hotkey, vguihotkeypm6 w100 h20 , %hotkeypm6%
  254. Gui, 2:Add, Hotkey, vguihotkeypm7 w100 h20 , %hotkeypm7%
  255. Gui, 2:Add, Hotkey, vguihotkeypm8 w100 h20 , %hotkeypm8%
  256. Gui, 2:Add, Hotkey, vguihotkeypm9 w100 h20 , %hotkeypm9%
  257. Gui, 2:Add, Hotkey, vguihotkeypm10 w100 h20 , %hotkeypm10%
  258. Gui, 2:Add, Text,, Questions? Comments?
  259.  
  260. Gui, 2:Add, Text, ym w200, Whisper Message Text:
  261. Gui, 2:Add, Edit, vguiwm1 w200 h20, %wm1%
  262. Gui, 2:Add, Edit, vguiwm2 w200 h20, %wm2%
  263. Gui, 2:Add, Edit, vguiwm3 w200 h20, %wm3%
  264. Gui, 2:Add, Edit, vguiwm4 w200 h20, %wm4%
  265. Gui, 2:Add, Edit, vguiwm5 w200 h20, %wm5%
  266.  
  267. Gui, 2:Add, Text, w200, General Command Outputs:
  268. Gui, 2:Add, Edit, vguipm1 w200 h20, %pm1%
  269. Gui, 2:Add, Edit, vguipm2 w200 h20, %pm2%
  270. Gui, 2:Add, Edit, vguipm3 w200 h20, %pm3%
  271. Gui, 2:Add, Edit, vguipm4 w200 h20, %pm4%
  272. Gui, 2:Add, Edit, vguipm5 w200 h20, %pm5%
  273. Gui, 2:Add, Edit, vguipm6 w200 h20, %pm6%
  274. Gui, 2:Add, Edit, vguipm7 w200 h20, %pm7%
  275. Gui, 2:Add, Edit, vguipm8 w200 h20, %pm8%
  276. Gui, 2:Add, Edit, vguipm9 w200 h20, %pm9%
  277. Gui, 2:Add, Edit, vguipm10 w200 h20, %pm10%
  278. Gui, 2:Add, Text,, @Lutcikaur ingame or /u/lutcikaur on reddit
  279.  
  280. Gui, 2:Add, Text,, Let me know if it errors
  281.  
  282. Gui, 2:Add, Text, xm section, Monitor Whispers:
  283. Gui, 2:Add, Checkbox, ys vguiMonitorWhispers h20 Checked%monitorWhispers%
  284. Gui, 2:Add, Text, ys, Check Delay (ms):
  285. Gui, 2:Add, Edit, ys vguiMonitorWhispersDelay w100 h20, %monitorWhispersDelay%
  286. Gui, 2:Add, Button, ys gchangelogGui, Changelog
  287. Gui, 2:Add, Button, ys default gupdateHotkeys, Okay
  288.  
  289. Gui, 2:Add, Button, section xm gbrowseForLogFile , Browse for Log File
  290. Gui, 2:Add, Text, ys, Whisper Notification Sound:
  291. Gui, 2:Add, DropDownList, ys vguiSoundSelector w50, None|*-1|*16|*32|*48|*64
  292. GuiControl, 2:ChooseString, guiSoundSelector, %soundSelector%
  293. Gui, 2:Add, Button, ys gplaySound, TestPlay Sound
  294. Gui, 2:Add, Text, w380 xs vguiLogFileLocation, %logFileLocation%
  295.  
  296. ;Process Warning Overlay
  297. Gui, 6:+ToolWindow
  298. Gui, 6:Font, s8
  299. Gui, 6:Add, Text,x7 y7, PoE exe name mismatch detected. Confirm highlighted settings and that you're launching poe with client.exe
  300. Gui, 6:Add, Text,x7 y25 vbackupErrorMessage, PoE exe name mismatch detected. Confirm highlighted settings and that you're launching poe with client.exe
  301. Gui, 6:-Caption +AlwaysOnTop +Disabled +E0x20 +LastFound
  302. Winset,TransColor, 0xFFFFFF
  303. Winset,Transparent, 190
  304.  
  305. ; some fucking initializers. Put these together later.
  306. toggle--
  307. toggleOverlay()
  308.  
  309. ;start the main loop. Gotta be last
  310. loopTimers()
  311.  
  312.  
  313. //functions
  314.  
  315. ;legacy now
  316. getVersion(){
  317. global macroVersion
  318. url := "http://api.lutbot.com:8080/version/"
  319. SetTimer, getVer, 1000
  320. FileDelete, version.html
  321. run "Lib\QDL.ahk" %url% "version.html"
  322. return
  323. getVer:
  324. IfExist, version.html
  325. {
  326. SetTimer, getVer, off
  327. FileRead, newestVersion, version.html
  328.  
  329. if ( macroVersion < newestVersion ) {
  330. UrlDownloadToFile, http://lutbot.com/ahk/changelog.txt, changelog.txt
  331. if ErrorLevel
  332. error("ED08")
  333. Gui, 4:Add, Text,, Update Available.`nYoure running version %macroVersion%. The newest is version %newestVersion%`nThis is either a bug fix, or I added something new.`nCan I download it for you? It will only take a moment, and the script will automatically restart with the latest version.
  334. FileRead, changelog, changelog.txt
  335. Gui, 4:Add, Edit, w600 h200 +ReadOnly, %changelog%
  336. Gui, 4:Add, Button, section default grunUpdate, Update
  337. Gui, 4:Add, Button, ys gdontUpdate, Skip Update
  338. Gui, 4:Show
  339. }
  340. } else {
  341. return
  342. }
  343. return
  344. }
  345.  
  346. getLeagueListing() {
  347. global
  348. SetTimer, loadLeague, 1000
  349. run "Lib\QDL.ahk" "http://api.lutbot.com:8080/ladders" "leagues.json"
  350. return
  351. loadLeague:
  352. IfExist, leagues.json
  353. {
  354. SetTimer, loadLeague, off
  355. FileRead, leagues, leagues.json
  356.  
  357. regexLocation := 1
  358. arrayCount := 0
  359. newStart := 0
  360.  
  361. While regexLocation
  362. {
  363. regexLocation := RegExMatch( leagues, """([A-z_]+)""", regexString, regexLocation+1)
  364. if regexLocation != 0
  365. {
  366. if !leagueString
  367. leagueString = %regexString1%
  368. else
  369. leagueString .= "|" . regexString1
  370. }
  371. }
  372. GuiControl,2:, guiLeague, %leagueString%
  373. GuiControl,2:ChooseString, guiLeague, %league%
  374. }
  375. return
  376. }
  377.  
  378. superLogoutCommand(){
  379. superLogoutCommand:
  380. logoutCommand()
  381. return
  382. }
  383.  
  384. logoutCommand(){
  385. global executable, backupExe
  386. logoutCommand:
  387. succ := logout(executable)
  388. if (succ == 0) {
  389. newSucc := logout(backupExe)
  390. error("ED12",executable,backupExe)
  391. if (newSucc == 0) {
  392. error("ED13")
  393. }
  394. }
  395. return
  396. }
  397.  
  398. cportsLogout(){
  399. global cportsCommand, lastlogout
  400. start := A_TickCount
  401. ltime := lastlogout + 1000
  402. if ( ltime < A_TickCount ) {
  403. RunWait, %cportsCommand%
  404. lastlogout := A_TickCount
  405. }
  406. Sleep 10
  407. error("nb:" . A_TickCount - start)
  408. return
  409. }
  410.  
  411. logout(executable){
  412. global GetTable, SetEntry, EnumProcesses, OpenProcessToken, LookupPrivilegeValue, AdjustTokenPrivileges, loadedPsapi
  413. start := A_TickCount
  414. poePID := Object()
  415. s := 4096
  416. Process, Exist
  417. h := DllCall("OpenProcess", "UInt", 0x0400, "Int", false, "UInt", ErrorLevel, "Ptr")
  418.  
  419. DllCall(OpenProcessToken, "Ptr", h, "UInt", 32, "PtrP", t)
  420. VarSetCapacity(ti, 16, 0)
  421. NumPut(1, ti, 0, "UInt")
  422.  
  423. DllCall(LookupPrivilegeValue, "Ptr", 0, "Str", "SeDebugPrivilege", "Int64P", luid)
  424. NumPut(luid, ti, 4, "Int64")
  425. NumPut(2, ti, 12, "UInt")
  426.  
  427. r := DllCall(AdjustTokenPrivileges, "Ptr", t, "Int", false, "Ptr", &ti, "UInt", 0, "Ptr", 0, "Ptr", 0)
  428. DllCall("CloseHandle", "Ptr", t)
  429. DllCall("CloseHandle", "Ptr", h)
  430.  
  431. s := VarSetCapacity(a, s)
  432. c := 0
  433. DllCall(EnumProcesses, "Ptr", &a, "UInt", s, "UIntP", r)
  434. Loop, % r // 4
  435. {
  436. id := NumGet(a, A_Index * 4, "UInt")
  437.  
  438. h := DllCall("OpenProcess", "UInt", 0x0010 | 0x0400, "Int", false, "UInt", id, "Ptr")
  439.  
  440. if !h
  441. continue
  442. VarSetCapacity(n, s, 0)
  443. e := DllCall("Psapi\GetModuleBaseName", "Ptr", h, "Ptr", 0, "Str", n, "UInt", A_IsUnicode ? s//2 : s)
  444. if !e
  445. if e := DllCall("Psapi\GetProcessImageFileName", "Ptr", h, "Str", n, "UInt", A_IsUnicode ? s//2 : s)
  446. SplitPath n, n
  447. DllCall("CloseHandle", "Ptr", h)
  448. if (n && e)
  449. if (n == executable) {
  450. poePID.Insert(id)
  451. }
  452. }
  453.  
  454. l := poePID.Length()
  455. if ( l = 0 ) {
  456. Process, wait, %executable%, 0.2
  457. if ( ErrorLevel > 0 ) {
  458. poePID.Insert(ErrorLevel)
  459. }
  460. }
  461.  
  462. VarSetCapacity(dwSize, 4, 0)
  463. result := DllCall(GetTable, UInt, &TcpTable, UInt, &dwSize, UInt, 0, UInt, 2, UInt, 5, UInt, 0)
  464. VarSetCapacity(TcpTable, NumGet(dwSize), 0)
  465.  
  466. result := DllCall(GetTable, UInt, &TcpTable, UInt, &dwSize, UInt, 0, UInt, 2, UInt, 5, UInt, 0)
  467.  
  468. num := NumGet(&TcpTable,0,"UInt")
  469.  
  470. IfEqual, num, 0
  471. {
  472. cportsLogout()
  473. error("ED11",num,l,executable)
  474. return False
  475. }
  476.  
  477. out := 0
  478. Loop %num%
  479. {
  480. cutby := a_index - 1
  481. cutby *= 24
  482. ownerPID := NumGet(&TcpTable,cutby+24,"UInt")
  483. for index, element in poePID {
  484. if ( ownerPID = element )
  485. {
  486. VarSetCapacity(newEntry, 20, 0)
  487. NumPut(12,&newEntry,0,"UInt")
  488. NumPut(NumGet(&TcpTable,cutby+8,"UInt"),&newEntry,4,"UInt")
  489. NumPut(NumGet(&TcpTable,cutby+12,"UInt"),&newEntry,8,"UInt")
  490. NumPut(NumGet(&TcpTable,cutby+16,"UInt"),&newEntry,12,"UInt")
  491. NumPut(NumGet(&TcpTable,cutby+20,"UInt"),&newEntry,16,"UInt")
  492. result := DllCall(SetEntry, UInt, &newEntry)
  493. IfNotEqual, result, 0
  494. {
  495. cportsLogout()
  496. error("TCP" . result,out,result,l,executable)
  497. return False
  498. }
  499. out++
  500. }
  501. }
  502. }
  503. if ( out = 0 ) {
  504. cportsLogout()
  505. error("ED10",out,l,executable)
  506. return False
  507. } else {
  508. error(l . ":" . A_TickCount - start,out,l,executable)
  509. }
  510. return True
  511. }
  512.  
  513. error(var,var2:="",var3:="",var4:="",var5:="",var6:="",var7:="") {
  514. GuiControl,1:, guiErr, %var%
  515. print := A_Now . "," . var . "," . var2 . "," . var3 . "," . var4 . "," . var5 . "," . var6 . "," . var7 . "`n"
  516. FileAppend, %print%, error.txt, UTF-16
  517. return
  518. }
  519.  
  520. invite(){
  521. inviteCommand:
  522. BlockInput On
  523. Send ^{Enter}{Home}{Delete}/invite {Enter}
  524. BlockInput Off
  525. return
  526. }
  527.  
  528. oosCommand(){
  529. oosCommand:
  530. BlockInput On
  531. SendInput, {enter}
  532. Sleep 2
  533. SendInput, {/}oos
  534. SendInput, {enter}
  535. BlockInput Off
  536. return
  537. }
  538.  
  539. remaining(){
  540. remainingCommand:
  541. BlockInput On
  542. SendInput, {enter}
  543. Sleep 2
  544. SendInput, {/}remaining
  545. SendInput, {enter}
  546. BlockInput Off
  547. return
  548. }
  549.  
  550. whois(){
  551. whoisCommand:
  552. BlockInput On
  553. Send ^{Enter}{Home}{Delete}/whois {Enter}
  554. BlockInput Off
  555. return
  556. }
  557.  
  558. hideout(){
  559. hideoutCommand:
  560. BlockInput On
  561. SendInput, {Enter}
  562. Sleep 2
  563. SendInput, {/}hideout
  564. SendInput, {Enter}
  565. BlockInput Off
  566. return
  567. }
  568.  
  569. whisperCommand1:
  570. BlockInput On
  571. Sleep 2
  572. SendInput ^{Enter}
  573. SendInput %wm1%
  574. SendInput {Enter}
  575. BlockInput Off
  576. return
  577. whisperCommand2:
  578. BlockInput On
  579. Sleep 2
  580. SendInput ^{Enter}
  581. SendInput %wm2%
  582. SendInput {Enter}
  583. BlockInput Off
  584. return
  585. whisperCommand3:
  586. BlockInput On
  587. Sleep 2
  588. SendInput ^{Enter}
  589. SendInput %wm3%
  590. SendInput {Enter}
  591. BlockInput Off
  592. return
  593. whisperCommand4:
  594. BlockInput On
  595. Sleep 2
  596. SendInput ^{Enter}
  597. SendInput %wm4%
  598. SendInput {Enter}
  599. BlockInput Off
  600. return
  601. whisperCommand5:
  602. BlockInput On
  603. Sleep 2
  604. SendInput ^{Enter}
  605. SendInput %wm5%
  606. SendInput {Enter}
  607. BlockInput Off
  608. return
  609. partyCommand1:
  610. BlockInput On
  611. Sleep 2
  612. SendInput {Enter}
  613. SendInput ^A{BS}
  614. SendRaw %pm1%
  615. SendInput {Enter}
  616. BlockInput Off
  617. return
  618. partyCommand2:
  619. BlockInput On
  620. Sleep 2
  621. SendInput {Enter}
  622. SendInput ^A{BS}
  623. SendRaw %pm2%
  624. SendInput {Enter}
  625. BlockInput Off
  626. return
  627. partyCommand3:
  628. BlockInput On
  629. Sleep 2
  630. SendInput {Enter}
  631. SendInput ^A{BS}
  632. SendRaw %pm3%
  633. SendInput {Enter}
  634. BlockInput Off
  635. return
  636. partyCommand4:
  637. BlockInput On
  638. Sleep 2
  639. SendInput {Enter}
  640. SendInput ^A{BS}
  641. SendRaw %pm4%
  642. SendInput {Enter}
  643. BlockInput Off
  644. return
  645. partyCommand5:
  646. BlockInput On
  647. Sleep 2
  648. SendInput {Enter}
  649. SendInput ^A{BS}
  650. SendRaw %pm5%
  651. SendInput {Enter}
  652. BlockInput Off
  653. return
  654. partyCommand6:
  655. BlockInput On
  656. Sleep 2
  657. SendInput {Enter}
  658. SendInput ^A{BS}
  659. SendRaw %pm6%
  660. SendInput {Enter}
  661. BlockInput Off
  662. return
  663. partyCommand7:
  664. BlockInput On
  665. Sleep 2
  666. SendInput {Enter}
  667. SendInput ^A{BS}
  668. SendRaw %pm7%
  669. SendInput {Enter}
  670. BlockInput Off
  671. return
  672. partyCommand8:
  673. BlockInput On
  674. Sleep 2
  675. SendInput {Enter}
  676. SendInput ^A{BS}
  677. SendRaw %pm8%
  678. SendInput {Enter}
  679. BlockInput Off
  680. return
  681. partyCommand9:
  682. BlockInput On
  683. Sleep 2
  684. SendInput {Enter}
  685. SendInput ^A{BS}
  686. SendRaw %pm9%
  687. SendInput {Enter}
  688. BlockInput Off
  689. return
  690. partyCommand10:
  691. BlockInput On
  692. Sleep 2
  693. SendInput {Enter}
  694. SendInput ^A{BS}
  695. SendRaw %pm10%
  696. SendInput {Enter}
  697. BlockInput Off
  698. return
  699.  
  700. browseForLogFile:
  701. FileSelectFile, logFileLocation,, , Navigate to C:\Program Files (x86)\Grinding Gear Games\Path of Exile\logs, Text Documents (*.txt; *.log)
  702. GuiControl,2:, guiLogFileLocation, %logFileLocation%
  703. return
  704.  
  705. changelogGui(){
  706. changelogGui:
  707. FileRead, changelog, changelog.txt
  708. Gui, 3:Add, Edit, w600 h200 +ReadOnly, %changelog%
  709. Gui, 3:Show
  710. return
  711. }
  712.  
  713. playSound:
  714. Gui, 2:Submit, nohide
  715. SoundPlay, %guiSoundSelector%
  716. return
  717.  
  718. toggleOverlay(){
  719. toggleOverlayCommand:
  720. global toggle
  721. toggle++
  722. if toggle > 1
  723. toggle := -1
  724. if toggle = -1
  725. {
  726. Gui, 1:Hide
  727. }
  728. if toggle = 0
  729. {
  730. ;Gui, 1:Show, h75 NA
  731. Gui, 1:Show, h30 NA
  732. }
  733. if toggle = 1
  734. {
  735. ;Gui, 1:Show, h46 NA
  736. Gui, 1:Show, h30 NA
  737. }
  738. return
  739. }
  740.  
  741. preloadCports(){
  742. global preloadCportsTimer, basePreloadCportsTimer, preloadCportsCall
  743. Run, %preloadCportsCall%
  744. preloadCportsTimer := basePreloadCportsTimer
  745. }
  746.  
  747. checkOverlay(){
  748. global overlayTimer, baseOverlayTimer, toggle, xOffset, yOffset, processWarningFound
  749. if toggle != -1
  750. {
  751. IfWinActive Path of Exile
  752. {
  753. WinGetActiveStats,name,width,height,x,y
  754. width += x
  755. width += xOffset
  756. hh := y
  757. hh += yOffset
  758. if toggle = 2
  759. {
  760. width /= 2
  761. width -= 295
  762. height /= 2
  763. height -= 325
  764. Gui, 5:Show, y%height% x%width% NA
  765. }
  766. if ( toggle = 1 ) || ( toggle = 0 )
  767. {
  768. width -= 231
  769. Gui, 1:Show, y%hh% x%width% NA
  770. }
  771. if ( processWarningFound > 0 )
  772. {
  773. Gui, 6:Show, x0 y0 NA
  774. } else {
  775. Gui, 6:Hide
  776. }
  777. } else {
  778. Gui, 1:Hide
  779. Gui, 5:Hide
  780. Gui, 6:Hide
  781. }
  782. }
  783. overlayTimer := baseOverlayTimer
  784. return
  785. }
  786.  
  787. checkActiveType() {
  788. global verifyLogoutTimer, baseVerifyLogoutTimer, executable, processWarningFound, backupExe
  789. val := 0
  790. Process, Exist, %executable%
  791. if !ErrorLevel
  792. {
  793. WinGet, id, list,Path of Exile,, Program Manager
  794. Loop, %id%
  795. {
  796. this_id := id%A_Index%
  797. WinGet, this_name, ProcessName, ahk_id %this_id%
  798. backupExe := this_name
  799. found .= " " . this_name
  800. val++
  801. }
  802.  
  803. if ( val > 0 )
  804. {
  805. processWarningFound := 1
  806. berrmsg .= "Detected executable(s) running:" . found . ", Executable expected: " . executable . ""
  807. } else {
  808. processWarningFound := 0
  809. backupExe := "No issues detected"
  810. }
  811.  
  812. GuiControl,6:, backupErrorMessage, %berrmsg%
  813. }
  814.  
  815. verifyLogoutTimer := baseVerifyLogoutTimer
  816. return
  817. }
  818.  
  819. runUpdate(){
  820. global
  821. runUpdate:
  822. UrlDownloadToFile, http://lutbot.com/ahk/macro.ahk, %A_ScriptFullPath%
  823. if ErrorLevel {
  824. error("update","fail",A_ScriptFullPath, macroVersion, A_AhkVersion)
  825. error("ED07")
  826. }
  827. else {
  828. error("update","pass",A_ScriptFullPath, macroVersion, A_AhkVersion)
  829. Run "%A_ScriptFullPath%"
  830. }
  831. Sleep 5000 ;This shouldn't ever hit.
  832. error("update","uhoh", A_ScriptFullPath, macroVersion, A_AhkVersion)
  833. dontUpdate:
  834. Gui, 4:Destroy
  835. return
  836. }
  837.  
  838. checkForWhispers(){
  839. global logFileLocation, lastWhisperTimeRecieved, monitorWhispersTimer, monitorWhispersDelay, soundSelector
  840. FileRead, BIGFILE, %logFileLocation%
  841. StringGetPos, last25Location, BIGFILE,`n, R75
  842. StringTrimLeft, smallfile, BIGFILE, %last25Location%
  843.  
  844. regexLocation := 1
  845. arrayCount := 0
  846. newStart := 0
  847.  
  848. While regexLocation
  849. {
  850. regexLocation := RegExMatch( smallfile, "(\d\d\d\d.\d\d.\d\d \d\d:\d\d:\d\d)(?:.*)\[INFO Client \d+\] \@(.*)", regexString, regexLocation+1)
  851. if regexLocation != 0
  852. {
  853. time%arrayCount% := regexString1
  854. s%arrayCount% := regexString2
  855. arrayCount++
  856. }
  857. }
  858.  
  859.  
  860. loopCounter := 0
  861. lnum := arrayCount-1
  862. displayStart := arrayCount
  863. d = :::
  864. while loopCounter < arrayCount
  865. {
  866. if ( time%loopCounter% > lastWhisperTimeRecieved )
  867. {
  868. displayStart := loopCounter
  869. goto breakWhisperTimes
  870. }
  871. loopCounter++
  872. }
  873. breakWhisperTimes:
  874. if( lnum < 0)
  875. lnum := 0
  876. lastWhisperTimeRecieved := time%lnum%
  877. displayString := ""
  878. iterations := arrayCount - displayStart
  879. loopCounter := arrayCount
  880.  
  881. while loopCounter > displayStart
  882. {
  883. loopCounter--
  884. displayString .= s%loopCounter% . "`n"
  885. }
  886.  
  887. IfWinNotActive Path of Exile
  888. if iterations > 0
  889. {
  890. TrayTip, New Messages: `(%iterations%`), %displayString%
  891. SoundPlay, %soundSelector%
  892. }
  893. monitorWhispersTimer := monitorWhispersDelay
  894. return
  895. }
  896.  
  897. loopTimers(){
  898. global
  899. Loop {
  900. if ( overlayTimerActive = true )
  901. overlayTimer -= sleepTime
  902. if ( updateTrackingTimerActive = true )
  903. updateTrackingTimer -= sleepTime
  904. if ( monitorWhispers )
  905. monitorWhispersTimer -= sleepTime
  906. if ( !beta )
  907. preloadCportsTimer -= sleepTime
  908.  
  909. verifyLogoutTimer -= sleepTime
  910.  
  911. if ( overlayTimer <= 0 ) && ( overlayTimerActive = true )
  912. {
  913. checkOverlay()
  914. }
  915.  
  916. if ( updateTrackingTimer <= 0 ) && ( updateTrackingTimerActive = true )
  917. {
  918. IfWinExist, Path of Exile
  919. updateTracking()
  920. else
  921. updateTrackingTimer := 60000
  922. }
  923.  
  924. if ( monitorWhispersTimer <= 0 ) && ( monitorWhispers )
  925. {
  926. IfWinExist, Path of Exile
  927. checkForWhispers()
  928. }
  929.  
  930. if ( preloadCportsTimer <= 0 )
  931. {
  932. IfWinExist, Path of Exile
  933. preloadCports()
  934. else
  935. preloadCportsTimer := basePreloadCportsTimer
  936. }
  937.  
  938. if ( verifyLogoutTimer <= 0 )
  939. {
  940. IfWinExist, Path of Exile
  941. checkActiveType()
  942. }
  943.  
  944. Sleep sleepTime
  945. }
  946. return
  947. }
  948.  
  949. updateTracking(){
  950. global charName, league, updateTrackingTimer, baseUpdateTrackingTimer, lastUpdated, toggle
  951. updateTrackingTimer := baseUpdateTrackingTimer ; Wait the base time
  952.  
  953. if ( toggle < 0 ) {
  954. return
  955. }
  956.  
  957. url := "http://api.lutbot.com:8080/rank/" . league . "/" . charName . ""
  958. SetTimer, loadLadder, 1000
  959. FileDelete, ladder.json
  960. run "Lib\QDL.ahk" %url% "ladder.json"
  961. return
  962. loadLadder:
  963. rank := ""
  964. IfExist, ladder.json
  965. {
  966. SetTimer, loadLadder, off
  967. FileRead, ladderString, ladder.json
  968. if ( ladderString = "0" ) {
  969. rank := "Unranked"
  970. } else {
  971. rank := "Rank: "
  972. rank .= ladderString
  973. }
  974. GuiControl,1:, guiRank, %rank%
  975. } else {
  976. return
  977. }
  978. return
  979. }
  980.  
  981. hotkeys(){
  982. optionsCommand:
  983. global
  984. Gui, 2:Show,, Macro Settings Version %macroVersion% :: AHK Version %A_AhkVersion%
  985. processWarningFound := 0
  986. Gui, 6:Hide
  987. return
  988. }
  989.  
  990. submit(){
  991. updateHotkeys:
  992. global
  993. Gui, 2:Submit
  994. updsettings := "[variables]`n"
  995. updsettings .= "CharacterName=" . guiChar . "`n"
  996. updsettings .= "League=" . guiLeague . "`n"
  997. updsettings .= "PoeSteam=" . guiSteam . "`n"
  998. updsettings .= "UpdateTimer=" . guiUpdate . "`n"
  999. updsettings .= "XOffset=" . guiXOffset . "`n"
  1000. updsettings .= "YOffset=" . guiYOffset . "`n"
  1001. updsettings .= "MonitorWhispers=" . guiMonitorWhispers . "`n"
  1002. updsettings .= "MonitorWhispersDelay=" . guiMonitorWhispersDelay . "`n"
  1003. updsettings .= "LogFileLocation=" . logFileLocation . "`n"
  1004. updsettings .= "OverlayToggle=" . toggle . "`n"
  1005. updsettings .= "SoundSelector=" . guiSoundSelector . "`n"
  1006. updsettings .= "Beta=" . guibeta . "`n"
  1007. updsettings .= "HighBits=" . guihighBits . "`n"
  1008. updsettings .= "Diablo2=" . guidiablo2 . "`n"
  1009. updsettings .= "[whisperMessages]`n"
  1010. updsettings .= "wm1=" . guiwm1 . "`n"
  1011. updsettings .= "wm2=" . guiwm2 . "`n"
  1012. updsettings .= "wm3=" . guiwm3 . "`n"
  1013. updsettings .= "wm4=" . guiwm4 . "`n"
  1014. updsettings .= "wm5=" . guiwm5 . "`n"
  1015. updsettings .= "[partyMessages]`n"
  1016. updsettings .= "pm1=" . guipm1 . "`n"
  1017. updsettings .= "pm2=" . guipm2 . "`n"
  1018. updsettings .= "pm3=" . guipm3 . "`n"
  1019. updsettings .= "pm4=" . guipm4 . "`n"
  1020. updsettings .= "pm5=" . guipm5 . "`n"
  1021. updsettings .= "pm6=" . guipm6 . "`n"
  1022. updsettings .= "pm7=" . guipm7 . "`n"
  1023. updsettings .= "pm8=" . guipm8 . "`n"
  1024. updsettings .= "pm9=" . guipm9 . "`n"
  1025. updsettings .= "pm10=" . guipm10 . "`n"
  1026. updsettings .= "[hotkeys]`n"
  1027. updsettings .= "logout=" . guihotkeyLogout . "`n"
  1028. updsettings .= "superLogout=" . guihotkeySuperLogout . "`n"
  1029. updsettings .= "oos=" . guihotkeyOos . "`n"
  1030. updsettings .= "remaining=" . guihotkeyRemaining . "`n"
  1031. updsettings .= "whois=" . guihotkeyWhois . "`n"
  1032. updsettings .= "hideout=" . guihotkeyHideout . "`n"
  1033. updsettings .= "invite=" . guihotkeyInvite . "`n"
  1034. updsettings .= "toggleOverlay=" . guihotkeyToggleOverlay . "`n"
  1035. updsettings .= "options=" . guihotkeyOptions . "`n"
  1036. updsettings .= "wm1=" . guihotkeywm1 . "`n"
  1037. updsettings .= "wm2=" . guihotkeywm2 . "`n"
  1038. updsettings .= "wm3=" . guihotkeywm3 . "`n"
  1039. updsettings .= "wm4=" . guihotkeywm4 . "`n"
  1040. updsettings .= "wm5=" . guihotkeywm5 . "`n"
  1041. updsettings .= "pm1=" . guihotkeypm1 . "`n"
  1042. updsettings .= "pm2=" . guihotkeypm2 . "`n"
  1043. updsettings .= "pm3=" . guihotkeypm3 . "`n"
  1044. updsettings .= "pm4=" . guihotkeypm4 . "`n"
  1045. updsettings .= "pm5=" . guihotkeypm5 . "`n"
  1046. updsettings .= "pm6=" . guihotkeypm6 . "`n"
  1047. updsettings .= "pm7=" . guihotkeypm7 . "`n"
  1048. updsettings .= "pm8=" . guihotkeypm8 . "`n"
  1049. updsettings .= "pm9=" . guihotkeypm9 . "`n"
  1050. updsettings .= "pm10=" . guihotkeypm10
  1051.  
  1052. FileDelete settings.ini
  1053. FileAppend, %updsettings%, settings.ini, UTF-16
  1054.  
  1055. readFromFile()
  1056. checkActiveType()
  1057.  
  1058. return
  1059. }
  1060.  
  1061. updateFiles(){
  1062.  
  1063. }
  1064.  
  1065. readFromFile(){
  1066. global
  1067. ;reset hotkeys ughh.
  1068. Hotkey, IfWinActive, Path of Exile
  1069. If hotkeyLogout
  1070. Hotkey,% hotkeyLogout, logoutCommand, Off
  1071. If hotkeyOos
  1072. Hotkey,% hotkeyOos, oosCommand, Off
  1073. If hotkeyRemaining
  1074. Hotkey,% hotkeyRemaining, remainingCommand, Off
  1075. If hotkeyWhois
  1076. Hotkey,% hotkeyWhois, whoisCommand, Off
  1077. If hotkeyHideout
  1078. Hotkey,% hotkeyHideout, hideoutCommand, Off
  1079. If hotkeyInvite
  1080. Hotkey,% hotkeyInvite, inviteCommand, Off
  1081. If hotkeyToggleOverlay
  1082. Hotkey,% hotkeyToggleOverlay, toggleOverlayCommand, Off
  1083. If hotkeywm1
  1084. Hotkey,% hotkeywm1, whisperCommand1, Off
  1085. If hotkeywm2
  1086. Hotkey,% hotkeywm2, whisperCommand1, Off
  1087. If hotkeywm3
  1088. Hotkey,% hotkeywm3, whisperCommand1, Off
  1089. If hotkeywm4
  1090. Hotkey,% hotkeywm4, whisperCommand1, Off
  1091. If hotkeywm5
  1092. Hotkey,% hotkeywm5, whisperCommand1, Off
  1093. If hotkeypm1
  1094. Hotkey,% hotkeypm1, partyCommand1, Off
  1095. If hotkeypm2
  1096. Hotkey,% hotkeypm2, partyCommand2, Off
  1097. If hotkeypm3
  1098. Hotkey,% hotkeypm3, partyCommand3, Off
  1099. If hotkeypm4
  1100. Hotkey,% hotkeypm4, partyCommand4, Off
  1101. If hotkeypm5
  1102. Hotkey,% hotkeypm5, partyCommand5, Off
  1103. If hotkeypm6
  1104. Hotkey,% hotkeypm6, partyCommand6, Off
  1105. If hotkeypm7
  1106. Hotkey,% hotkeypm7, partyCommand7, Off
  1107. If hotkeypm8
  1108. Hotkey,% hotkeypm8, partyCommand8, Off
  1109. If hotkeypm9
  1110. Hotkey,% hotkeypm9, partyCommand9, Off
  1111. If hotkeypm10
  1112. Hotkey,% hotkeypm10, partyCommand10, Off
  1113.  
  1114. Hotkey, IfWinActive
  1115. If hotkeyOptions
  1116. Hotkey,% hotkeyOptions, optionsCommand, Off
  1117. If hotkeySuperLogout
  1118. Hotkey,% hotkeySuperLogout, superLogoutCommand, Off
  1119. Hotkey, IfWinActive, Path of Exile
  1120.  
  1121. ; variables
  1122. IniRead, charName, settings.ini, variables, CharacterName
  1123. IniRead, league, settings.ini, variables, League
  1124. IniRead, steam, settings.ini, variables, PoeSteam
  1125. IniRead, sleepTime, settings.ini, variables, UpdateTimer
  1126. IniRead, xOffset, settings.ini, variables, XOffset
  1127. IniRead, yOffset, settings.ini, variables, YOffset
  1128. IniRead, monitorWhispers, settings.ini, variables, MonitorWhispers
  1129. IniRead, monitorWhispersDelay, settings.ini, variables, MonitorWhispersDelay
  1130. IniRead, logFileLocation, settings.ini, variables, LogFileLocation
  1131. IniRead, toggle, settings.ini, variables, OverlayToggle
  1132. IniRead, soundSelector, settings.ini, variables, SoundSelector
  1133. IniRead, beta, settings.ini, variables, Beta
  1134. IniRead, highBits, settings.ini, variables, HighBits
  1135. IniRead, diablo2, settings.ini, variables, Diablo2
  1136. ; whisper messages
  1137. IniRead, wm1, settings.ini, whisperMessages, wm1
  1138. IniRead, wm2, settings.ini, whisperMessages, wm2
  1139. IniRead, wm3, settings.ini, whisperMessages, wm3
  1140. IniRead, wm4, settings.ini, whisperMessages, wm4
  1141. IniRead, wm5, settings.ini, whisperMessages, wm5
  1142. ;party messages
  1143. IniRead, pm1, settings.ini, partyMessages, pm1
  1144. IniRead, pm2, settings.ini, partyMessages, pm2
  1145. IniRead, pm3, settings.ini, partyMessages, pm3
  1146. IniRead, pm4, settings.ini, partyMessages, pm4
  1147. IniRead, pm5, settings.ini, partyMessages, pm5
  1148. IniRead, pm6, settings.ini, partyMessages, pm6
  1149. IniRead, pm7, settings.ini, partyMessages, pm7
  1150. IniRead, pm8, settings.ini, partyMessages, pm8
  1151. IniRead, pm9, settings.ini, partyMessages, pm9
  1152. IniRead, pm10, settings.ini, partyMessages, pm10
  1153. ;hotkeys
  1154. IniRead, hotkeyLogout, settings.ini, hotkeys, logout, %A_Space%
  1155. IniRead, hotkeySuperLogout, settings.ini, hotkeys, superLogout, %A_Space%
  1156. IniRead, hotkeyOos, settings.ini, hotkeys, oos, %A_Space%
  1157. IniRead, hotkeyRemaining, settings.ini, hotkeys, remaining, %A_Space%
  1158. IniRead, hotkeyWhois, settings.ini, hotkeys, whois, %A_Space%
  1159. IniRead, hotkeyHideout, settings.ini, hotkeys, hideout, %A_Space%
  1160. IniRead, hotkeyInvite, settings.ini, hotkeys, invite, %A_Space%
  1161. IniRead, hotkeyToggleOverlay, settings.ini, hotkeys, toggleOverlay, %A_Space%
  1162. IniRead, hotkeyOptions, settings.ini, hotkeys, options, %A_Space%
  1163. IniRead, hotkeywm1, settings.ini, hotkeys, wm1, %A_Space%
  1164. IniRead, hotkeywm2, settings.ini, hotkeys, wm2, %A_Space%
  1165. IniRead, hotkeywm3, settings.ini, hotkeys, wm3, %A_Space%
  1166. IniRead, hotkeywm4, settings.ini, hotkeys, wm4, %A_Space%
  1167. IniRead, hotkeywm5, settings.ini, hotkeys, wm5, %A_Space%
  1168. IniRead, hotkeypm1, settings.ini, hotkeys, pm1, %A_Space%
  1169. IniRead, hotkeypm2, settings.ini, hotkeys, pm2, %A_Space%
  1170. IniRead, hotkeypm3, settings.ini, hotkeys, pm3, %A_Space%
  1171. IniRead, hotkeypm4, settings.ini, hotkeys, pm4, %A_Space%
  1172. IniRead, hotkeypm5, settings.ini, hotkeys, pm5, %A_Space%
  1173. IniRead, hotkeypm6, settings.ini, hotkeys, pm6, %A_Space%
  1174. IniRead, hotkeypm7, settings.ini, hotkeys, pm7, %A_Space%
  1175. IniRead, hotkeypm8, settings.ini, hotkeys, pm8, %A_Space%
  1176. IniRead, hotkeypm9, settings.ini, hotkeys, pm9, %A_Space%
  1177. IniRead, hotkeypm10, settings.ini, hotkeys, pm10, %A_Space%
  1178.  
  1179. Hotkey, IfWinActive, Path of Exile
  1180. If hotkeyLogout
  1181. Hotkey,% hotkeyLogout, logoutCommand, On
  1182. If hotkeyOos
  1183. Hotkey,% hotkeyOos, oosCommand, On
  1184. If hotkeyRemaining
  1185. Hotkey,% hotkeyRemaining, remainingCommand, On
  1186. If hotkeyWhois
  1187. Hotkey,% hotkeyWhois, whoisCommand, On
  1188. If hotkeyHideout
  1189. Hotkey,% hotkeyHideout, hideoutCommand, On
  1190. If hotkeyInvite
  1191. Hotkey,% hotkeyInvite, inviteCommand, On
  1192. If hotkeyToggleOverlay
  1193. Hotkey,% hotkeyToggleOverlay, toggleOverlayCommand, On
  1194. If hotkeywm1
  1195. Hotkey,% hotkeywm1, whisperCommand1, On
  1196. If hotkeywm2
  1197. Hotkey,% hotkeywm2, whisperCommand2, On
  1198. If hotkeywm3
  1199. Hotkey,% hotkeywm3, whisperCommand3, On
  1200. If hotkeywm4
  1201. Hotkey,% hotkeywm4, whisperCommand4, On
  1202. If hotkeywm5
  1203. Hotkey,% hotkeywm5, whisperCommand5, On
  1204. If hotkeypm1
  1205. Hotkey,% hotkeypm1, partyCommand1, On
  1206. If hotkeypm2
  1207. Hotkey,% hotkeypm2, partyCommand2, On
  1208. If hotkeypm3
  1209. Hotkey,% hotkeypm3, partyCommand3, On
  1210. If hotkeypm4
  1211. Hotkey,% hotkeypm4, partyCommand4, On
  1212. If hotkeypm5
  1213. Hotkey,% hotkeypm5, partyCommand5, On
  1214. If hotkeypm6
  1215. Hotkey,% hotkeypm6, partyCommand6, On
  1216. If hotkeypm7
  1217. Hotkey,% hotkeypm7, partyCommand7, On
  1218. If hotkeypm8
  1219. Hotkey,% hotkeypm8, partyCommand8, On
  1220. If hotkeypm9
  1221. Hotkey,% hotkeypm9, partyCommand9, On
  1222. If hotkeypm10
  1223. Hotkey,% hotkeypm10, partyCommand10, On
  1224.  
  1225. Hotkey, IfWinActive
  1226. If hotkeyOptions
  1227. Hotkey,% hotkeyOptions, optionsCommand, On
  1228. else {
  1229. Hotkey,F10, optionsCommand, On
  1230. msgbox You dont have some hotkeys set!`nPlease hit F10 to open up your config prompt and please configure your hotkeys (Path of Exile has to be in focus).`nThe way you configure hotkeys is now in the GUI (default F10). Otherwise, you didn't put a hotkey for the options menu. You need that silly.
  1231. }
  1232. If hotkeySuperLogout
  1233. Hotkey,% hotkeySuperLogout, superLogoutCommand, On
  1234. Hotkey, IfWinActive, Path of Exile
  1235.  
  1236. ; extra checks
  1237.  
  1238. if monitorWhispers = ERROR
  1239. monitorWhispers := 0
  1240. if monitorWhispersDelay = ERROR
  1241. monitorWhispersDelay := 10000
  1242. if monitorWhispersDelay < 10000
  1243. monitorWhispersDelay := 10000
  1244. if beta = ERROR
  1245. beta = 0
  1246. if diablo2 = ERROR
  1247. diablo2 = 0
  1248. if steam = ERROR
  1249. steam = 0
  1250. if highBits = ERROR
  1251. highBits = 0
  1252.  
  1253. if ( steam ) {
  1254. if ( highBits ) {
  1255. cportsCommand := "cports.exe /close * * * * PathOfExile_x64Steam.exe"
  1256. executable := "PathOfExile_x64Steam.exe"
  1257. } else {
  1258. cportsCommand := "cports.exe /close * * * * PathOfExileSteam.exe"
  1259. executable := "PathOfExileSteam.exe"
  1260. }
  1261. } else {
  1262. if ( highBits ) {
  1263. cportsCommand := "cports.exe /close * * * * PathOfExile_x64.exe"
  1264. executable := "PathOfExile_x64.exe"
  1265. } else {
  1266. cportsCommand := "cports.exe /close * * * * PathOfExile.exe"
  1267. executable := "PathOfExile.exe"
  1268. }
  1269. }
  1270.  
  1271. if ( diablo2 ) {
  1272. cportsCommand := "cports.exe /close * * * * Game.exe"
  1273. executable := "Game.exe"
  1274. }
  1275.  
  1276. updateTrackingTimer := 5000
  1277. monitorWhispersTimer := monitorWhispersDelay
  1278. }
  1279.  
  1280. ; ; ERROR LIST
  1281. ; min lv = null : you typed in the league name wrong.
  1282. ; ED01 : Error downloading rank from http://exiletools.com/ , their server might be unavailible.
  1283. ; ED02 -> ED04 : Error downloading currports from my website. http://www.nirsoft.net/utils/cports.html holds the original file.
  1284. ; ED05 : Error downloading ladder stats from http://exiletools.com/ , their server might be unavailible.
  1285. ; ED06 : Error checking for new version.
  1286. ; ED07 : Error downloading newest version of ahk script.
  1287. ; ED08 : Error downloading newest changelog.
  1288. ; ED09 : Error downloading list of active leagues
  1289. ; ED10 : Logged out with cports No process
  1290. ; ED11 : Logged out with cports TcpTable Failure
  1291. ; ED12 : Invalid logout settings
  1292. ; ED13 : Total logout miss
Advertisement
Add Comment
Please, Sign In to add comment