Guest User

Untitled

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. ; Got a lot of ideas and code from
  2. ; a script by Valarauka
  3. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  4. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  5. #InstallKeybdHook ; Force install of keyboard hook
  6. SendMode Play ; Game-compatible input mode.
  7. Suspend On ;Start in suspended mode
  8.  
  9.  
  10. #IfWinActive, Warcraft III
  11. #UseHook On ; Force hotkeys to use keyboard hook
  12.  
  13. *F5:: ;toggle hotkeys and do initial setup
  14. ;*~Enter:: ;Enter will also enable/disable script so you can chat easily
  15. Suspend
  16. GridSetup()
  17. if (A_IsSuspended)
  18. SoundPlay *64
  19. else
  20. SoundPlay *48
  21. return
  22.  
  23. *F6:: ;; autosave
  24. Loop
  25. {
  26. Send {Enter}-save{Enter}
  27. Sleep 300000
  28. }
  29. return
  30.  
  31. *F7:: ;; autoheal
  32. Loop
  33. {
  34. SetMouseDelay, 10, Play
  35. Send e
  36. Sleep 500
  37. ClickReturn(selfx, selfy) ;Click Self Portrait
  38. SetMouseDelay, -1, Play
  39. Sleep 25000
  40. }
  41. return
  42.  
  43. *F8:: ;;Target Self
  44. SetMouseDelay, 10, Play
  45. ClickReturn(selfx, selfy) ;Click Self Portrait
  46. SetMouseDelay, -1, Play
  47. return
  48.  
  49.  
  50. ClickReturn(x, y) ;click then return mouse to original position
  51. {
  52. MouseGetPos, xpos, ypos
  53. if (GetKeyState("Alt")) ;Modifier button for right-click - can be changed to "Ctrl" etc.
  54. Send {Click %x%, %y%, R}
  55. else
  56. Send {Click %x%, %y%, L}
  57. MouseMove, %xpos%, %ypos%
  58. }
  59.  
  60. GridSetup() ;set up the screen coords for clicking
  61. {
  62. global
  63. x1:=(510*A_ScreenWidth)//640
  64. x2:=(544*A_ScreenWidth)//640
  65. x3:=(578*A_ScreenWidth)//640
  66. x4:=(612*A_ScreenWidth)//640
  67.  
  68. y1:=(390*A_ScreenHeight)//480
  69. y2:=(424*A_ScreenHeight)//480
  70. y3:=(458*A_ScreenHeight)//480
  71.  
  72. sentinelx:=(13*A_ScreenWidth)//640 ;Sentinel fountain
  73. sentinely:=(467*A_ScreenHeight)//480
  74.  
  75. scourgex:=(110*A_ScreenWidth)//640 ;Scourge fountain
  76. scourgey:=(374*A_ScreenHeight)//480
  77.  
  78. selfx:=(200*A_ScreenWidth)//640
  79. selfy:=(420*A_ScreenHeight)//480
  80. }
Add Comment
Please, Sign In to add comment