适合M16和AK
- EnablePrimaryMouseButtonEvents(true)
- functionOnEvent(event,arg,family)
- if(event=="PROFILE_ACTIVATED")then
- EnablePrimaryMouseButtonEvents(true)
- click=0
- end
- if(event=="MOUSE_BUTTON_PRESSED"andarg==4)then
- recoil=notrecoil
- end
- if(event=="MOUSE_BUTTON_PRESSED"andarg==1andrecoil)then
- click=1
- Click()
- end
- if(event=="M_RELEASED"andarg==3)then
- Click()
- end
- if(event=="MOUSE_BUTTON_RELEASED"andarg==1)then
- Stopclick()
- end
- end
- functionClick()
- PressAndReleaseMouseButton(1)
- Sleep(7)
- MoveMouseRelative(0,2)
- ifclick==0then
- Stopclick()
- elseif click==1thenSetMKeyState(3)
- elseStopclick()
- end
- end
- functionStopclick()
- click=0
- end
适合M416和WZ的宏
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ;#Warn ; Enable warnings to assist with detecting common errors.
- SendModeInput;Recommendedfornewscripts due to its superior speedandreliability.
- Process,Priority,,High
- SetWorkingDir%A_ScriptDir%;Ensuresa consistent starting directory.
- _auto:=true
- ~LButton::autofire()
- F10::;Suspendkey,beeps onewhenpaused.
- Suspend,permit
- if(A_IsSuspended=)
- {
- TrayTip,Suspended,%A_ScriptName%,,1
- SoundBeep6000,200
- }
- Else
- {
- TrayTip,UnSuspended,%A_ScriptName%,,1
- SoundBeep6000,200
- SoundBeep6000,200
- }
- Suspend,Toggle
- Return
- F12::ExitApp;Exitkey.
- autofire()
- {
- global_auto
- if_auto
- {
- Loop
- {
- ifGetKeyState(,)
- {
- SendInput{LButtonDownTemp}
- Sleep15;Keypresseddelay
- SendInput{LButtonUp}
- moveAmount:=(moveAmount=3)?1:0;Recoildivider
- mouseXY(moveAmount,10.5)
- Sleep35;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)
- functionOnEvent(event,arg,family)
- if(event==)then
- EnablePrimaryMouseButtonEvents(true)
- click=0
- end
- if(event==andarg==4)then
- recoil=notrecoil
- end
- if(event==andarg==1andrecoil)then
- click=1
- Click()
- end
- if(event==andarg==3)then
- Click()
- end
- if(event==andarg==1)then
- Stopclick()
- end
- end
- functionClick()
- PressAndReleaseMouseButton(1)
- Sleep(7)
- MoveMouseRelative(0,2)
- ifclick==0then
- Stopclick()
- elseif click==1thenSetMKeyState(3)
- elseStopclick()
- end
- end
- functionStopclick()
- click=0
- end
MoveMouseRelative(0, 2)怎么在后面实现30次定位呢