The TRPG 5.005 Help List FAQ



II. autoexec.cs

A. Creation.
      The file "autoexec.cs" is not present in your tribes directory when you install tribes freshly new, or uprgade tribes to the RPG mod.
      You will need to create it by right-clicking in the target folder (covered in sub-section B of this section) and select "new text document." A file will pop-up called "new text document.txt."
      If there is not a .txt on the end of the file then: open a folder, go to the "View" menu, then "Folder Options," and once in the Folder Options box, click the tab called "View." In the "advanced settings" dialogue area, make sure "hide file extentions for known file types" is not checked. Then where is says "Folder Views" in the same screen, click on "Like Current Folder." This will make your "New Text Document" have a .txt on the end.
      Right-click on the file "New Text Document.txt" and select "rename." Change the "New Text Document.txt" to "autoexec.cs," and viola!
      Now you have an autoexec.cs file.

B. Placement.
      Where do you put the autoexec.cs file? Create the autoexec.cs file in the target folder of "c:\dynamix\tribes\rpg" (or wherever you installed tribes rpg to.) This way, every time you launch "tribes.exe -rpg" you will automatically have your autoexec.cs executed for you for the RPG mod.
      If you want to execute this file (or others you may have made with.cs ending) manually, you can go to the console by pressing the tilde ( ~ ) and typeing: " exec("filename"); " and pressing enter. This will execute whatever file is in the "filename" part of the syntax. This can be helpful if you a have many different "keybindx.cs" files (like I do) or are running an RPG server and want to be able to execute custom quests script files on your own, rather than when the autoexec.cs file runs.

C. Editing and Keybinding.
      Now you may be wondering what in the world you have this file for, right? Well, you can use it to do a variety of things, the most common of which is edit your key-binds, or launch a script automatically for you every time you start up tribes.exe -rpg.
      To edit it, simply open it up in text editor or wordpad and add whatever execution(s)/keybind(s) you want to the file.
      Telling autoexec to execute an other file:
      To execute a script you wrote automatically, open up autoexec.cs and add the following:
exec("myscript");
      Now, every time you load tribes.exe -rpg, the file myscript.cs will also load up automatically for you. Replace the text "myscript" with whatver .cs file you have made and want to execute automatically every time.
      Keybinds:
      To start out, keybinding is your best bet for understanding the importance of this file. You can use keybinds to add one-touch accessibilty to player and admin commmands.
      Adding the player command "#cast heal" bind to the "0" key of the keyboard:
      Open up the autoexec.cs file and put the following line in just before your section of keybinds:
editActionMap("playMap.sae");
      Next, you will need to use the following line to insert the keybind:
bindCommand(keyboard0, make, "0", TO, "remoteeval(2048, say(0, \"#cast heal\"));");
      It's as easy as that. To change the key it uses, or what spell it says, just make a new line with different info in each of those fields.
      What if you can't figure out the name to a key on your keyboard?
      Well, you can simply start up tribes, go to options, use the built-in keybiner (setup your controls buttons) and click on built-in command to bind to (deploy becon for this example) then press the button you are trying to figure out. Exit the controls menu, and tribes.
      Now go to your "/tribes/config/" folder and using notepad, wordpad or other txt file editor open up the file called "config.cs". Look for the line that contains your "beacon" bind, for this example:
bindCommand(keyboard0, make, "delete", TO, "use(\"beacon\");");
      Now you know that the button you pressed to bind the beacon is called "delete" by the tribes program, and can set this to a new function, other than:
use(\"beacon\");
      For example, you could change the delete key to execute the #meditate command for you whenever you press it by adding this line to your autoexec.cs file keybinds section:
bindCommand(keyboard0, make, "delete", TO, "remoteeval(2048, say(0, \"#meditate\"));");
      Here is a good example of how to use your autoexec.cs file for a set of keybinds:
editActionMap("playMap.sae");
bindAction(keyboard0, make, "x", TO, IDACTION_MOVEFORWARD, 1.000000);  //autowalker
bindCommand(mouse0, make, button1, TO, "postaction(2048,IDACTION_FIRE1,-0);");  //auto fire
bindCommand(mouse0, make, button2, TO, "remoteeval(2048, say(0, \"#cast beam\"));");   //beam
bindCommand(keyboard0, make, "rcontrol", TO, "use(\"Energy Vial\");");   //use energy vial
bindCommand(keyboard0, make, "ralt", TO, "use(\"Crystal Blue Potion\");");   //use crytal blue potion
bindCommand(keyboard0, make, "delete", TO, "remoteeval(2048, say(0, \"#meditate\"));");   //meditate
bindCommand(keyboard0, make, "end", TO, "remoteeval(2048, say(0, \"#wake\"));");   //wake
bindCommand(keyboard0, make, "numpad1", TO, "remoteeval(2048, say(0, \"#cast thorn\"));");   //thorn
bindCommand(keyboard0, make, "numpad2", TO, "remoteeval(2048, say(0, \"#cast fireball\"));");   //fireball
bindCommand(keyboard0, make, "numpad3", TO, "remoteeval(2048, say(0, \"#cast firebomb\"));");   //firebomb
bindCommand(keyboard0, make, control, "0", TO, "remoteeval(2048, say(0, \"#cast shield\"));");   //shield