Code:
;; ProneZoomFire - Player goes prone, then equips scope, then fires a shot.
;;
;; Usage: when game is running, press MIDDLE BUTTON
;;
;;;;;;;;;;;;;
;; directives
;;;;;;;;;;;;;
#installkeybdhook
#installmousehook
#SingleInstance force
#NoEnv
SendMode Input
;;;;;;;;;;;;;;;;;;;;
;; execution section
;;;;;;;;;;;;;;;;;;;;
ProneZoomFire=MButton
Hotkey, %ProneZoomFire%, ProneZoomFire
;; good for most weapons
fixAmount = 3
;; for PAC bf2142 pistol and the GANZ, use a high recoil fix
;; fixAmount = 7
;; end of execution section return
return
;;;;;;;;;
;; labels
;;;;;;;;;
ProneZoomFire:
;; go prone
prone()
;; zoom (alternate fire)
zoom()
;; fires two shots (may fire more than twice depending on gun you're using)
fireWeapon(2)
;; fires all 8 rounds in the bf2142 PAC pistol very quickly
;;fire(8)
return
;;;;;;;;;;;;
;; functions
;;;;;;;;;;;;z
prone()
{
SendInput {z down}
Sleep 60
SendInput {z up}
Sleep 100
}
zoom()
{
SendInput {RButton Down}
Sleep 60
SendInput {RButton Up}
Sleep 100
}
fireWeapon(number)
{
Global fixAmount
loop %number%
{
SendInput {LButton Down}
Sleep 80
SendInput {LButton Up}
Sleep 80
recoilFix(fixAmount)
}
}
recoilFix(amount)
{
DllCall("mouse_event",uint,1,int,x,int,amount,uint,0,int,0)
}