Advertisement
Braingame

Harry Potter: Hogwarts Mystery - AutoClicker (experimental)

May 21st, 2019
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. ; Harry Potter: Hogwarts Mystery - AutoClicker
  3. ; Not suitable for usage with Nox (or at least very inefficient)
  4. ;
  5. ; Rewrite of a previous AutoClicker script
  6. ; Credit goes to the anon, who wrote the original
  7. ; https://pastebin.com/zqmHgcMp
  8. ;
  9. ; Honorable mention of whoever tried porting it to emulators with a sidebar (e.g. Nox or MEmu)
  10. ; https://pastebin.com/zyCpfEx6
  11. ; Don't use it with Nox though; it'll freeze or crash, unless you're using a very long SleepDur
  12. ;
  13. ; This rewrite is EXPERIMENTAL and I don't recommend using it (yet).
  14. ; See https://pastebin.com/6wu0autS for a more reliable AutoClicker.
  15. ;
  16. ; Recommended values:
  17. ;   SleepDur := 1
  18. ;   ClickPerPosition := 2
  19. ;
  20. ; Values to emulate the original script:
  21. ;   SleepDur := -1
  22. ;   ClickPerPosition := 2
  23. ;
  24. ;
  25. ; List of default keybindings:
  26. ;   Alt + q:    terminate script
  27. ;   F8:         en-/disable basic AutoClicker
  28. ;   F12:        en-/disable class/quest AutoClicker
  29. ;
  30. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  31.  
  32. #NoEnv
  33. #Warn
  34. #maxThreadsPerHotkey, 8
  35. SendMode Input
  36.  
  37. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. ; Settings
  39. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  40.  
  41. Activate := 0           ; don't touch this
  42. SleepDur := 1           ; sleep duration (in ms) between each position (rec: 1)
  43. ClickPerPosition := 2  ; how often to click on one position (rec: 2-10)
  44.  
  45. ; Coordinates taken from the original script
  46. XCoords := [0.09, 0.164, 0.238, 0.312, 0.386, 0.46, 0.534, 0.608, 0.682, 0.756, 0.83, 0.87]
  47. YCoords := [0.26, 0.349, 0.453, 0.557, 0.609, 0.713, 0.807]
  48.  
  49. ; Limits to exclude the upper left corner
  50. YLimit := 0.26
  51. XLimit := 0.09
  52.  
  53. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  54. ; Terminate the script
  55. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56.  
  57. !q::
  58. {
  59.     msgbox, ended
  60.     exitapp
  61. }
  62. return
  63.  
  64. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  65. ; En-/disable basic auto-clicking
  66. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  67.  
  68. $f11::
  69. {
  70.     Activate := !Activate
  71.    
  72.     while (Activate) {
  73.         Click
  74.         Sleep, SleepDur
  75.     }
  76. }
  77. return
  78.  
  79. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. ; En-/disable class/quest auto-clicking
  81. ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82.  
  83. $f12::
  84. {
  85.     WinGetPos, WinX, WinY, WinWidth, WinHeight, A
  86.     Activate := !Activate
  87.    
  88.     while (Activate) {
  89.  
  90.         For YIndex, YValue in YCoords {
  91.             For XIndex, XValue in XCoords {
  92.                 ; skip positions in the upper left corner
  93.                 if (YValue = YLimit and XValue = XLimit)
  94.                     Continue
  95.  
  96.                 X := WinWidth*XValue
  97.                 Y := WinHeight*YValue
  98.  
  99.                 Loop, %ClickPerPosition% {
  100.                     Click, %X%, %Y%
  101.                 }
  102.                 Sleep, SleepDur
  103.             }
  104.         }
  105.        
  106.     }
  107. }
  108. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement