Scripting

Scripts are text files that enable people to make those multi-colored links and words in the chat windows in-game. Scripts can open a new window using a link or simply make a set of words appear in a variety of colors. Please not that you cannot use a script to make your character attack something/someone, cast spells, or do anything that affects mobs or other players.

They are created using a mix of XHTML and HTML coding. The down side is that you cannot do just about anything you want in a script. The other down side is that these scripts are very unforgiving -- one single tiny mistake can send you hunting for a while to find the error.



Creating, Opening, And Saving Scripts

If you have never done scripting before, or have but want a template, please check out the links to the left. The very first two listed are templates on which to build basic scripts.

Make sure to place all scripts into the following: C:/Program Files/Funcom/Age of Conan/Scripts . You may find that the Program Files folder is not simply named Program Files. It may have an (x86) or something following it. Your game should only be installed into one of these Program Files folders. If you do not have a Scripts folder, you may simply create one. It will not hurt your game nor any custom UI you might have running. Honest!

You will need to open/start all scripts in a text document or HTML editor that can save the document as a .txt file. Never open such documents in programs like Microsoft Word that automatically format a document (and I do not mean with pretty colors, either). If you do not want to use (or do not have) Notepad and want a good and free HTML editor, try Notepad ++, which can be used in multiple languages.

Make sure to save your script and test it often while editing. It is much easier to catch errors in this way. You do not have to close the script or log out of the game while editing or after saving a script change, however.

Your guildmates may not take kindly to being spammed by a script, so it is recommended that you group up with someone you trust in order to test your scripts.

There are two final rules concerning all scripts that you must be made aware of. Do not leave blank lines in your script text file or put things on new lines. Bundle everything together! The only exception to this rule is that you may place a blank line between the "/ch <channel>" and the start of your script.

Bad Script example:


/ch guild

<FONT FACE='hyboriansmall'>My hyborian text.</FONT>
More text here on the next line.
Final line of text goes here.


Good Script example:


/ch guild

<FONT FACE='hyboriansmall'>My hyborian text.</FONT><BR />More text here on the next line.<BR />Final line of text goes here.


The final rule to remember is that you cannot place more than 1024 characters together (that includes letters, numbers, punctuation, and spaces) without using a <BR />. Doing so will crash your game.



Activating Script Files

Once you have a script saved into your script folder, you may activate it by typing the following into your chat window: /myfile.txt . Make sure to change "myfile" to the name of your script file. Also remember that script filenames are case-sensitive, so myFile.txt is not the same as MYfile.txt . Finally, always make sure to type the " / " before the name of the file and " .txt " after the name of the file.

If you are not in the channel the script is set to display in, it will automatically change the channel to the appropriate one upon pressing the Enter key on the keyboard to activate your script. The one exception to this rule is Group.

You may use scripts in: Global, Group, Guild, Raid, but you will be unable to use scripts in Say and Tell. When displaying scripts in global, do not make your script a very long one, as the channel has a tendency to not display large or even slightly big scripts if enough people are in-game.



Scripting Basics: Fonts

Always use a single quotation ( ' ) around the font face name. Example:

<FONT FACE='hyboriansmall'>My hyborian text.</FONT> More text here in Verdana.

The default font for scripts is Verdana. You do not have to tell the script to use this font. Two other font faces are also accepted by scripts: hyboriansmall and hyborianlarge. No other font is accepted. You cannot set the size of either font, however. It does not work.

Notice in the above example that </FONT> is at the end of the line of code that is to be written in the hyboriansmall font. Do not forget to end the change to the font face you make on a script by using </FONT>. Forgetting to do so will break said script.



Scripting Basics: Colors

Always use a single quotation ( ' ) around the font color name. Example:

<FONT COLOR='white'>My white text</FONT> <FONT COLOR='#4D1A00'>My brown text</FONT>

You may notice that both 'white' and '#4D1A00' are used to tell the script what color to make the text. The 'white' is a color name and the '#4D1A00' is a hexidecimal color. Both are accepted in scripting, with some exceptions applied to using color names. There are only 16 valid color names that you may use: aqua (sometimes cyan instead), black, blue, fuschia (sometimes magenta instead), gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.

If you want to use a color other than the 16 named ones above, you must specify a hexidecimal color code. Please note the hash symbol ( # ) in front of the six-character hexidecimal color code ( <FONT COLOR='#4D1A00'> ). You must use the # symbol in front of any hexidecimal color code or you will have problems with the script. A great online and free resource for finding any hexidecimal color you want is ColorSchemer.



Advanced Scripting: Chat Commands

Scripts can be very versatile if you know what you are doing. Even if you do not have much of a clue, however, there are some things that you can use to improve your scripting abilities.

Concerning the chat commands ( /emote , /tell , /help , /s , etc.), all of these may be used in the body of your script. They must be placed inside a new window, however, and cannot be placed directly into the chat itself.

This is an example of an acceptable script:


/ch global

<A HREF="text://<FONT COLOR='#642362'>Here is text inside a window</FONT><BR /><BR /><A HREF='chatcmd:///ymca?ep=&epile=4q6n41784q5445794q6n45794q4638344q7935725n586o3q&edata=b39190b89dc175e81c81a9aaba46102e'>Here is the link inside the window</A>"><FONT FACE='hyboriansmall'>This is the link that appears in global</FONT></A>


Advanced Scripting: Special Variables

There are some very special commands that can only be used within the body of a script.


%* (the percent sign followed by an asterisk) replaces the spot with all of the given parameters.

%0 (the percent sign followed by the number zero) places the name of the script you are running in that spot.

%1 (the percent sign followed by the number one) replaces the first word written after your script name.

%m (the percent sign followed by an "m") places your character's name in that spot.

%f (the percent sign followed by an "f") places the name of the target you are currently fighting in that spot.

%t (the percent sign followed by an "t") places your current primary target in that spot.