[Search]  Search   [Groups]  Back to EA Forum Index  
Crouch/Sprint/Aim Toggle AutoHotkey script  XML
Battlefield Bad Company 2  > Battlefield Bad Company 2 PC
Author Message
bunchafunk


Joined: 01/28/2010 00:28:34
Messages: 64
Offline

STICKYING - zerk

During the beta, I wrote a small AutoHotkey script to make crouch and sprint a toggle. Since it's not yet implemented in the retail game, I figured I'd share.

It works like this:
While holding "w", press and release "LShift" to start sprinting. You'll continue to sprint until either: "w" is released, "LShift" is pressed again, or crouch is toggled (see below).

To toggle crouch, press "c". This will basically hold down the "LCtrl" key until you: press "c" again to disengage, press "Space" to jump, or start sprinting.

The zip contains both the source (for those who have AutoHotkey installed already or want to make modifications) and compiled version (can be used without having AutoHotkey installed).

Let me know if you have any feedback.

P.S. As far as I know, AutoHotkey scripts of this nature are not considered cheating.

Change Log
2.0.9b:
- added option TrackAimToggle for use with
EnableAimHoldToggle=0. Makes it so the "aimState" variable is updated when
Aim button is pressed, thus allowing aim to cancel SprintToggle among
other things. Disabled by default due to buggyness.
2.0.9:
- added option SpotOnFireCooldown (default=1), set to 0 to use "old" method
- fixed bug that caused player to randomly stand up while crouched
- aiming will now cancel Sprint when using EnableSprintToggle=1
- re-worked/optimized/tweaked several functions: SprintToggle, AimHoldToggle, ForwardPress
2.0.8:
- added settings for "Switch Weapons" and "Reload" keybinds; should help prevent Sprint problem cited by user
- added setting for "Melee" keybind; should make it so you don't have to manually stop sprinting before meleeing (only if using EnableSprintToggle=1)
- added fix for sprint/aim bug cited by user
2.0.7:
- the "SpotOnFire" functionality will now continue spotting while "Fire" is held down
- Spotting cooldown reduced from 2.2 seconds to 2.0 seconds
- added update check: can be triggered from tray icon menu or automatically at script start.
- Use "CheckForUpdatesOnStartup" setting to enable/disable checking for updates on startup.
2.0.6:
- bug fixes and optimizations
- added ~2 second cooldown between sending the social button when firing, should help prevent "overheat"
- added SuspendOnSteamOverlay to toggle the script when SteamOverlay hotkey (default: Shift+Tab) is pressed
2.0.5:
- added "EnableSpotOnFire" which will send the "Spot" (aka "social") key when you press the "Fire" button
- fixed a bug when "EnableCrouchToggle=0" that prevented you from crouching more than once
- various optimizations
2.0.4:
- added sprint from crouch when using "EnableCrouchToggle=1" and "EnableSprintToggle=0"
- script now recognizes sprint from double-pressing "Forward"
2.0.3:
- fixed crouch bug that occurred when using "EnableAimHoldToggle=1" with "EnableCrouchToggle=0"
- changed default "ScriptToggle" hotkey to "F12"
2.0.2:
- reworked "AimHold" to prevent key autorepeat while held down
- added "SuspendOnChat" setting which disables the script until "ENTER" is pressed; this should let you chat in-game without having to issue the ScriptToggle hotkey before/after
- added "ChatAll", "ChatTeam", "ChatSquad" settings so you can specify the in-game keybinds for use with "SuspendOnChat"
2.0.1:
- only allow hotkeys if BFBC2 window is active
- added "AimHold" hotkey setting which allows "AimHold" key to be different than the "Aim" keybind
- added setting for beep on script toggle
2.0: reworked release; reads user settings from settings.ini
1.0: initial release

Download here:
http://bunchafunk.googlecode.com/files/crouch_aim_toggle_v2.zip
http://dl.dropbox.com/u/47468/crouch_aim_toggle_v2.zip

Edit: I've added a second download link. Users have reported that Google Code may cache downloads that have the same filename; so when I upload an updated version of the script, some users still may be downloading the older version(s). Check that the script version matches the latest, above.

Be sure to read the README file for instructions.

This message was edited 15 times. Last update was at 01/21/2011 08:27:23

TheLightmanGrou...

[Avatar]
Joined: 02/16/2010 16:40:30
Messages: 48
Offline

Any chance of one for Aim down sights, so you have to hold Right mouse to keep the sights up and then go down when you release it ?

bunchafunk


Joined: 01/28/2010 00:28:34
Messages: 64
Offline

battlefield.TheLightmanGroup wrote:Any chance of one for Aim down sights, so you have to hold Right mouse to keep the sights up and then go down when you release it ?


Updated! I added a separate script that adds this functionality.
TheLightmanGrou...

[Avatar]
Joined: 02/16/2010 16:40:30
Messages: 48
Offline

cem_ea_id.bunchafunk wrote:
battlefield.TheLightmanGroup wrote:Any chance of one for Aim down sights, so you have to hold Right mouse to keep the sights up and then go down when you release it ?


Updated! I added a separate script that adds this functionality.


Sweet, but not to be needy, is there any chance to get one that JUST does the ADS?? Or do i get to choose what ones are running ? Sorry description kinda got me confused.

bunchafunk


Joined: 01/28/2010 00:28:34
Messages: 64
Offline

battlefield.TheLightmanGroup wrote:Sweet, but not to be needy, is there any chance to get one that JUST does the ADS?? Or do i get to choose what ones are running ? Sorry description kinda got me confused.


Sure, here's one that does JUST ADS:

http://bunchafunk.googlecode.com/files/ads.zip
TheLightmanGrou...

[Avatar]
Joined: 02/16/2010 16:40:30
Messages: 48
Offline

cem_ea_id.bunchafunk wrote:
battlefield.TheLightmanGroup wrote:Sweet, but not to be needy, is there any chance to get one that JUST does the ADS?? Or do i get to choose what ones are running ? Sorry description kinda got me confused.


Sure, here's one that does JUST ADS:

http://bunchafunk.googlecode.com/files/ads.zip


Oh thank you defiantly made my day, and I have yet to play the game yet.

This message was edited 1 time. Last update was at 03/02/2010 19:48:52


mikku


Joined: 08/14/2008 18:35:34
Messages: 4
Offline

Awesome. I was just talking about wanting a crouch toggle and ironsights to not be a toggle literally just a few moments ago.


On a side note, we're allowed to use these right? Not a violation of anything or going to have punkbuster show up at my house in the night and break my kneecaps?
Samwiches


Joined: 03/02/2010 16:17:12
Messages: 19
Offline

This only works for WSAD w/ C crouch huh?

My keys are totally different. I can't tell what to edit.

This message was edited 1 time. Last update was at 03/02/2010 23:58:58

bunchafunk


Joined: 01/28/2010 00:28:34
Messages: 64
Offline

battlefield.Samwiches wrote:This only works for WSAD w/ C crouch huh?

My keys are totally different. I can't tell what to edit.


Yes unfortunately this only works with the default keybindings. I had thought about making it configurable, but that would involve a lot of effort and I'm sure DICE will patch in these features relatively soon anyway.
xxbigbacon
Moderator
[Avatar]
Joined: 10/30/2006 11:02:19
Messages: 7205
Location: VA
Offline

I have a toggle crouch by Double Click of middle mouse button if anyone needs it.


Signature pics must be smaller than 665x128! i7920@3.8-on-P6T/6gb1600DDR3/SLI280/XFi
heycarnut

[Avatar]
Joined: 01/30/2010 18:29:43
Messages: 1524
Location: Various
Offline

cem_ea_id.bunchafunk wrote:

Yes unfortunately this only works with the default keybindings. I had thought about making it configurable, but that would involve a lot of effort and I'm sure DICE will patch in these features relatively soon anyway.


Just put mappings in an ini and dynamically do the bind. Not much effort at all. I haven't looked at your script, but if source is there, I'll do it if you haven't the time.
[WWW]
bunchafunk


Joined: 01/28/2010 00:28:34
Messages: 64
Offline

GAMESPY_SUB.heycarnut wrote:
cem_ea_id.bunchafunk wrote:

Yes unfortunately this only works with the default keybindings. I had thought about making it configurable, but that would involve a lot of effort and I'm sure DICE will patch in these features relatively soon anyway.


Just put mappings in an ini and dynamically do the bind. Not much effort at all. I haven't looked at your script, but if source is there, I'll do it if you haven't the time.


Certainly! I'm getting ready to go out of the country tomorrow so I don't have a lot of free time. I meant "a lot of effort" more in terms of fiddling with AHK and reading documentation.

The source code is included in the ZIP, I only ask that if you make the changes, let me know what they are and I'll include them in the script download (and give you credit).
heycarnut

[Avatar]
Joined: 01/30/2010 18:29:43
Messages: 1524
Location: Various
Offline

cem_ea_id.bunchafunk wrote:The source code is included in the ZIP, I only ask that if you make the changes, let me know what they are and I'll include them in the script download (and give you credit).


I'll take a look this week, and PM you with the script(s) should I embark on adding functionality.
No attrribution needed, appreciate the thought though. Anything I can do that helps fellow players is satisfaction enough.
[WWW]
Android-kun


Joined: 02/07/2010 16:14:59
Messages: 135
Offline

Awesome work guys! I used the scripts today, really great times.

I did notice some issues though, I dunno if they are something that can be fixed, but there are some scenarios that take you from having to press something to zoom, to being stuck in zoom and having to hold alt fire to stay zoomed out. Weird issue there, but my pink thanks you for keeping him from rotting off from holding down shift all day.
Tide.

[Avatar]
Joined: 03/03/2010 09:44:38
Messages: 1
Offline

I downloaded the application but I do not see the source. I am looking for the source on the C# exe file. If you would not mind posting that I would love to see it.

Thanks for working on this!
Battlefield Bad Company 2  > Battlefield Bad Company 2 PC
Go to: