Jump to content

BF2 script


Recommended Posts

hey, i was just wondering if there is a alternative to the send to mabye somthing that i can add that would work for BF2, it seems that BF2 is either blocking, or mabye autoit can't work while in BF2 which wouldn't make sense, but anyway, i was just trying to make a script that would spam a key in game, say E for example, spam E to join a plane that's about to spawn, or a helicopter, i found some code that works for another game and should in theory work for this but dosn't, and i don't think that it's a hotkey conflict because i tried multiple ones.

Dim $a=0, $b=0 

Sleep(1000) 

HotKeySet("{F11}", "spamtehbutton") 

While 1 
Sleep(100) 
WEnd 

Func spamtehbutton() 
Select 
Case $a=0 
$a=1 
$b=1 
While $b=1 
Send("e") 
WEnd 

Case $a=1 
$a=0 
$b=0 
EndSelect 
EndFunc
Link to comment
Share on other sites

A lot of modern games hook into API's such as SendInput and Getpixel and prevent you from sending scripted key strokes while in game or detecting pixel color in game. There are a couple ways around this.. but none of them are easy.

For one game I played, I used Zone Alarm to restrict what the game could write to... then restored all the API's. I could then send input into the game.

Alternatively, I've heard of people writing a fake keyboard driver... which sends keystrokes via the driver. Because this is not using the SendInput API it is indistinguishable from actuall keyboard input.

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

Do you have F11 bound to a key in game? If so, have you tried changing your hot key to something that bf2 does not use? Also, your script is longer than it needs to be. You only need one variable.

Global $sendKey

HotKeySet("{F11}", "spamtehbutton")

While 1
    Sleep(100)
WEnd

Func spamtehbutton()
    $sendKey = NOT $sendKey
    
    While $sendKey
        Send("e")
    WEnd
EndFunc
Edited by Starky
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...