I am currently using the below code that I have gotten from then thread.
Code:
gActivateScript = 0
; Insert to activate the macro
~Insert::
KeyWait, Insert
GetKeyState, InsertState, Insert, T
If InsertState = D
{
gActivateScript = 1
SoundBeep, 750, 100
SoundBeep, 750, 100
}
else
{
gActivateScript = 0
SoundBeep, 500, 200
}
return
; CTRL + SHIFT + LBUTTON to activate the macro
~+^LButton::
If gActivateScript = 0
{
gActivateScript = 1
SoundBeep, 750, 100
SoundBeep, 750, 100
}
else
{
gActivateScript = 0
SoundBeep, 500, 200
}
return
MouseEvent(a_xpos, a_ypos)
{
DllCall("mouse_event", uint,1, int,a_xpos, int,a_ypos, uint,0, int,0 )
}
;Also applies to burst weapons. ie click and hold will perform like a full auto firing mode
~LButton::
Goto, DoFiringLoop
Return
;When crouching and firing at the same time. Using Ctrl as crouch button
~^LButton::
Goto, DoFiringLoop
Return
DoFiringLoop:
if gActivateScript = 1
{
Loop
{
;Make sure BF2 window is the active window. Don't want weird mouse behaviour appearing at other windows
IfWinActive, BF2
{
MouseClick, left,,, 1, 0, D
;delay between simu. mouse btn down and up (50 = normal, 25 = faster)
Sleep, 50
MouseClick, left,,, 1, 0, U
GetKeyState, LButtonState, LButton, P
If LButtonState = U
{
;break the loop if physical state of mouse btn is up.
break
}
;delay between each simu. click events
Sleep, 25
[b]; MouseEvent(0,6)[/b]
}
else
{
break
}
}
}
exit
return
I tried to add the "anti recoil" code in (commented out for now). When I add it back in it actually makes my gun move up more. I have read in this thread that you cannont count on the mouse position in BF2.
1) Does the anti recoil code work at all?
2) why is it moving the gun up and not down?
3) Does it have to do with the timings?
thanks