Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. #SingleInstance force ;force a single instance
  2. #HotkeyInterval 0 ;disable the warning dialog if a key is held down
  3. #InstallKeybdHook ;Forces the unconditional installation of the keyboard hook
  4. #UseHook On ;might increase responsiveness of hotkeys
  5. #MaxThreads 20 ;use 20 (the max) instead of 10 threads
  6. SetBatchLines, -1 ;makes the script run at max speed
  7. SetKeyDelay , -1, -1 ;faster response (might be better with -1, 0)
  8. ;Thread, Interrupt , -1, -1 ;not sure what this does, could be bad for timers
  9. SetTitleMatchMode, 3 ;title Warcraft III must match exactly
  10. SetDefaultMouseSpeed, 0 ;Move the mouse faster for mouse moving commands
  11.  
  12. IfExist, Warcraft III.ico
  13. menu, tray, Icon, Warcraft III.ico, 1, 1
  14.  
  15.  
  16. ;;;;;;;;;;;;;;;;;;;
  17. ; Setup Variables ;
  18. ;;;;;;;;;;;;;;;;;;;
  19.  
  20. bInChatRoom := False
  21. bHealthBarOn := False
  22. Return ; End Auto-Execute Section
  23. sleeptime = 150
  24. CurrentBallVar = 0
  25.  
  26.  
  27. ;;;;;;;;;;;;;;;;;;;;
  28. ;AutoCast Function ;
  29. ;;;;;;;;;;;;;;;;;;;;
  30.  
  31.  
  32. AutoCast(iSpellQWERHotkey)
  33. {
  34. MouseGetPos, iMousePosX, IMousePosY
  35. if (iSpellQWERHotkey == 1)
  36. {
  37. iMouseGotoX := A_ScreenWidth*4//5
  38. iMouseGotoY := A_ScreenHeight*4//5
  39. }
  40. else if (iSpellQWERHotkey == 2)
  41. {
  42. iMouseGotoX := A_ScreenWidth*4//5
  43. iMouseGotoY := A_ScreenHeight*22//25
  44. }
  45. else if (iSpellQWERHotkey == 3)
  46. { iMouseGotoX := A_ScreenWidth*4//5
  47. iMouseGotoY := A_ScreenHeight*19//20
  48. }
  49. else if (iSpellQWERHotkey == 4)
  50. {
  51. iMouseGotoX := A_ScreenWidth*17//20
  52. iMouseGotoY := A_ScreenHeight*4//5
  53. }
  54. else if (iSpellQWERHotkey == 5)
  55. {
  56. iMouseGotoX := A_ScreenWidth*17//20
  57. iMouseGotoY := A_ScreenHeight*22//25
  58. }
  59. else if (iSpellQWERHotkey == 6)
  60. {
  61. iMouseGotoX := A_ScreenWidth*17//20
  62. iMouseGotoY := A_ScreenHeight*19//20
  63. }
  64. else if (iSpellQWERHotkey == 7)
  65. {
  66. iMouseGotoX := A_ScreenWidth*9//10
  67. iMouseGotoY := A_ScreenHeight*4//5
  68. }
  69. else if (iSpellQWERHotkey == 8)
  70. {
  71. iMouseGotoX := A_ScreenWidth*9//10
  72. iMouseGotoY := A_ScreenHeight*22//25
  73. }
  74. else if (iSpellQWERHotkey == 9)
  75. {
  76. iMouseGotoX := A_ScreenWidth*9//10
  77. iMouseGotoY := A_ScreenHeight*19//20
  78. }
  79. else if (iSpellQWERHotkey == 10)
  80. {
  81. iMouseGotoX := A_ScreenWidth*19//20
  82. iMouseGotoY := A_ScreenHeight*4//5
  83. }
  84. else if (iSpellQWERHotkey == 11)
  85. {
  86. iMouseGotoX := A_ScreenWidth*19//20
  87. iMouseGotoY := A_ScreenHeight*22//25
  88. }
  89. else if (iSpellQWERHotkey == 12)
  90. {
  91. iMouseGotoX := A_ScreenWidth*19//20
  92. iMouseGotoY := A_ScreenHeight*19//20
  93. }
  94. Click, Right, %iMouseGotoX%, %iMouseGotoY%
  95. MouseMove, %iMousePosX%, %iMousePosY%
  96. }
  97.  
  98. #ifWinActive, Warcraft III ahk_class Warcraft III
  99. #UseHook On
  100.  
  101. ;;;;;;;;;;;;;;;
  102. ;Hotkey Setup ;
  103. ;;;;;;;;;;;;;;;
  104.  
  105. *Numlock:: NextBall()
  106.  
  107. *numpad1:: PrepColdSnap()
  108. *numpad2:: PrepGhost()
  109. *numpad3:: PrepIceWall()
  110. *numpad4:: PrepTornado()
  111. *numpad5:: PrepEMP()
  112. *numpad6:: PrepAlacrity()
  113. *numpad7:: PrepMeteor()
  114. *numpad8:: PrepSunStrike()
  115. *numpad9:: PrepForge()
  116. *numpad0:: PrepBlast()
  117.  
  118.  
  119. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  120. ; Get Color of Invoke Skill ;
  121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  122.  
  123. GetInvokeColor()
  124. {
  125. global
  126. retries = 0
  127.  
  128. ;; Retries because sometimes it tries to pick the color
  129. ;; too fast, and gets simply "black"
  130. while (retries < 14)
  131. {
  132. retries++
  133. if (retries < 3)
  134. {
  135. PixelGetColor, invokeColor, x4, y3, Alt
  136. }
  137. else
  138. {
  139. PixelGetColor, invokeColor, x4, y3, Slow
  140. Sleep, 30
  141. }
  142. if (invokeColor != 0000)
  143. break
  144. }
  145.  
  146. ;; This is some of my MAGIC
  147. ;; Once I built this code, I got correct spells
  148. ;; nearly EVERY try.
  149.  
  150. }
  151.  
  152. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  153. ; Invoke Spell - Update Vars ;
  154. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  155.  
  156. DoInvoke(spellId)
  157. {
  158. global
  159.  
  160. GetInvokeColor()
  161. beforeInvoke := invokeColor
  162.  
  163. sendPlay r
  164. Sleep, %sleeptime%
  165.  
  166. GetInvokeColor()
  167. afterInvoke := invokeColor
  168.  
  169. if (beforeInvoke != afterInvoke)
  170. {
  171. ;Assume Success
  172. invokeSuccess := true
  173.  
  174. ;Rotate Current Invoked Spell
  175. SecondInvokeSpell := FirstInvokeSpell
  176. FirstInvokeSpell := spellId
  177. }
  178. else
  179. {
  180. invokeSuccess := false
  181. }
  182. }
  183.  
  184. ;;;;;;;;;;;;;;;;;;;;;;;
  185. ; To INVOKE the spell ;
  186. ;;;;;;;;;;;;;;;;;;;;;;;
  187.  
  188. PrepBlast() ;; Spell ID 1
  189. {
  190. SendPlay q
  191. SendPlay w
  192. SendPlay e
  193. DoInvoke(1)
  194. CurrentBall()
  195.  
  196. }
  197.  
  198. PrepMeteor() ;; Spell ID 2
  199. {
  200. SendPlay {e 2}
  201. SendPlay w
  202. DoInvoke(2)
  203. CurrentBall()
  204. }
  205.  
  206. PrepIceWall() ;; Spell ID 3
  207. {
  208. SendPlay {q 2}
  209. SendPlay e
  210. DoInvoke(3)
  211. CurrentBall()
  212. }
  213.  
  214. PrepEMP() ;; Spell ID 4
  215. {
  216. SendPlay {w 3}
  217. DoInvoke(4)
  218. CurrentBall()
  219. }
  220.  
  221. PrepForge() ;; Spell ID 5
  222. {
  223. SendPlay {e 2}
  224. SendPlay q
  225. DoInvoke(5)
  226. CurrentBall()
  227. }
  228.  
  229. PrepGhost() ;; Spell ID 6
  230. {
  231. SendPlay {q 2}
  232. SendPlay w
  233. DoInvoke(6)
  234. SendPlay {w 3}
  235. }
  236.  
  237. PrepSunStrike() ;; Spell ID 7
  238. {
  239. SendPlay {e 3}
  240. DoInvoke(7)
  241. CurrentBall()
  242. }
  243.  
  244. PrepTornado() ;; Spell ID 8
  245. {
  246. SendPlay {w 2}
  247. SendPlay q
  248. DoInvoke(8)
  249. CurrentBall()
  250. }
  251.  
  252. PrepAlacrity() ;; Spell ID 9
  253. {
  254. SendPlay {w 2}
  255. SendPlay e
  256. DoInvoke(9)
  257. CurrentBall()
  258. }
  259.  
  260. PrepColdSnap() ;; Spell ID 10
  261. {
  262. SendPlay {q 3}
  263. DoInvoke(10)
  264. CurrentBall()
  265. }
  266.  
  267.  
  268. ;;;;;;;;;;;;;;;;;;;;;;;;
  269. ; Power Ball Selection ;
  270. ;;;;;;;;;;;;;;;;;;;;;;;;
  271. ; 0 - Quas ;
  272. ; 1 - Wex ;
  273. ; 2 - Exort ;
  274. ;;;;;;;;;;;;;;;;;;;;;;;;
  275.  
  276. CurrentBall()
  277. {
  278. ;;Used when a spell is cast.
  279. global
  280. if (CurrentBallVar = 0)
  281. {
  282. SendPlay {q 3}
  283. }
  284. else if (CurrentBallVar = 1)
  285. {
  286. SendPlay {w 3}
  287. }
  288. else if (CurrentBallVar = 2)
  289. {
  290. SendPlay {e 3}
  291. }
  292. }
  293.  
  294. NextBall()
  295. {
  296. global
  297. if (CurrentBallVar = 0)
  298. {
  299. SetWex()
  300. }
  301. else if (CurrentBallVar = 1)
  302. {
  303. SetExort()
  304. }
  305. else if (CurrentBallVar = 2)
  306. {
  307. SetQuas()
  308. }
  309. }
  310.  
  311. SetQuas()
  312. {
  313. global
  314. CurrentBallVar = 0
  315. SendPlay {q 3}
  316. }
  317. SetWex()
  318. {
  319. global
  320. CurrentBallVar = 1
  321. SendPlay {w 3}
  322. }
  323. SetExort()
  324. {
  325. global
  326. CurrentBallVar = 2
  327. SendPlay {e 3}
  328. }
  329.  
  330.  
  331. ;;;;;;;;;;;;;;;;;;;;;;;
  332. ; APM SPAMMER ;
  333. ;;;;;;;;;;;;;;;;;;;;;;;
  334.  
  335. <::
  336. Loop 30
  337. {
  338. Send {RButton}
  339. Send {RButton}
  340.  
  341. }
  342. return
  343.  
  344.  
  345. ;;;;;;;;;;;;;;;;;;;;;;;
  346. ; Other ;
  347. ;;;;;;;;;;;;;;;;;;;;;;;
  348.  
  349. *ScrollLock::
  350. Suspend, Permit
  351. bInChatRoom := not bInChatRoom
  352. if (bInChatRoom == True)
  353. {
  354. Suspend, On
  355. }
  356. else
  357. {
  358. Suspend, Off
  359. }
  360. return
  361.  
  362.  
  363. ; Inventory Keys:
  364. 3::Numpad7
  365. 4::Numpad8
  366. 5::Numpad4
  367. 6::Numpad5
  368.  
  369. ; Hotkeys Remapper:
  370.  
  371. ; User Specified Hotkeys:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement