适合M16和AK
- EnablePrimaryMouseButtonEvents (true)
- function OnEvent(event, arg, family)
- if (event == "PROFILE_ACTIVATED") then
- EnablePrimaryMouseButtonEvents(true)
- click = 0
- end
- if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
- recoil = not recoil
- end
- if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
- click = 1
- Click()
- end
- if (event == "M_RELEASED" and arg == 3) then
- Click()
- end
- if (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
- Stopclick()
- end
- end
- function Click()
- PressAndReleaseMouseButton(1)
- Sleep (7)
- MoveMouseRelative(0, 2)
- if click == 0 then
- Stopclick()
- elseif click == 1 then SetMKeyState(3)
- else Stopclick()
- end
- end
- function Stopclick()
- click = 0
- end
适合M416和WZ的宏
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- Process, Priority, , High
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- _auto := true
- ~LButton::autofire()
- F10:: ; Suspend key,beeps one when paused.
- Suspend, permit
- if (A_IsSuspended = )
- {
- TrayTip, Suspended, %A_ScriptName%, , 1
- SoundBeep 6000, 200
- }
- Else
- {
- TrayTip, UnSuspended, %A_ScriptName%, , 1
- SoundBeep 6000, 200
- SoundBeep 6000, 200
- }
- Suspend, Toggle
- Return
- F12::ExitApp ; Exit key.
- autofire()
- {
- global _auto
- if _auto
- {
- Loop
- {
- if GetKeyState(, )
- {
- SendInput {LButton DownTemp}
- Sleep 15 ; Keypressed delay
- SendInput {LButton Up}
- moveAmount := (moveAmount = 3) ? 1 : 0 ; Recoil divider
- mouseXY(moveAmount,10.5)
- Sleep 35 ; Non-pressed delay
- }
- else
- break
- } ;; loop
- } ;; if
- } ;; autofire()
- mouseXY(x,y)
- {
- DllCall(,uint,1,int,x,int,y,uint,0,int,0) ; Mover
- }
屏住呼吸开枪
- EnablePrimaryMouseButtonEvents (true)
- function OnEvent(event, arg, family)
- if (event == ) then
- EnablePrimaryMouseButtonEvents(true)
- click = 0
- end
- if (event == and arg == 4) then
- recoil = not recoil
- end
- if (event == and arg == 1 and recoil) then
- click = 1
- Click()
- end
- if (event == and arg == 3) then
- Click()
- end
- if (event == and arg == 1) then
- Stopclick()
- end
- end
- function Click()
- PressAndReleaseMouseButton(1)
- Sleep (7)
- MoveMouseRelative(0, 2)
- if click == 0 then
- Stopclick()
- elseif click == 1 then SetMKeyState(3)
- else Stopclick()
- end
- end
- function Stopclick()
- click = 0
- end
MoveMouseRelative(0, 2)怎么在后面实现30次定位呢