Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Gui Layout
- ;--------------
- #NoEnv
- SendMode Input
- ; If the script is not elevated, relaunch as administrator and kill current instance:
- full_command_line := DllCall("GetCommandLine", "str")
- if not (A_IsAdmin or RegExMatch(full_command_line, " /restart(?!\S)"))
- {
- try ; leads to having the script re-launching itself as administrator
- {
- if A_IsCompiled
- Run *RunAs "%A_ScriptFullPath%" /restart
- else
- Run *RunAs "%A_AhkPath%" /restart "%A_ScriptFullPath%"
- }
- ExitApp
- }
- Gui, Add, Edit, x12 y29 w90 h20 vSleepTime
- Gui, Add, Button, x132 y19 w100 h40, Apply
- ; Generated using SmartGUI Creator for SciTE
- Gui, Show, w267 h84, Recoil System V2
- return
- ; Lables
- ;--------------
- ButtonApply:
- _auto := true
- ~LButton::autofire()
- ~NumLock::_auto := ! _auto
- ~End::Suspend
- autofire()
- {
- global _auto
- if _auto
- {
- Loop
- {
- if GetKeyState("LButton", "P")
- {
- SendInput {LButton DownTemp}
- Sleep 1
- mouseXY(0, 0)
- Sleep, 1
- SendInput {LButton Up}
- sleep, %SleepTime%
- }
- else
- break
- } ;; loop
- } ;; if
- } ;; autofire()
- mouseXY(x,y)
- {
- DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
- }
- return
- GuiClose:
- ExitApp
Add Comment
Please, Sign In to add comment