Advertisement
Guest User

click

a guest
Aug 6th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Declare variables to use in the script
  2. ; Track your hotkey toggle
  3. toggle  := 0
  4. ; Set what you want your minimum time to be
  5. minTime := 512
  6. ; Set what you want your maximum time to be
  7. maxTime := 896
  8. return
  9.  
  10. ; Assign a hotkey to toggle your function on and off
  11. `::
  12.     ; Toggle your variable
  13.     toggle := !toggle
  14.  
  15.     ; If toggle is on/1/true, start the ClickSub timer
  16.     if (toggle = 1)
  17.         SetTimer, ClickSub, -1
  18.     ; If toggle is off/0/false, turn the ClickSub timer off
  19.     Else
  20.         SetTimer, ClickSub, Off
  21. return
  22.  
  23. ; Block of code you want to run each time
  24. ClickSub:
  25.    ; Send your click event
  26.     Click
  27.  
  28.     ; Have AHK generate a random number between your min and max time
  29.     Random, randTime, % minTime, % maxTime
  30.  
  31.     ; Use the random number to start a new timer
  32.     SetTimer, ClickSub, % -randTime
  33. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement