I'm not claiming credit for this, as the meat of it is somebody else's work, but I did modify it to stop the mouse movement after a certian number of instances, should be ideal for what you need.
Code:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <myemail@nowhere.com>
; FUNCTIONAL VERSION
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;
#NoEnv
SendMode Input
_auto := true
~LButton::autofire()
MButton::_auto := ! _auto
F1::ExitApp
autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
{
SendInput {LButton DownTemp}
Sleep 32
if a_index < 5
mouseXY(0, -6)
SendInput {LButton Up}
Send {Q}
Sleep 100
}
else
break
} ;; loop
} ;; if
} ;; autofire()
mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
}
Remove the line "Send{Q}" if you aren't playing BFBC2.
The line "if a_index < 5" is the one you're concerned with, change the 5 to whatever you need, if you need anti-recoil off after 10 shots change it to 10.
The line "mouseXY(0, -6)" will need tweaking to change the amount of anti-recoil, I use inverted mouse, so the figure is negative for me, but it's positive if you don't use invert.
Finally, change the values on the "sleep" lines to change how fast it fires, it's in milliseconds (thousandths of a second)
Hope this helps mate.