Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ; Harry Potter: Hogwarts Mystery - AutoClicker
- ; Not suitable for usage with Nox (or at least very inefficient)
- ;
- ; Rewrite of a previous AutoClicker script
- ; Credit goes to the anon, who wrote the original
- ; https://pastebin.com/zqmHgcMp
- ;
- ; Honorable mention of whoever tried porting it to emulators with a sidebar (e.g. Nox or MEmu)
- ; https://pastebin.com/zyCpfEx6
- ; Don't use it with Nox though; it'll freeze or crash, unless you're using a very long SleepDur
- ;
- ; This rewrite is EXPERIMENTAL and I don't recommend using it (yet).
- ; See https://pastebin.com/6wu0autS for a more reliable AutoClicker.
- ;
- ; Recommended values:
- ; SleepDur := 1
- ; ClickPerPosition := 2
- ;
- ; Values to emulate the original script:
- ; SleepDur := -1
- ; ClickPerPosition := 2
- ;
- ;
- ; List of default keybindings:
- ; Alt + q: terminate script
- ; F8: en-/disable basic AutoClicker
- ; F12: en-/disable class/quest AutoClicker
- ;
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #NoEnv
- #Warn
- #maxThreadsPerHotkey, 8
- SendMode Input
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ; Settings
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Activate := 0 ; don't touch this
- SleepDur := 1 ; sleep duration (in ms) between each position (rec: 1)
- ClickPerPosition := 2 ; how often to click on one position (rec: 2-10)
- ; Coordinates taken from the original script
- 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]
- YCoords := [0.26, 0.349, 0.453, 0.557, 0.609, 0.713, 0.807]
- ; Limits to exclude the upper left corner
- YLimit := 0.26
- XLimit := 0.09
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ; Terminate the script
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- !q::
- {
- msgbox, ended
- exitapp
- }
- return
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ; En-/disable basic auto-clicking
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- $f11::
- {
- Activate := !Activate
- while (Activate) {
- Click
- Sleep, SleepDur
- }
- }
- return
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ; En-/disable class/quest auto-clicking
- ; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- $f12::
- {
- WinGetPos, WinX, WinY, WinWidth, WinHeight, A
- Activate := !Activate
- while (Activate) {
- For YIndex, YValue in YCoords {
- For XIndex, XValue in XCoords {
- ; skip positions in the upper left corner
- if (YValue = YLimit and XValue = XLimit)
- Continue
- X := WinWidth*XValue
- Y := WinHeight*YValue
- Loop, %ClickPerPosition% {
- Click, %X%, %Y%
- }
- Sleep, SleepDur
- }
- }
- }
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement