QUOTE(Crazy.SoT.Gila @ Jun 20 2008, 08:54 AM)
Ah, thanks! You have another high jump in your class config
That auto-reload script is rather complex. I'm using a self-made one, but it totally screws up heavy's minigun and demoman's pipes. Any ideas?
Binded it to Mouse1. Even when I try to rebind Mouse1 to the normal "+attack", nothing changes
Btw, love your voice bind with the melee
It's cheaper with Steam. Other than the price Mr Hulk mentioned for the standalone TF2. Double the price and you can get The Orange Box

You can make a script for each class. Thats what I did.
the autoexec.cfg is just your default cfg with additional command to load up the class specific scripts. the class specifics will over write the default, if its defined in class script.
I would recommend, bind movement and reloading together instead of attack1. Attack and reload while technically makes you immune to ever been caught without ammo in your gun; it makes you fire rate slower since you are reloading between shots. Additionally not all guns between the classes are the same, guns like Heavies, & pipe gun works differently (continous depressing of the key), that why I reckon your reload script dont work on those.
The original movement reload (its not mine, got it off internet) will reload as you press the WSAD keys, thats why its complex. It feel that it still interfere with my fire rate, so only the S key is bind to move+reload for me.
check out thsi link if you wanna learn mo bout scripts
http://www.teamfortress2fort.com/forums/t/...Guide-2674.aspx» Click to show Spoiler - click again to hide... «
DiZaRkY’s Script Compilation and Autoexec Guide
In this post I’m going to add a compilation of scripts I’ve found from around the interweb and the steam forums. I’ll try and give credit where credit’s due, but if I fail, and you notice it, please tell me so I can correct it. Let me preface this by saying some of these scripts take the skill out of the game, and really should only be used for educational purposes. Don’t download or script skill, learn it! That is a much more rewarding way to play.
Well, with that out of the way here we go!
Know your config route!
First some basics that I want to mention. This guide utilizes your autoexec cfg. Know where this is so you can edit it, and also note that all other cfg’s will go in here. You can typically find this in X:\steamapps\(your username)\team fortress 2\tf\cfg (All cfg’s go in this folder)
The “X” stands for whatever drive you have steam installed to, typically C.
You may need to make the autoexec.cfg if it’s not there. To do this, make a new txt document with notepad, click save-as, in the drop down box where “text documents” is, click all files, enter autoexec.cfg as the save name, and save. It’ll make a new document called autoexec for you that has a cfg extension.
With the exception of the autoexec, you can rename any cfg’s you have to make. Just make sure to update your script. Also, you can bind these to whatever key you please.
Ok, now for the fun stuff!
Setting up cfg’s to execute with your selected class.
Remember how in TFC you could use the setinfo "ec" "1" command to auto execute class scripts? Well you can’t here. So forget about it. Instead, add this to the autoexec.cfg. (Credit: Patty)
//CLASS ALIASES
Alias scoutcfg "exec scout.cfg"
Alias snipercfg "exec sniper.cfg"
Alias soldiercfg "exec soldier.cfg"
Alias demomancfg "exec demoman.cfg"
Alias mediccfg "exec medic.cfg"
Alias hwguycfg "exec hwguy.cfg"
Alias pyrocfg "exec pyro.cfg"
Alias spycfg "exec spy.cfg"
Alias engineercfg "exec engineer.cfg"
//CLASS BINDINGS
BIND "KP_END" "scoutcfg"
BIND "KP_DOWNARROW" "snipercfg"
BIND "KP_PGDN" "soldiercfg"
BIND "KP_LEFTARROW" "demomancfg"
BIND "KP_5" "mediccfg"
BIND "KP_RIGHTARROW" "hwguycfg"
BIND "KP_HOME" "pyrocfg"
BIND "KP_UPARROW" "spycfg"
BIND "KP_PGUP" "engineercfg"
This will make it so that every time you press the corresponding button, it will load that config for the class, which will set up your keys and activate your scripts. That does mean you’ll have to make the configs stated above, but that shouldn’t be an issue now.
General Scripts
Use these aliases to quickly turn on-screen feedback on and off.
These are only useful in conjunction with other scripts that make use of on-screen feedback, mainly scripts with the echo command. You may need to edit some scripts to utilize this one, because some of them use a timer that turns on/off feedback on their own. Just remove any developer commands. This script was converted to toggle by me for ease of use. (Credit: Greeze)
alias devToggle "dev1"alias dev1 "developer 1; alias devToggle dev0" //Toggle on-screen feedback ON - Use "echo" command to show text on screen.alias dev0 "developer 0; alias devToggle dev1" //Toggle on-screen feedback OFFbind “x” “devToggle” ---------------------------------------------------This is a toggled auto-reload script based on movement using the WASD keys. This script, like most auto-reload scripts WILL break certain weapons such as the syringe launcher and the pistol. If you play using other movement keys, post here and I will convert this script to whatever you like. (Credit: Apathy)// Toggle auto-reloadbind "KEY" "auto"alias "auto" "aron"alias "aron" "bind w +w;bind s +s; bind a +a; bind d +d;alias auto aroff"alias "aroff" "rw;rs;rl;rm;alias auto aron"alias "rw" "bind w +forward"alias "rs" "bind s +back"alias "rl" "bind d +moveright"alias "rm" "bind a +moveleft"alias +w "+forward;+reload"alias -w "-forward;wait;-reload"alias +s "+back;+reload"alias -s "-back;wait;-reload"alias +a "+moveleft;+reload"alias -a "-moveleft;wait;-reload"alias +d "+moveright;+reload"alias -d "-moveright;wait;-reload"--------------------------------------------------- In this script, pressing “p” toggles this script on and off. What happens here is that after you shoot, it waits, and then will reload after a set amount of time. (Credit: kerneld)
//Auto Reload
bind mouse1 "+shootNreload"
bind p "reloadON"
alias reloadON "bind mouse1 +shootNreload; developer 1; echo ** Idle Auto-Reload ON **; wait 10; developer 0; bind p reloadOFF"
alias reloadOFF "bind mouse1 +attack; developer 1; echo ** Idle Auto-Reload OFF **; wait 10; developer 0; bind p reloadON"
alias +shootNreload "+attack"
alias -shootNreload "-attack; wait 10; +reload; wait 50; -reload"
---------------------------------------------------
This is a weapon switching script. Only switches between your main and secondary weapons. This is a cleaner version of what was posted here. This script allows users to bind any number of keys/buttons to the same function. (This does not include the melee function.) (Credit: Greeze)
//Alias-only Weapons Switching
alias weaponSet "primary"
alias primary "slot1; wait; alias weaponSet secondary"
alias secondary "slot2; wait; alias weaponSet primary"
//Now bind whatever you like to weaponSet. For example,
bind "MWHEELUP" "weaponSet"
bind "MWHEELDOWN" "weaponSet"
--------------------------------------------------- This is a duck toggle script. Press "c" once to crouch, press again to stand up. (Credit: Greeze) //Duck Togglealias duckToggle "duck1"alias duck1 "+duck; alias duckToggle duck2"alias duck2 "-duck; alias duckToggle duck1" //Duck Toggle Key Binding:bind "c" "duckToggle" Class Specific scripts (add these to your class cfg’s) Soldier Scripts
Here’s a good ol’ fashioned rocket jump script for you guys who just can’t get it right. (Credit: RayneJarre)
//Rocket Jump
alias +rocketjump "+jump;+duck;wait;+attack"
alias -rocketjump "-jump;-attack;wait;wait;wait;-duck"
bind mouse2 "+rocketjump"
Just look down and press mouse2.
Engineer Scripts
This is Patty’s engineer script. I’ve posted it verbatim so you can fully understand it.
Next is my engineer script. I left it open ended on the sentry placement to allow for rotation. The other three should place with one button. Also, holding down one button will upgrade and letting go will switch back to shotgun. Can also be used to melee peeps down.
developer 1
echo "***PATCHER'S ENGINEER SCRIPT LOADED***"
wait 100
developer 0
//BUILD SENTRY-DISPENSER-ENTRANCE-EXIT ALLOWS USE OF M TO ROTATE BEFORE SENTRY PLACEMENT
alias sentry1 "build 3"
alias dispenser1 "build 0; wait 50; +attack; wait; -attack; slot1"
alias entrance1 "build 1; wait 50; +attack; wait; -attack; slot1"
alias exit1 "build 2; wait 50; +attack; wait; -attack; slot1"
//BUILD KEY BINDINGS
bind "f1" "sentry1"
bind "f2" "dispenser1"
bind "f3" "entrance1"
bind "f4" "exit1"
////DESTROY SENTRY-DISPENSER-ENTRANCE-EXIT
alias sentry2 "destroy 3"
alias dispenser2 "destroy 0"
alias entrance2 "destroy 1"
alias exit2 "destroy 2"
//DESTROY KEY BINDINGS
bind "f6" "sentry2"
bind "f7" "dispenser2"
bind "f8" "entrance2"
bind "f9" "exit2"
//HOLD DOWN MOUSE3 TO SWING WRENCH FOR UPGRADE THEN LETTING GO SWITCHES BACK TO SHOTGUN
alias +upgrade1 "slot3; +attack"
alias -upgrade1 "-attack; wait; slot1"
bind "mouse3" "+upgrade1"
bind "mouse1" "+attack"
Spy Scripts
This is another of Patty’s scripts, once again posted verbatim.
Finally [this is] my spy script. This is a little more complicated than my engineer script. I'll just let you guys look it over.
developer 1
echo "***PATCHER'S SPY SCRIPT LOADED***"
wait 100
developer 0
//DISABLE SENTRY GUN - HOLD DOWN THE BUTTON AND IT WILL AUTOMATICALLY PLACE THE DEVICE - LET GO TAKES YOU BACK TO KNIFE
alias +destsent "slot2; +attack"
alias -destsent "-attack; wait; slot3"
bind "l" "+destsent"
//CHANGE CLASSES - CUSTOM SPY SCRIPT
//BLUE TEAM ALIASES
alias redscout "disguise 1 2"
alias redsniper "disguise 2 2"
alias redsoldier "disguise 3 2"
alias reddemoman "disguise 4 2"
alias redmedic "disguise 5 2"
alias redhwguy "disguise 6 2"
alias redpyro "disguise 7 2"
alias redspy "disguise 8 2"
alias redengineer "disguise 9 2"
//RED TEAM ALIASES
alias bluescout "disguise 1 1"
alias bluesniper "disguise 2 1"
alias bluesoldier "disguise 3 1"
alias bluedemoman "disguise 4 1"
alias bluemedic "disguise 5 1"
alias bluehwguy "disguise 6 1"
alias bluepyro "disguise 7 1"
alias bluespy "disguise 8 1"
alias blueengineer "disguise 9 1"
//SETS F1-F9 TO DISGUISE INTO EACH CLASS 1=SCOUT 2=SNIPER 3=SOLDIER 4=DEMOMAN 5=MEDIC 6=HWGUY 7=PYRO 8=SPY 9=ENGINEER
alias BLUETEAM "bind f1 redscout; bind f2 redsniper; bind f3 redsoldier; bind f4 reddemoman; bind f5 redmedic; bind f6 redhwguy; bind f7 redpyro; bind f8 redspy; bind f9 redengineer"
alias REDTEAM "bind f1 bluescout; bind f2 bluesniper; bind f3 bluesoldier; bind f4 bluedemoman; bind f5 bluemedic; bind f6 bluehwguy; bind f7 bluepyro; bind f8 bluespy; bind f9 blueengineer"
//SWITCHES UP F10 TO TOGGLE BETWEEN COLORS DEPENDING ON WHICH TEAM YOU ARE ON
alias toggletored "alias changecolor setred"
alias toggletoblue "alias changecolor setblue"
//CHANGES THE BINDINGS AND LETS YOU CHOOSE BINDS APPROPRIATE TO YOUR TEAMS COLOR
alias setred "REDTEAM; redannounce; toggletoblue"
alias setblue "BLUETEAM; blueannounce; toggletored"
//TEAM ANNOUNCE ALIAS
alias redannounce "developer 1; echo ***I AM ON RED TEAM***; wait 100; developer 0"
alias blueannounce "developer 1; echo ***I AM ON BLUE TEAM***; wait 100; developer 0"
//DEFAULT TEAM IS RED
alias changecolor "setred"
Bind "F10" "CHANGECOLOR"
//MAKES IT SO THAT AS SOON AS YOU STOP ATTACKING YOU AUTOMATICALLY REDISGUISE
alias +backstab1 "+attack"
alias -backstab1 "-attack; lastdisguise"
bind "mouse1" "+backstab1"
bind "mouse3" "slot3"
---------------------------------------------------
This script auto-disguises “randomly” after a back stab. Posted verbatim. (Credit: kerneld)
Note: credit, where credit is due (besides Stryfex's great, and hard, work, of course) .. I'm gonna use part of Patty's Spy code here
alias +backstab1 "+attack"
alias -backstab1 "-attack; nextdisguise"
bind "mouse1" "+backstab1"
bind p "tooglecolorRed"
alias tooglecolorRed "alias nextdisguise RedDemo; developer 1; echo ** Using RED Disguises **; wait 10; developer 0; bind p tooglecolorBlue"
alias tooglecolorBlue "alias nextdisguise BlueDemo; developer 1; echo ** Using BLUE Disguises **; wait 10; developer 0; bind p tooglecolorRed"
alias nextdisguise "BlueDemo"
//RED TEAM ALIASES
alias BlueDemo "disguise 4 1; wait; alias nextdisguise BlueEngy"
alias BlueEngy "disguise 9 1; wait; alias nextdisguise BlueSniper"
alias BlueSniper "disguise 2 1; wait; alias nextdisguise BluePyro"
alias BluePyro "disguise 7 1; wait; alias nextdisguise BlueDemo"
//BLUE TEAM ALIASES
alias RedDemo "disguise 4 2; wait; alias nextdisguise RedEngy"
alias RedEngy "disguise 9 2; wait; alias nextdisguise RedSniper"
alias RedSniper "disguise 2 2; wait; alias nextdisguise RedPyro"
alias RedPyro "disguise 7 2; wait; alias nextdisguise RedDemo"
-- Starts always with Blue Team, and everytime you press the 'toogle color' button, and right at the beginning, starts the cycle with the DemoMan.
Medic Scripts
This is an upgraded version of the auto-medigun script. Fixes some bugs the previous script had. Just press "pgup" and you'll automatically start healing your target with no more input from yourself. (Credit: Essobie)//Auto-Medigunalias +automedigun "-attack; use tf_weapon_medigun; wait 3; +attack"alias -automedigun "" alias syringegun "-attack; use tf_weapon_syringegun_medic; -reload”alias bonesaw "-attack; use tf_weapon_bonesaw; -reload"bind "PGUP" "+automedigun" // Tap to select new heal target.bind "MWHEELUP" "syringegun" // Use to select Syringe Gun (and disable AutoMedigun)bind "MWHEELDOWN" "bonesaw" // Use to select Bonesaw (and disable AutoMedigun)Sniper Scripts
Here’s another script from Patty that gives sniping the good old TFC feel. Posted verbatim.
Ok the below script was written by Stryfex, I just tweaked the wait times a bit. Anyone not on broadband might have to increase the wait commands further.
Basically the way it works is holding down the mouse 1 button zooms in and charges the shot. Letting go of mouse one fires and zooms out. It operates a lot like TFC sniper riffle which I'm used too.
Please note that this will essentially screw up your mouse 1 for other weapons.
//OLD SKOOL TFC SNIPER STYLE
alias +tfcsniper "+attack2; wait 25; -attack2"
alias -tfcsniper "+attack; wait 100; -attack; +attack2; wait 25; -attack2"
bind mouse1 +tfcsniper
Demoman Scripts
In this script, just fire off a sticky bomb, run over it, and push x. (Credit: Not sure, educate me if you can)
//Classic Pipebomb Jump
alias +pj "+lj; +attack2"
alias -pj "-lj"
alias +lj "+duck;wait;wait;+jump"
alias -lj "-duck;-jump; -attack2"
bind "x" +pj
Heavy Weapons Guy Scripts
Press your right mouse button to start up the automatic spinning, and press your middle mouse button to stop it. Based off of the Auto Medigun script by Essobie. (Credit: nickpelone)
//Auto Minigun Spinupalias +autominigun "-attack2; use tf_weapon_minigun"alias -autominigun "+attack2"alias stopautominigun "-attack2" bind "MOUSE2" "+autominigun" //Right click to start up the minigun.bind "MOUSE3" "stopautominigun // Middle click to stop the minigun from spinning. Utilizing a default.cfg Here’s something from me that may prove useful to you in your scripting and binding adventures.
Make a config file called default; in there you can add Patty’s class selection script, slot toggle scripts, voice bindings, basically any script or bind that will get over written by a class config. Now in all your class configs add:
BIND “x” “exec default.cfg”
Doing this sets your controls back up to the way they were before you used a class config. This will free up more keys for your binding and scripting pleasure.
A look at practical binding
Scripts may be the zenith of custom configuration, but let's not forget that some simple binds can make your life that much easier. For example, this binding combo shows that the primary weapon is bound to mouse1, the secondary to mouse2, and the melee weapon to mouse 3.
bind "mouse1" "slot1"
bind "mouse2" "slot2"
bind "mouse3" "slot3"
Being bound this way makes it so that in the heat of battle, with all your frantic clicking and button smashing, you'll get the weapon you want, and not over shoot it and accidently pull out your melee weapon when you wanted your secondary. This can be set up in any config you want, including your config.cfg. You can also set this up simply by using the keyboard settings option that TF2 supplies.
Addendum
There you have it, a pretty comprehensive compilation of scripts. I will update this guide whenever I can. Please feel free to use the cfg guide I added in the forums to come up with your own. If there are any additions you want me to make, just tell me and I’ll pop em’ up here. Furthermore, if there is anything on here you want me to elaborate on, please say so, and I will make it as clear as possible. Happy fragging guys. Enjoy!
Last updated: October 6, 2007 at 2:20 pm
http://tf2wiki.net/wiki/Scripting