Scout scripts

From TF2 Wiki

Share/Save/Bookmark
Jump to: navigation, search

A Note About The Wait Command

Valve has fixed the functionality of the sv_allow_wait_command server variable. When disabled (set to 0) the engine simply ignores and omits any wait commands that the server is given. Consequently, many scripts on this website are broken or will only function in very specific situations. This variable is set to 1 by default, but many servers base their server.cfg files off of competitive league settings, which typically disable wait commands. Furthermore, scripts that do loops (see Autopistol Script for an example) will crash your client when triggered.


Community script navigation
General scripts
Weapon scripts
General class scripts
Collection scripts
Class scripts
Scout scripts
Soldier scripts
Pyro scripts
Engineer scripts
Heavy scripts
Demoman scripts
Medic scripts
Sniper scripts
Spy scripts

Contents

The Flank n' Spank Compilation by Shock-

This is a compilation of 3 scripts that are extremely effective when used together. This is in no way cheating, anything that these scripts do you could do on your own with practice. (I have recently fixed some minor issues, and changed some things about the script.)

This script will improve:

-Movement and Dodging
-Jumping and Air Strafing
-Weapon Usage and Efficiency

Contents:

-Null-Cancelling Movement Script (Prevents you from pressing two opposing directions, which causes you to stop moving)
-Jump Crouching (Every jump becomes a crouch jump)
-w0lvesy's Scout Script
MOUSE1 Selects the Scattergun and rebinds to fire it.
MOUSE2 Selects the Pistol and rebinds to fire it.
MOUSE4 Selects the Bat and rebinds to swing it.

Put this in your scout.cfg (if you dont have one, make one by putting this in a text file and saving as a .cfg)

//<<------------------------------Flank n Spank---------------------------->>
// Null-cancelling movement script
// (prevents you from pressing two opposing directions, which causes you to stop moving)

bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright

alias +mfwd "-back;+forward;alias checkfwd +forward"
alias +mback "-forward;+back;alias checkback +back"
alias +mleft "-moveright;+moveleft;alias checkleft +moveleft"
alias +mright "-moveleft;+moveright;alias checkright +moveright"
alias -mfwd "-forward;checkback;alias checkfwd none"
alias -mback "-back;checkfwd;alias checkback none"
alias -mleft "-moveleft;checkright;alias checkleft none"
alias -mright "-moveright;checkleft;alias checkright none"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""

//Holding spacebar down jumps, then crouches (useful for air strafing, not having to hold ctrl)
//
bind space +crouchjump
alias +crouchjump "+jump;+duck"
alias -crouchjump "-jump;-duck"

// ---------------------------------------------------------------------------------------------------------------------------------
//                                                           w0lvesy's scout script
// ---------------------------------------------------------------------------------------------------------------------------------

//These aliases can also have crosshair data on them, so your crosshair switches as you change weapons.
//For example: alias "+scatter" "slot1;+attack;cl_crosshair_file crosshair5;cl_crosshair_scale 20;cl_crosshair_red 0;cl_crosshair_green 255;cl_crosshair_blue 0;r_drawviewmodel 0;viewmodel_fov 0;Q1;"

// scattergun 
alias "+scatter" "slot1;+attack;"
alias "-scatter" "-attack"

// pistol 
alias "+pistol" "slot2;+attack;"
alias "-pistol" "-attack"

// bat 
alias "+bat" "slot3;+attack;"
alias "-bat" "-attack"

// JEERS!
alias "jeersm8" "voicemenu 2 3"

// NEEDADISPENSAHEEYA
alias "dispenser" "voicemenu 1 4"

// BINDINGS
bind "mouse1" "+scatter"
bind "mouse2" "+pistol"
bind "mouse4" "+bat"
bind "mwheelup" "jeersm8"
bind "mwheeldown" "dispenser" 

(I have noticed that spectator mode is broken with this script, to remedy either rebind the 3 spectator controls or execute another .cfg with the new binds in it)

The 3 commands are spec_prev, spec_next, and spec_mode

I also elect to use the scout controls for soldier.

Put the following script in any (class).cfg file you want normal controls for. I have left the Null-Canceling Movement Script in because it is useful for all classes. In fact, I would recommend putting it in your autoexec.cfg so it will be on every class.

//Rebinds normal controls
bind "MOUSE5" "invprev"
bind "MOUSE3" "invnext"
bind "MOUSE1" "+attack"
bind "MOUSE2" "+attack2"
bind "WHEELUP" "invnext"
bind "WHEELDOWN" "invprev"
bind "space" "+jump"

// Null-cancelling movement script
// (prevents you from pressing two opposing directions, which causes you to stop moving)

bind w +mfwd
bind s +mback
bind a +mleft
bind d +mright

alias +mfwd "-back;+forward;alias checkfwd +forward"
alias +mback "-forward;+back;alias checkback +back"
alias +mleft "-moveright;+moveleft;alias checkleft +moveleft"
alias +mright "-moveleft;+moveright;alias checkright +moveright"
alias -mfwd "-forward;checkback;alias checkfwd none"
alias -mback "-back;checkfwd;alias checkback none"
alias -mleft "-moveleft;checkright;alias checkleft none"
alias -mright "-moveright;checkleft;alias checkright none"
alias checkfwd none
alias checkback none
alias checkleft none
alias checkright none
alias none ""

w0lvesy's Scout script

Just a quick script I made for when I play Scout...works for me 8)

MOUSE1 Selects the scattergun and rebinds to fire it
MOUSE2 Selects the pistol and rebinds to fire it
MOUSE4 Selects the bat and rebinds to swing it
MOUSE5 Hits the baseball while using sandman
rbw

// ---------------------------------------------------------------------------------------------------------------------------------
//                                                           w0lvesy's scout script
// ---------------------------------------------------------------------------------------------------------------------------------

// scattergun 
alias "+scatter" "slot1;+attack;"
alias "-scatter" "-attack"

// pistol 
alias "+pistol" "slot2;+attack;"
alias "-pistol" "-attack"

// bat 
alias "+bat" "slot3;+attack;"
alias "-bat" "-attack"

//JEERS!
alias "jeersm8" "voicemenu 2 3"

//NEEDADISPENSAHEEYA
alias "dispenser" "voicemenu 1 4"

bind "mouse1" "+scatter"
bind "mouse2" "+pistol"
bind "mouse4" "+bat"
bind "mwheelup" "jeersm8"
bind "mwheeldown" "dispenser"

Force Jump

Aim your Force-A-Nature towards the ground at about a twenty-five degree angle and press the bind key. While you are on the air use your jump key to move forward.
Nukkuva
alias "+forcejump" "+jump; +duck; +attack"
alias "-forcejump" "-jump; -duck; -attack"
bind "MOUSE2" "+forcejump"

Need a dispenser here!

NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE! NEED A DISPENSER HERE!
//Need A Dispenser here!
//==================
alias dispenser voicemenu 1 4
bind v dispenser

DISPENSER HERE v2.0

This functions like the above except it loops the voice command so you don't have to keep pressing the key. Press it again to toggle it off. Hopefully you will get many dispensers.
This script will cause a loop crash if the server you play on disables the wait command with the sv_allow_wait_command 0 setting.
alias dispenser "dispenser_on"
alias dispenser_on "alias _dispenser !dispenser; !dispenser; alias dispenser dispenser_off"
alias dispenser_off "alias _dispenser; alias dispenser dispenser_on"
alias !dispenser "voicemenu 1 4; wait 2; _dispenser"

Autopistol

Note, this script is now obsolete, as the function as been integrated into the game. Script is left here for reference only.

This is about as close to cheating as scripting can take you. I didn't come up with the original method of scripting this, but I've cleaned it up so that scripters can understand what the hell it is doing, and commented every line as such.
You can keep this simple by binding something directly to "+apistol" and only using that key when you have the pistol out. Or, you can use the optional set of scripting below to have your normal attack key swapped when you select different weapons. This will NOT work with using invnext/invprev for weapon selection!
This script will cause a loop crash if the server you play on disables the wait command with the sv_allow_wait_command 0 setting.
Posted by Essobie
// AutoPistol
// ==========
alias +apistol "alias repeat_function +repeat; +repeat"  // While held down, starts the repeater function and sets it to repeat.
alias -apistol "alias repeat_function stoprepeating"     // When released, repeat_function is disabled through the stoprepeating alias.
alias repeat_function "+repeat"                          // So long as this alias holds, +attacks and waits will continue to fire.
alias +repeat "+attack; wait 2; -repeat"                 // Repeater function attacks, waits, goes to -repeat.
alias -repeat "-attack; wait 2; repeat_function"         // Stops attack, waits, fires another repeat_function.
alias stoprepeating ""

// AutoPistol Primary/Secondary Setup with Auto Reload (Optional)
// ==============================================================
alias _primary "slot1; +reload; alias +scout_attack +attack; alias -scout_attack -attack; -apistol"
alias _secondary "slot2; -reload; alias +scout_attack +apistol; alias -scout_attack -apistol"
alias _melee "slot3; -reload; alias +scout_attack +attack; alias -scout_attack -attack; -apistol"

bind MOUSE1 "+scout_attack"
bind 1 "_primary"
bind 2 "_secondary"
bind 3 "_melee"


Scout Crouch Jump on Second Jump

Makes the 2nd jump, when doubletapped, into a crouch jump.
alias "+dtkey" "+dtap"
alias "-dtkey" "-dtap"
alias "+dtap" "+dtpri; alias +dtkey +dtap2; alias -dtkey -dtap2"
alias "-dtap" "-dtpri; wait 50; alias +dtkey +dtap; alias -dtkey -dtap"
alias "+dtap2" "+dtsec"
alias "-dtap2" "-dtsec; alias +dtkey +dtap; alias -dtkey -dtap"
alias "+dtpri" 	"+jump"
alias "-dtpri"    "-jump"
alias "+dtsec" 	"+jump; +duck"
alias "-dtsec"    "-jump; -duck"
bind 	"space" 	"+dtkey"


Scout Quick-dodge

http://clancya.org/2007/10/10/guide-tf2-script-quick-dodge-for-the-scout/ http://clancya.org/wp-content/uploads/2007/10/dodge.txt
Posted by NiteCyper
//==============================================================================//
//										//
// Name: 	Quick Dodge Script for the scout				//
// Author:	C-YA | Mar_Tzipan						//
// Date:	09/10/2007 							//
//										//
//==============================================================================//
//										//
// Description:	This script adds functionality to your movement			//
// 		keys by performing a quick dodge whenever 			//
//		tapped twice (such as in Unreal Tournament)			//
//										//
// Usage:	Holding or pressing the movement keys would			//
//		result in regular movement. the script is only			//
//		triggered when a movement key is held for a 			//
//		very short period of time, gets released, and 			//
//		once again gets pressed (meaning tapped twice).			//
//										//
// Restriction:	The script is useable by all classes.				//
//		However, only the scout can utilize its full 			//
//		potential.							//
//										//
// Activation:  The script must be loaded to be used, this can			//
//		be achieved by using the EXEC command ingame			//
//		and specifing this file's name (Dodge.cfg), or			//
//		by appending it to your autoexec.cfg, or by 			//
//		issuing the EXEC command from the autoexec.cfg.			//
//		NOTE: all files mentioned above must reside in			//
//		..\SteamApps\<USER>\team fortress 2\tf\cfg			//
//										//
// Setting up:	To use this script, you must bind the aliases 			//
//		named: "+MoveDodgeUp", "+MoveDodgeDown", 			//
//		"+MoveDodgeLeft" and "+MoveDodgeRight".				//
//		"+InAirAction" and "-InAirAction" are available 		//
//		for doing actions in mid air (such as ducking).			//
//		Default setting for all of these can be found			//
//		at the bottom of this script.					//
//										//
// Issues:	Dodging with classes other than scout will 			//
//		result in a pathetic little hop, I suggest 			//
//		refraining from it.						//
//										//
// Notes:	The script would work for a scout even if the 			//
//		first jump has been used up (or if falling)			//
//		Experiment with it to view the possibilities.			//
//		For some reason, aliasing the wait commands did 		//
//		not work for me, so many in the future this 			//
//		script would be more tweakable.					//
//										//
// Credits:	http://tf2wiki.net/index.php/Scripting				//
//		http://tf2wiki.net/index.php/Community_Scripts			//
//		And everyone who contributed to them.				//
//										//
//										//
//  Copyright 2007 Mar_Tzipan http://clancya.org/				//
//  This program is free software: you can redistribute it and/or modify	//
//  it under the terms of the GNU General Public License as published by	//
//  the Free Software Foundation, either version 3 of the License, or		//
//  (at your option) any later version.						//
//										//
//  This program is distributed in the hope that it will be useful,		//
//  but WITHOUT ANY WARRANTY; without even the implied warranty of		//
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the		//
//  GNU General Public License for more details.				//
//										//
//  You should have received a copy of the GNU General Public License		//
//  along with this program.  If not, see <http://www.gnu.org/licenses/>.	//
//										//
//==============================================================================//

//==============================================================================//
// Dodge forward                                                        	//
// Since all the groups are basically the same, only this one is explained 	//
//==============================================================================//

// Set the bindable alias to perform SetMoveUp whenever held
alias +MoveDodgeUp 	"SetMoveUp;"

// Set the bindable alias to perform SetDodgeUp whenever released
alias -MoveDodgeUp 	"SetDodgeUp;"

// Start moving forward and the release alias to perform SetDodgeUp, 
// after the wait period, the release alias is set to stop movement,
// thus disabling the dodge for this instance.
// The wait period determines how fast you have to let go, after
// pressing the movement key, in-order to enable dodging"
alias SetMoveUp 	"+Forward; alias -MoveDodgeUp SetDodgeUp; wait 15; alias -MoveDodgeUp HaltMoveUp;"

// Halting movement and setting the next key press to dodge,
// after the wait period, the alias returns to movement functionality.
// The wait period determines how fast you must tap the key in-order to dodge.
alias SetDodgeUp 	"-Forward; alias +MoveDodgeUp DodgeUp; wait 15;  alias +MoveDodgeUp SetMoveUp;"

// Stop movement and reset the alias
alias HaltMoveUp 	"-Forward; alias -MoveDodgeUp SetDodgeUp;"

// Perform the actual dodge, InAirAction allows you to add actions of your own while in mid air.
alias DodgeUp 		"+Forward; wait 2; +jump; wait 2; +InAirAction;-jump; wait 2; +jump; wait 2; -jump; wait 60; -InAirAction;"

//============//
// Dodge back //
//============//
alias +MoveDodgeDown 	"SetMoveDown;"
alias -MoveDodgeDown 	"SetDodgeDown;"
alias SetMoveDown 	"+Back; alias -MoveDodgeDown SetDodgeDown; wait 15; alias -MoveDodgeDown HaltMoveDown;"
alias SetDodgeDown 	"-Back; alias +MoveDodgeDown DodgeDown; wait 15;  alias +MoveDodgeDown SetMoveDown;"
alias HaltMoveDown 	"-Back; alias -MoveDodgeDown SetDodgeDown;"
alias DodgeDown 	"+Back; wait 2; +jump; wait 2; +InAirAction; -jump; wait 2; +jump; wait 2; -jump; wait 60; -InAirAction;"

//============//
// Dodge Left //
//============//
alias +MoveDodgeLeft 	"SetMoveLeft;"
alias -MoveDodgeLeft 	"SetDodgeLeft;"
alias SetMoveLeft 	"+MoveLeft; alias -MoveDodgeLeft SetDodgeLeft; wait 15; alias -MoveDodgeLeft HaltMoveLeft;"
alias SetDodgeLeft 	"-MoveLeft; alias +MoveDodgeLeft DodgeLeft; wait 15;  alias +MoveDodgeLeft SetMoveLeft;"
alias HaltMoveLeft 	"-MoveLeft; alias -MoveDodgeLeft SetDodgeLeft;"
alias DodgeLeft 	"+MoveLeft; wait 2; +jump; wait 2; +InAirAction; -jump; wait 2; +jump; wait 2; -jump; wait 60; -InAirAction;"

//=============//
// Dodge Right //
//=============//
alias +MoveDodgeRight 	"SetMoveRight;"
alias -MoveDodgeRight 	"SetDodgeRight;"
alias SetMoveRight 	"+MoveRight; alias -MoveDodgeRight SetDodgeRight; wait 15; alias -MoveDodgeRight HaltMoveRight;"
alias SetDodgeRight 	"-MoveRight; alias +MoveDodgeRight DodgeRight; wait 15;  alias +MoveDodgeRight SetMoveRight;"
alias HaltMoveRight 	"-MoveRight; alias -MoveDodgeRight SetDodgeRight;"
alias DodgeRight 	"+MoveRight; wait 2; +jump; wait 2; +InAirAction; -jump; wait 2; +jump; wait 2; -jump; wait 60; -InAirAction;"

//=========================================//
// Binds - This is what you want to change //
//=========================================//
bind "UpArrow" 		"+MoveDodgeUp"
bind "DownArrow" 	"+MoveDodgeDown"
bind "LeftArrow" 	"+MoveDodgeLeft"
bind "RightArrow" 	"+MoveDodgeRight"

//============================================//
// InAction - This is what you want to change //
//============================================//
alias +InAirAction 	"+Duck"
alias -InAirAction 	"-Duck"


Total Weapon Interface Redesign

This is a total redesign of the weapons interface.
Features:
1: Mouse2 pulls bat and then re-binds to swing it
2: Mouse1 pulls scattergun if on bat and re-binds to fire it
3: 'Q' Swaps the current Mouse1 weapon between scattergun and pistol
  • Note: Mouse1 will still swap to scattergun from bat, however 'Q' swaps to pistol from bat.
This script could use some more management modifications as it's still not as clean as I would like it to be and I think some of it could be scripted a little cleaner/better. However the interface itself works and I am of the impression that this is the single most efficient way to play the Scout class. It saves both time and effort when playing and is a very natural weapons interface.
  • Note: I also am making use of an outside .cfg to clear key input it is defined below
// clear.cfg
// for remapping binds and cleaning things up
// you can exec autoexec as well but I like to keep things simple
bind "MOUSE5" ""
bind "MOUSE3" ""
bind "MOUSE1" "+attack"
bind "MOUSE2" "+attack2"
bind "q" "lastinv"
// Scout.cfg remap -> Provided by Mordentral / M72 The LAW-BOOM BOOM

// Remap defaults
exec clear.cfg

alias +swap1 "slot3; +attack; alias +m1bind +swap2; alias -m1bind -swap2; alias +m2bind +attack; alias -m2bind -attack"
alias -swap1 "-attack"

alias "+m2bind" "+swap1"
alias "-m2bind" "-swap1"
bind "MOUSE2" "+m2bind"

alias +swap2 "slot1; +attack; alias +sht1 +swap3; alias -sht1 -swap3; alias +m1bind +normaatkkreload; alias -m1bind -normaatkkreload; alias +m2bind +swap1; alias -m2bind -swap1"
alias -swap2 "-attack"
alias +normaatkkreload "+attack"
alias -normaatkkreload "-attack"

alias "+m1bind" "+swap2"
alias "-m1bind" "-swap2"
bind "MOUSE1" "+m1bind"

alias +swap3 "slot2; +attack; alias +m1bind +attack; alias -m1bind -attack; alias +sht1 +swap2; alias -sht1 -swap2; alias +m2bind +swap1; alias -m2bind -swap1"
alias -swap3 "-attack"

alias "+sht1" "+swap3"
alias "-sht1" "-swap3"

bind "q" "+sht1;"
Posted by mordentral

Falco's Scout Script

Apparently, people are using this! I've decided to update it, since Valve blessed us with auto-reload and rapid-fire. I saw everyone else had a script posted, and I wanted to fit in, so here's mine. All it does is rebind your keys. It's quite simple, really:

MOUSE1 Pulls out the scatter gun and fires it.
MOUSE2 Does the same with the pistol.
MOUSE3 Pulls out the bat and swings it.
As a side note, if you change from Scattergun to FaN as often as I do, you may want to type "scat" and "fan" in console when you do; calling "fan" simply turns of auto-reload.
///Scat
alias +scat "slot1;cl_autoreload 1;-attack;+attack"
alias -scat "-attack"
alias scat "bind MOUSE1 +scat"
scat

///FaN
alias +fan "slot1;cl_autoreload 0;-attack;+attack"
alias -fan "-attack"
alias fan "bind MOUSE1 +fan"
////If you use the Force-a-Nature and don't want auto-reload, uncomment the following line:
//fan

//Pistol
alias +pist "slot2;cl_autoreload 1;-attack;+attack"
alias -pist "-attack"
bind "MOUSE2" "+pist"

//Melee
alias +melee "slot3;+attack;+attack2;-attack2;"
alias -melee "-attack;-attack2;"
bind "MOUSE3" "+melee"

Reset script, for classes that don't like it:

bind "MOUSE1" "+attack"
bind "MOUSE2" "+attack2"
unbind "MOUSE3"
cl_autoreload 1

Repeated "NEED A DISPENSAH HEAH!" call. 1.1v

bind [key] "calltog"
alias calltog "1call"
alias 1call "call1; alias call2tog call2a; alias calltog 2call"
alias 2call "alias call2tog call2b"
alias call1 "voicemenu 1 4; wait; call2"
alias call2 "call2tog"
alias call2tog "call2a"
alias call2a "wait; call1"
alias call2b "wait; alias call2tog call2a; alias calltog 1call"

What it's supposed to do is go on a loop after you press [key], then when you press [key] again, it stops. --Vance 01:10, 13 February 2009 (UTC)

Corrected the last line so it can work rightly. Before, when you push for the second time the key it was not working. --CrySK49 16:28, 19 August 2011 (EDT)

Disable Quick Dodge Script on Duck

This script deactivates quick dodge when you are ducking since you can't use it while ducking, and tapping the keys to edge in will instead cause you to stand up and possibly take fatal sentry fire.

//To be used with QuickDodge, go ahead and delete if you don't use the QuickDodge script
Alias +Edgein "+duck; bind w +forward; bind a +moveleft; bind s +back; bind d +moveright"
Alias -Edgein "-duck; bind w +MoveDodgeUp; bind s +MoveDodgeDown; bind a +MoveDodgeLeft; bind d +MoveDodgeRight"
Bind ctrl +Edgein

--Shazam! 08:45, 7 April 2009 (UTC)

Rapid Fire

For a class-generic rapid-fire script see Weapon scripts


Sandman switch

Automatically switches to Scattergun/FaN while the Sandman ball is still in the air.

alias "+SANDMAN" "+attack2;"
alias "-SANDMAN" "-attack2;slot1;"
bind "MOUSE2" "+SANDMAN"


Personal tools