Difference between revisions of "Scripts"
Line 25: | Line 25: | ||
An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving. | An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving. | ||
− | =Example: How it should look= | + | ===Example: How it should look=== |
[code]alias example "command1; command2; command3"[/code] | [code]alias example "command1; command2; command3"[/code] | ||
Line 40: | Line 40: | ||
Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the [b]bind[/b] command. | Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the [b]bind[/b] command. | ||
+ | |||
=Example: Detonate dispenser= | =Example: Detonate dispenser= | ||
[Code] bind x "detdispenser"[/code] | [Code] bind x "detdispenser"[/code] |
Revision as of 00:37, 4 January 2009
What's a Script?
A script is a config file (usually for a specific class) that has key binds that make it easier for you to access class-specific functions.
General Scripts
General Scripts
Cleanup Script Very useful!
List of Class-Specific Scripts
Scout Scripts
Sniper Scripts
Soldier Scripts
Demoman Scripts
Medic Scripts
HWGuy Scripts
Pyro Scripts
Spy Scripts
Engineer Scripts
Making a Script
Making a script is nothing more than stringing commands together to achieve a particular result. To create a sequence of actions, list your commands followed by a semicolon (;) then a space ( ). When listing multiple commands, make sure you use quotation marks (") to enclose your script!
Aliases
An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving.
Example: How it should look
[code]alias example "command1; command2; command3"[/code]
This code creates an alias named example. If we typed example into the console, or executed it in a cfg file, command 1, 2, and 3 would execute in the order listed in the alias.
An alias can also be used to shorten commands for use in scripts.
[code]alias c4 "command4"[/code]
We can use our newly created commands, [b]example[/b] and [b]c4[/b], in further scripts. [code] alias example2 "example; c4"[/code]
This would be a good time to visit the [link to command list] to see what possibilities you can string together.
Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the [b]bind[/b] command.
Example: Detonate dispenser
[Code] bind x "detdispenser"[/code]
Example: Medic Shout + Text
[code]bind x "saveme; say Text here."[/code]
How to Use the class.cfg file system
Located in your FortressForever\cfg folder, you will see a .cfg file for each class. [pic]
These files are executed when you spawn after dying. They are perfect for storing class-specific key bindings, as well as more advanced scripts. The Userconfig.cfg file is also loaded every time you spawn, because it is listed in the class.cfg. Userconfig.cfg is used for global scripts and aliases.
List of commands
A list of available commands can be found at the Script Reference page.
Uh oh! I screwed up one of my config files! What do I do?
Relax. Just find the default config listed below for whatever you screwed up and paste it into the config file.
Userconfig default
Scout default
Sniper default
Soldier default
Demoman default
Medic default
Hwguy default
Pyro default
Spy default
Engineer default
Civilian default