Sign in to follow this  
Followers 0
Jabberwock

BF2 script

11 posts in this topic

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

Share this post


Link to post
Share on other sites



Games generally need longer keystrokes. Try adding this to the top of your script:

; 50 or 100 should work
Opt('SendKeyDownDelay', 50)

Share this post


Link to post
Share on other sites

that dosn't help it, i turned up the keydelay to where it was sending a key like every 10 seconds


Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

i dont know the game... but you could at least try this

ControlSend ( "title", "text", controlID, "string" [, flag] )

see help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

BF2 uses Punkbuster which *I think* can detect memory access from other programs. If online, it could label you as a cheater, so be careful.

Share this post


Link to post
Share on other sites

well, i know it's possible to inject keys into BF2, because i just used a similar tool to autoit called actool, i'm not very familar with it and have no idea how to make a hotkey to a spam loop =/


Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

And... This script is quite pointless. You can just hold down the key in game you get the same effect.

Share this post


Link to post
Share on other sites

either way Starky... there shold be a "terminate" function

in your sciptlet

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Eh... No need really since there is a tray icon you can terminate with.

Share this post


Link to post
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
Sign in to follow this  
Followers 0