GamesofFreak

Untitled

Nov 11th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Gui Layout
  2. ;--------------
  3.  
  4. #NoEnv
  5. SendMode Input
  6.  
  7. ; If the script is not elevated, relaunch as administrator and kill current instance:
  8.  
  9. full_command_line := DllCall("GetCommandLine", "str")
  10.  
  11. if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
  12. {
  13.     try ; leads to having the script re-launching itself as administrator
  14.     {
  15.         if A_IsCompiled
  16.             Run *RunAs "%A_ScriptFullPath%" /restart
  17.         else
  18.             Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
  19.     }
  20.     ExitApp
  21. }
  22.  
  23. Gui, Add, Edit, x12 y29 w90 h20 vSleepTime
  24. Gui, Add, Button, x132 y19 w100 h40, Apply
  25. ; Generated using SmartGUI Creator for SciTE
  26. Gui, Show, w267 h84, Recoil System V2
  27. return
  28.  
  29. ; Lables
  30. ;--------------
  31.  
  32. ButtonApply:
  33.        _auto := true
  34.  
  35.     ~LButton::autofire()
  36.     ~NumLock::_auto := ! _auto
  37.     ~End::Suspend
  38.    
  39.  
  40.     autofire()
  41.     {
  42.     global _auto
  43.     if _auto
  44.     {
  45.     Loop
  46.     {
  47.     if GetKeyState("LButton", "P")
  48.     {
  49.     SendInput {LButton DownTemp}
  50.     Sleep 1
  51.     mouseXY(0, 0)
  52.     Sleep, 1
  53.     SendInput {LButton Up}
  54.     sleep, %SleepTime%
  55.     }
  56.     else
  57.     break
  58.     } ;; loop
  59.     } ;; if
  60.     } ;; autofire()
  61.  
  62.     mouseXY(x,y)
  63.     {
  64.     DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
  65. }
  66.     return
  67.  
  68. GuiClose:
  69. ExitApp
Add Comment
Please, Sign In to add comment