Jabberwock Posted November 27, 2005 Posted November 27, 2005 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
LxP Posted November 27, 2005 Posted November 27, 2005 Games generally need longer keystrokes. Try adding this to the top of your script: ; 50 or 100 should work Opt('SendKeyDownDelay', 50)
Jabberwock Posted November 30, 2005 Author Posted November 30, 2005 that dosn't help it, i turned up the keydelay to where it was sending a key like every 10 seconds
Simucal Posted November 30, 2005 Posted November 30, 2005 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)
Valuater Posted November 30, 2005 Posted November 30, 2005 i dont know the game... but you could at least try this ControlSend ( "title", "text", controlID, "string" [, flag] ) see help 8)
Koder Posted November 30, 2005 Posted November 30, 2005 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.
Jabberwock Posted December 1, 2005 Author Posted December 1, 2005 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 =/
Starky Posted December 2, 2005 Posted December 2, 2005 (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 December 2, 2005 by Starky
Starky Posted December 2, 2005 Posted December 2, 2005 And... This script is quite pointless. You can just hold down the key in game you get the same effect.
Valuater Posted December 2, 2005 Posted December 2, 2005 either way Starky... there shold be a "terminate" function in your sciptlet 8)
Starky Posted December 2, 2005 Posted December 2, 2005 Eh... No need really since there is a tray icon you can terminate with.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now