Difference between revisions of "Scripts"
(New page: =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== [[Genera...) |
m |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Infobox manual/Header}} | |
+ | {{Infobox manual}} | ||
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. | 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. | ||
Line 17: | Line 18: | ||
[[Engineer Scripts]]<BR> | [[Engineer Scripts]]<BR> | ||
− | + | =Making a Script= | |
− | Making a script can be | + | 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=== | ||
+ | <pre>alias example "command1; command2; command3"</pre> | ||
+ | |||
+ | 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. | ||
+ | |||
+ | <pre>alias c4 "command4"</pre> | ||
+ | |||
+ | We can use our newly created commands, '''example''' and '''c4''', in further scripts. | ||
+ | <pre>alias example2 "example; c4"</pre> | ||
+ | |||
+ | This would be a good time to visit the [[Script Reference]] 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 '''bind''' command. | ||
+ | |||
+ | ===Example: Detonate dispenser=== | ||
+ | <pre>bind x "detdispenser"</pre> | ||
+ | |||
+ | ===Example: Medic Shout + Text=== | ||
+ | <pre>bind x "saveme; say Text here."</pre> | ||
+ | |||
+ | =How to Use the class.cfg file system= | ||
+ | |||
+ | Located in your FortressForever\cfg folder, you will see a .cfg file for each class. | ||
+ | [example directory picture] | ||
+ | |||
+ | 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=== | ===List of commands=== | ||
Line 39: | Line 74: | ||
[[Category:Scripts]] | [[Category:Scripts]] | ||
+ | {{Infobox manual/Footer}} |
Latest revision as of 22:19, 1 May 2010
General ScriptsGeneral Scripts List of Class-Specific ScriptsScout Scripts Making a ScriptMaking 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! AliasesAn 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 lookalias example "command1; command2; command3" 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. alias c4 "command4" We can use our newly created commands, example and c4, in further scripts. alias example2 "example; c4" This would be a good time to visit the Script Reference 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 bind command. Example: Detonate dispenserbind x "detdispenser" Example: Medic Shout + Textbind x "saveme; say Text here." How to Use the class.cfg file systemLocated in your FortressForever\cfg folder, you will see a .cfg file for each class. [example directory picture] 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 commandsA 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 |