Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.40 KB | None | 0 0
  1. ; Path of Exile AutoHotkey Script by Glyph - http://www.twitch.tv/glyph27
  2. ; Version "29-March-2015".
  3. ;
  4. ; This script aims to combine the best features and qualities of the POE AutoHotkey scripts I've
  5. ; seen online and to be faster, more reliable, and clearer than any.
  6. ;
  7. ; Modify and distribute 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, otherwise.
  12.  
  13. ; Instructions - YOU _MUST_ FOLLOW THESE FOR TOWN PORTAL AND LOGOUT MACROS TO WORK!
  14. ;
  15. ; 1. Change the hotkeys below to whatever you like.
  16. ; 2. Search this file for "MODIFY THIS" and change anything accordingly.
  17. ; 3. Reload your AutoHotkey script.
  18. ;
  19. ; Windows7 and Windows8 users must run AHK as administrator or the script may be interrupted by
  20. ; user input.
  21.  
  22.  
  23. ; Key Bindings
  24. ;
  25. ; For more information about AutoHotkey key bindings, see :
  26. ; * http://www.autohotkey.com/docs/Hotkeys.htm
  27. ; * http://www.autohotkey.com/docs/KeyList.htm
  28. ;
  29. ;
  30. ; Default Hotkeys:
  31. ;
  32. ; Keypad 0 -> Logout to main menu as fast as possible.
  33. ; Mouse Forward -> Logout to main menu as fast as possible.
  34. ; ~ (Tilde key) -> Out of Sync hack. (/oos).
  35. ; F2 -> Remaining monsters. (/remaining).
  36. ; F3 -> Teleport to your hideout from town. (/hideout).
  37. ; F4 -> Report item level of held item. (/itemlevel).
  38. ; Ctrl-T -> Open a portal to town.
  39. ; Ctrl-Shift-T -> Open a portal to town and say "Portal Up".
  40. ; F9 -> Turn off/on other hoykeys, for example if you need to type the ~ character in
  41. ; chat etc. Note that all hotkeys only work in POE so you do not need to turn
  42. ; off hotkeys when alt-tabbing.
  43.  
  44. SetTitleMatchMode 3 ; Exact matching only.
  45.  
  46. #SingleInstance force
  47.  
  48. ; Use global "#IfWinActive" instead of local "IfWinActive" so that hotkeys are not eaten by AHK.
  49. #IfWinActive, Path of Exile
  50.  
  51. *Numpad0::PathOfExile_logout()
  52. *NumpadIns::PathOfExile_logout()
  53. *Xbutton2::PathOfExile_logout()
  54.  
  55. `::PathOfExile_oos()
  56. ~::PathOfExile_oos()
  57.  
  58. F2::PathOfExile_remaining()
  59.  
  60. F3::PathOfExile_hideout()
  61.  
  62. F4::PathOfExile_itemlevel()
  63.  
  64. ^T::PathOfExile_portal()
  65.  
  66. ^+T::PathOfExile_portalmessage()
  67.  
  68. F9::Suspend ; Enable / disable these hotkeys.
  69.  
  70.  
  71. ; Log the user out as fast as possible.
  72. PathOfExile_logout()
  73. {
  74. SendMode Input ; Ensures that MouseClick uses the fastest input mode.
  75.  
  76. BlockInput On
  77.  
  78. SendInput {Space}{Esc} ; MODIFY THIS so that {Space} is your "Close all Menus" hotkey.
  79. ; Closes the escape menu if it is open, and then opens it.
  80.  
  81. ; It is possible to automatically calculate where your logout button is located based on your
  82. ; resolution, however, this may take a little bit longer to process and I don't want to risk it.
  83. ; The reason for the delay, if there is any, is due to WinActivate or WinGetPos calls.
  84.  
  85. screenResolutionWidth := 2550. ; MODIFY THIS to your screen's horizontal resolution.
  86. screenResolutionHeight := 1440. ; MODIFY THIS to your screen's vertical resolution.
  87.  
  88. x := screenResolutionWidth * 0.5
  89. y := screenResolutionHeight * 0.403
  90.  
  91. MouseClick, Left, x, y
  92.  
  93. Sleep, 40 ; sometimes initial click does not trigger, do it again after delay
  94. MouseClick, Left, x, y
  95.  
  96. BlockInput Off
  97. }
  98.  
  99. PathOfExile_oos()
  100. {
  101. BlockInput On
  102.  
  103. SendInput {Enter}/oos{Enter}
  104.  
  105. ; Enter party chat after command (instead of local).
  106. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  107.  
  108. BlockInput Off
  109. }
  110.  
  111. PathOfExile_remaining()
  112. {
  113. BlockInput On
  114.  
  115. SendInput {Enter}/remaining{Enter}
  116.  
  117. ; Enter party chat after command (instead of local).
  118. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  119.  
  120. BlockInput Off
  121. }
  122.  
  123. PathOfExile_hideout()
  124. {
  125. BlockInput On
  126.  
  127. SendInput {Enter}/hideout{Enter}
  128.  
  129. ; Enter party chat after command (instead of local).
  130. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  131.  
  132. BlockInput Off
  133. }
  134.  
  135. ; Checks item level of the held item.
  136. ;
  137. ; This script does not support checking the item level of the hovered item because I can't find
  138. ; a way to do so reliably. When hovering over the edge of the item, the script would attempt to put
  139. ; the item back into an adjacent spot.
  140. PathOfExile_itemlevel()
  141. {
  142. BlockInput On
  143.  
  144. SendInput {Enter}/itemlevel{Enter}
  145.  
  146. ; Enter party chat after command (instead of local).
  147. SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  148.  
  149. BlockInput Off
  150. }
  151.  
  152. ; Casts town portal.
  153. ; RIP my town portal scrolls from testing this method.
  154. PathOfExile_portal()
  155. {
  156. BlockInput On
  157.  
  158. MouseGetPos, x, y ; so that we can return the mouse to the original position after.
  159.  
  160. SendMode Input ; Ensures that MouseClick uses the fastest input mode.
  161.  
  162. ; Send mouse button up commands if the mouse buttons are down, or else town portal will fail.
  163. GetKeyState, lbstate, LButton
  164. GetKeyState, rbstate, RButton
  165.  
  166. if lbstate = D
  167. SendInput {LButton Up}
  168.  
  169. if rbstate = D
  170. SendInput {RButton Up}
  171.  
  172. ; Wait for Mouse Button Up to register with game client.
  173. if lbstate = D or rbstate = D
  174. Sleep, 70
  175.  
  176. SendInput {v}{f} ; MODIFY THIS to your PASSIVE SKILL TREE MENU hotkey and INVENTORY hotkey. Passive
  177. ; skill tree is used so that TP works even when the inventory was already open.
  178.  
  179. Sleep, 100 ; Needed when inventory hasn't been opened on this map yet for whatever reason.
  180.  
  181. MouseMove, 2500, 1100 ; MODIFY THIS to the position of your town portal scroll.
  182.  
  183. Sleep, 70 ; Fixes this script to work as of 3/29/2015.
  184.  
  185. MouseClick, Right, 2500, 1100 ; MODIFY THIS to the position of your town portal scroll.
  186.  
  187. Sleep, 70 ; Fixes this script to work as of 3/29/2015.
  188.  
  189. SendInput {Space}
  190.  
  191. ; Ensure that the mouse isn't moved back so fast that the portal doesn't get clicked.
  192. Sleep, 70
  193.  
  194. MouseMove, x, y
  195.  
  196. BlockInput Off
  197. }
  198.  
  199. ; Send a message to party chat after opening a town portal.
  200. PathOfExile_portalmessage()
  201. {
  202. PathOfExile_portal()
  203.  
  204. BlockInput On
  205.  
  206. SendInput {Enter}{`%}Portal Up{Enter}
  207.  
  208. ; Change chat channel.
  209. ;SendInput {Enter}{`%}{Enter} ; Change the {'%} to {#} for global, etc.
  210.  
  211. BlockInput Off
  212. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement