Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Path of Exile AutoHotkey Script by Glyph - http://www.twitch.tv/glyph27
  2. ; Version "29-Aug-2014".
  3. ;
  4. ; This script aims to combine the best qualities of the POE hotkey scripts I could find online and
  5. ; modify them to be clearer and more performance-optimised when possible.
  6. ;
  7. ; Distribute and modify this script however you please. This code is provided without any warranty,
  8. ; express or implied.
  9. ;
  10. ; Props to GGG for a great UI design that changes states without any delay. Most of these functions
  11. ; would require sleep commands and take a noticable amount of time.
  12.  
  13. ; INSTRUCTIONS:
  14. ;
  15. ; 1. Change the hotkeys below to whatever you like.
  16. ; 2. Search this file for "MODIFY THIS" and change anything accordingly.
  17.  
  18.  
  19. ; Key Bindings
  20. ;
  21. ; For more information about AutoHotkey key bindings, see :
  22. ; * http://www.autohotkey.com/docs/Hotkeys.htm
  23. ; * http://www.autohotkey.com/docs/KeyList.htm
  24.  
  25. ; Use global "#IfWinActive" instead of local "IfWinActive" so that hotkeys are not eaten by AHK.
  26. #IfWinActive, Path of Exile
  27.  
  28. Numpad0::PathOfExile_logout()
  29. NumpadIns::PathOfExile_logout()
  30.  
  31. `::PathOfExile_oos()
  32. ~::PathOfExile_oos()
  33.  
  34. F2::PathOfExile_remaining()
  35.  
  36. F3::PathOfExile_hideout()
  37.  
  38. F4::PathOfExile_itemlevel()
  39.  
  40. F5::PathOfExile_portal()
  41.  
  42.  
  43. ; Log the user out as fast as possible.
  44. PathOfExile_logout()
  45. {
  46. SendMode Input ; Ensures that MouseClick uses the fastest input mode.
  47.  
  48. BlockInput On
  49.  
  50. SendInput {Space}{Esc}
  51.  
  52. ; This code can automatically calculate where your logout button is based on your resolution,
  53. ; however, this seems (to me, and based on very few tests) to take a little bit longer to process
  54. ; and so instead of risking it I use the mouse coordiante click below. The reason for the delay,
  55. ; if there is any, is due to WinActivate or WinGetPos taking some time. I'm not sure if WinActivate
  56. ; can be omitted.
  57. ;WinActivate
  58. ;WinGetPos, , , Width, Height, A
  59.  
  60. ; Calculate position of "EXIT TO LOG IN SCREEN" button based on screen height.
  61. ;x := Width / 2
  62. ;y := Height * .403
  63. ;MouseClick, Left, x, y
  64.  
  65. ; If you are using this click technique, MODIFY THIS to the position of the desired logout or exit button.
  66. ; Set the first number to your screen's horizontal resolution divided by 2. Set the second number to your screen's
  67. ; vertical resolution multiplied by 0.403.
  68. MouseClick, Left, 1275, 580
  69.  
  70. BlockInput Off
  71. }
  72.  
  73. PathOfExile_oos()
  74. {
  75. BlockInput On
  76.  
  77. SendInput {Enter}/oos{Enter}
  78.  
  79. ; Enter party chat after command (instead of local).
  80. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  81.  
  82. BlockInput Off
  83. }
  84.  
  85. PathOfExile_remaining()
  86. {
  87. BlockInput On
  88.  
  89. SendInput {Enter}/remaining{Enter}
  90.  
  91. ; Enter party chat after command (instead of local).
  92. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  93.  
  94. BlockInput Off
  95. }
  96.  
  97. PathOfExile_hideout()
  98. {
  99. BlockInput On
  100.  
  101. SendInput {Enter}/hideout{Enter}
  102.  
  103. ; Enter party chat after command (instead of local).
  104. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  105.  
  106. BlockInput Off
  107. }
  108.  
  109. ; Checks item level of the held item.
  110. PathOfExile_itemlevel()
  111. {
  112. BlockInput On
  113.  
  114. SendInput {Enter}/itemlevel{Enter}
  115.  
  116. ; Enter party chat after command (instead of local).
  117. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  118.  
  119. BlockInput Off
  120. }
  121.  
  122. ; Casts town portal. MUST BE CONFIGURED for the location of your townportal scroll and your inventory hotkey.
  123. ; RIP my town portal scrolls from testing this method.
  124. PathOfExile_portal()
  125. {
  126. BlockInput On
  127.  
  128. MouseGetPos, x, y ; so that we can return the mouse to the original position after.
  129.  
  130. ; Send mouse button up commands if the mouse buttons are down, or else town portal will fail.
  131. GetKeyState, lbstate, LButton
  132. GetKeyState, rbstate, RButton
  133.  
  134. if lbstate = D
  135. SendInput {LButton Up}
  136.  
  137. if rbstate = D
  138. SendInput {RButton Up}
  139.  
  140. if lbstate = D or rbstate = D
  141. Sleep, 50
  142.  
  143. SendMode Input ; Ensures that MouseClick uses the fastest input mode.
  144.  
  145. SendInput f ; MODIFY THIS to your inventory hotkey.
  146.  
  147. Sleep, 50 ; Needed when inventory hasn't been opened on this map yet for some reason.
  148.  
  149. MouseClick, Right, 2500, 1100 ; MODIFY THIS to the position of your town portal scroll.
  150.  
  151. SendInput {Space}
  152.  
  153. ; Ensure that the mouse isn't moved back so fast that the portal doesn't get clicked.
  154. Sleep, 50
  155.  
  156. MouseMove, x, y
  157.  
  158. BlockInput Off
  159. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement