Scriptsedit
From AoCWiki
This page is confusing or unclear.
Please help by editing this page or discuss this issue on the talk page.
Contents |
Scripts in AoC are textfiles, they are located in "...\Age of Conan\Scripts\", they have usually no file extention for better handling ingame. They are basically a list of chat commands to be executed on call.
How to create and use a script:
- Open your windows-explorer and go to "...\Age of Conan\Scripts\"
- Create a new Textfile "testscript" in this folder.
- Open it and type: "/w well well, this is a script, who would have figured...."
- Save and close the file. Go ingame (scripts can be modiefied while logged in.)
- type "/testscript" in some chatwindow
Watch yourself whispering, "well well, this is a script, who would have figured...."
All chat commands can be used in scripts, from emotes (/emote embrace) over shouting (/s). Some special command usually only used in scripts are:
- %m = a variable replaced with your name
- %1 = a variable, it is the 1st word you typed after the scriptname
- script: "/s Watch out! A %1!"
- macro: "/macro watch_out /script %t"
This will result in a shout: "Watch out! A <name of your target>!".
- %f similiar to %t but its the fighting target.
- delay x = will pause the script for x milliseconds ( x = 1000 = 1 second) (no / is needed)
- /selectself = target yourself
[edit] What Scripts can and cannot do (Что, скрипт может и не может делать)
Scripts are a powerful way to use emotes, commonly used chat commands and reusable text. You cannot use them to make your character attack, cast spells or generally do anything that affects mobs or other players (well, except you can annoy them with automated spam).
This section needs to be clarified Due to some bad client code, a line in a script cannot exceed 1024 characters. A script may have as many lines as you like, but each one of them must obey the 1024 character limit, or your client will die a horrible death and crash. The chatserver can handle lines longer than 1024 characters, I'm sure all of you have seen huge information windows generated by chatbots that exceed 1024 characters. The client has no problem receiving or sending larger line scripts, but the code responsible for reading long scripts from a file cannot handle the larger scripts, most likely due to a hardcoded 1k readbuffer.
(rus) Скрипт, это мощьная вещь для использования Эмоций, обычных комманд чата и повторяющегося текста. Вы не можете использвать их для того чтобы ваш персонаж атаковал, накладывал заклинания или других действий влияющих на мобов или игроков (ну, за исключением того что вы можете раздаржать их своим авто-спамом).
Более подробно об этом Из-за плохого кода в клиенте игры, строчка скрипта не должна превышать 1024 символа. Скрипт может иметь сколько-угодно строчек, но каждая обязательно не должна превышать лимит в 1024 символа, или ваш клиент: умрет ужасной смертью и сломается. Чат Сервера может вместить строку текста больше чем 1024 символов, Я уверен, что все вы видели большие информационные окна генерируемые Чат-Ботами длина которых превышает указанные 1024 символа. У клиента нет проблем получения и отправки длинных строчек скриптов, но код не отвечает за чтение длинных скриптовых файлов, по большому счету из-за тяжело-обрабатываемого 1kb буфера-чтения.
[edit] Channel
In general, each single line of a script is seen as a chat message you would normaly type into the client and press enter to send it. All commands you know from normal chatting work in scripts. If you have a normal text line, it will be sent to your currently active chat channel. The channel currently active for the script is the one active in the window you started the script from. Unless a line of chat is forced into another channel with specific commands, or the default channel is changed, everything goes into that channel.
The command /ch <channelname> changes the active/default channel to <channelname>. After the script is finished, this channel will still be selected for further chat.
Alternatively you can prefix your text with the channel information e.g. "/gu hi all" will send "hi all" to guild chat regardless of what channel is currently your default. Other options listed below.
[edit] Commands
The following list shows all of the available chatcommands.
- / <text> - Sends <text> to vicinity without changing the default channel. Pay attention to the space between / and <text>.
- /afk <message> - Toggle afk on and off, using <message> as your away message.
- /anon - Toggle annonymous mode on and off. When annonymous the /list command will not show your name.
- /camp - Exit the client the normal, gracefull way. Does not Log you off the game, instead you can switch characters if wanted.
- /chsay <channel> - Send text to a certain channel. IE: /chsay ooc (send to OOC)
- delay <time> - Makes the script wait <time> miliseconds. (no / is needed)
- /ignore <name> - Add or remove <name> from your ignore list.
- To find toons looking to join a team press SHIFT + F to bring up the find team members screen
- /list - Show all players currently in the same zone as you. This needs to be confirmed - seems to be partially there?
- /me <text> - Send the emote <text> to your vicinity without changing the default channel. (It should be noted this command currently does not work.)
- /setoption <option> <value> -
- /pet <name> <command> - Sends <command> to your pet <name>. If you do not specify <name> the command is sent to all your pets. If you specify <name> and your pets name includes spaces you need to add quotationmarks, eg. /pet "Nibbles the dog" terminate. equivalent in AoC?
- /quit - This command will exit the client without further questions. Sometimes used to "fake LD". Not very usefull.
- /s <text> - Shouts <text> in vicinity without changing the default channel.
- /selectself - Target yourself.
- /setoption <option> <value> - Changes the games settings. A list of options is found below.
- /t <text> - Sends <text> to teamchat without changing default channel.
- /text <text> - Shows <text> only in your own chat window.
- /gu <text> - Send chat to guild chat without changing default channel.
- /g <text> - Send chat to group chat without changing default channel.
Also all the normal emotes can be used.
[edit] Variables
This is where the power of scripts starts to show.
- %0 - Replaces with the name of the script you are running.
- %1...%9 - Replaces with parameters you gave to your script.
- %* - Replaces with all given parameters
- %f - Replaces with the target you currently fight.
- %m - Replaces with your own name.
- %t - Replaces with your current primary target.
[edit] Graphics options
Following Values to be confirmed for AoC Graphics settings can be changed with just a single script. The command is always /setoption <option> <value>. The <option> name is case sensitive.
- ViewDistance - Accepts values from 0.0 (=0%) to 1.0 (=100%) and defines your max view distance.
- CharViewDistance - Sets the distance in which characters are still visible for you from 5 to 80 in meters.
- BuffsFX - Do you want fancy nano execution effects? Can be 0 (=off) or 1 (=on).
- EnvironmentFX - Do you want environmental effects? Can be 0 or 1.
- MuzzleFlashFX - Want guns to have a visible effect when fireing? 0 or 1.
- NanoEffectFX - Want to see visible effects of running nanos like damage shiels? 0 or 1.
- TracersFX - Want to see flying bullets? 0 or 1.
- OthersFX - Not sure what is included in "Other" but... heh... 0 or 1.
- Shadows - Do you like shadows? 0 or 1.
- SimpleClouds - Do you want basic cloud effects? 0 or 1.
- RealisticClouds - Do you want even more cloud effects? 0 or 1.
- RealisticMoons - Ugly or nice looking moons? 0 or 1.
- StarRotation - Want the nightsky to look more realistic? 0 or 1.
- FogMode - How much fog do you like? Accepts values from 0 (=off) to 3 (=all fog effects)
- MusicOn - Want music? 0 or 1.
- SoundFXOn - Do you want sound effects? 0 or 1.
- SoundOnOff - Do you want sound/music at all? 0 or 1.
There are many more options you can alter with the /option command. To get a full list of all options you can alter, press SHIFT+CTRL+F7 ingame and look through the DistValues list. Some of the changes you can make with this command will not take effect until the client is restarted and some might render the client unable to work. Feel free to experiment but be a little careful.
[edit] Opening the info window with a link
This is where the fun part begins. Scripts can be used to create a clickable link in the chat window which will open a new window, the info window, with your text in it. This is also the first time we need to worry about the 1024 character limit, because everything that you want to show up inside the window needs to be in the same line, ie it has to be one single chat command.
The very basic framework we will be using is this:
- <a href="text://TEXT GOES HERE">LINK NAME GOES HERE</a>
Copy and paste that into a script file and execute the script in AO. You will get a link "LINK NAME GOES HERE" and when you click it, the info window will open and show "TEXT GOES HERE" in it.
[edit] Formating text
Some normal HTML tags work to format text inside scripts.
- <font color=#ff0000>Text</font>
will show the text between the font tags in red. The color is defined with hexadezimal RGB values. The first two digits are red, the second two are green and the last two are blue. Those double digit values range from 00 (=zero brightness) to FF (=full brightness). FF is 255 in decimal. To get the color you want you just mix red, green and blue accordingly. You want yellow? Mix red and green equally. So #ffff00 is bright yellow. #999900 is a darker shade of yellow. And so on... this gives you 16,7m different colors. You can also put a color name like this <font color=yellow>
- <u>Text</u>
will show the text underlined.
- <div align=right|center>Text</div>
will align the text to the right, or center the text. Of course you can only use right or center, not both at the same time. This tag will only work when used inside the info window.
- <br>
will create a new line. This is important when you create a info window script where everything has to be in the same line. If you want a new line in this case you need this tag.
Exapmle of all the above:
- <a href="text://First line.<br><font color=#ffff00>Second line in yellow.</font><br><div align=center>Third line centered.</div><br><br><u>That was a empty line.</u>">Example</a>
- Font Face
Often times you may see Text entered into global chat which has large Orange Text with the Hyborian Font. This can be accomplished by using the face attribute for the font Markup Tag.
<font face='HYBORIANLarge'>Text</font>
There are 8 values for face (some don't seem very useful): small, small_bold, normal, normal_bold, large, large_bold, hyboriansmall. hyborianlarge
- Examples: Font Face
/chsay Global <font color="#ff6820" face='HYBORIANLarge'>%*</font>
/chsay Global <font color="#ff6820" face='HYBORIANSMALL'>%*</font>
/chsay Global <font color="#ff6820" face='LARGE_BOLD'>%*</font>
[edit] Chat commands from inside the info window
Now that we can open the info window and put formated text in it, we can try some even more advanced things. It is possible to use chat commands from inside the info window. You will have a link inside the window that will execute the chat command when clicked.
- <a href='chatcmd:///ymca'>Click here to YMCA</a>
is the syntax to use chat commands. Using this alone in a scrip will result in a link that does nothing when clicked. It has to be done from inside the info window. So we add this to the basic info window framework we discussed above and get:
- <a href="text://<a href='chatcmd:///ymca'>Click here to YMCA</a>">LINK NAME GOES HERE</a>
Copy paste it and try it. You will get a link "LINK NAME GOES HERE" that will open the info window with a link inside named "Click here to YMCA" which will make your toon do that dance when clicked. You can execute any chat command that way. Even the /quit command which would make people that click it go LD imediately. DONT DO CRAP LIKE THAT!!!11eleven
[edit] Images inside the info window
It is possible to use client graphics (from the GUI) and item icons inside the info window. Using GUI graphics is a little difficult, because you need the graphics ID to do it. These are long uppercase descriptors unique to each of the graphics. Posting a list would take too much space and they change with each patch. I'll just give one example. Again, this only works inside the info window (and also with the /lft command, the grahic will show up as your description).
- <img src=tdb://id:GFX_GUI_CONTROLCENTER_TARGET_ICON_SELF>
is the syntax to add a GUI graphic. GFX_GUI_CONTROLCENTER_TARGET_ICON_SELF is the graphics ID. Again this alone won't work, because it has to be done inside the info window. So let's add it to the info window framework again:
- <a href="text://<img src=tdb://id:GFX_GUI_CONTROLCENTER_TARGET_ICON_SELF>">LINK NAME GOES HERE</a>
Try this one. It will open the info window and show the icon the GUI uses to target yourself. A full list of all the GUI graphics IDs is not yet available.
Using item icons is just a tiny bit more easy. You need the icon ID (not the item ID) which is just a number. You can find out the icon ID of the icon you want to use with AUNO or the Anarchy mainframe. The little icons there have a number as a filename which is the icon ID.
- <img src=rdb://86483>
is the syntax to use a item icon. Again this wont work alone... heh... you know the drill. Let's add it to the info window framework.
- <a href="text://<img src=rdb://86483>">LINK NAME GOES HERE</a>
Copy paste this one and you will get a info window with the icon of the Shades of Lucubration in it.
[edit] Item reference links
Will need some working AoC references to clarify this section Last but not least it's possible to create item reference links manually. These links also work outside the info window. For these you need the item IDs. To get these you need to activate logging for one of your chat windows, post the item you want to know the ID from and then look inside the chat log. Or... you look up the item at AUNO ar Anarchy Mainframe again and inspect the URL. You will find the IDs there too.
The syntax is:
- <a href='itemref://Low_ID/High_ID/QL'>NAME</a>
Low_ID is the ID of the item at the lowest possible quality in the database. High_ID is the ID of the item at the highest possible quality, and QL is the actual quality you want your linked item to be. NAME is the name of the item, but it doesn't actually have the be the real items name. It can be anything you want. The example below will open a info window with the icon of the Shades of Lubrication that when clicked on will change the info window to the items reference. In this example LowID and HighID are the same, because that item only exists at this quality. When you try to link to, let's say, carbonum armor, they will be different.
- <a href="text://<a href='itemref://152713/152713/165'><img src=rdb://86483></a>">LINK NAME GOES HERE</a>
[edit] Script Examples
Just copy these, put it in a text file, and save in your scripts folder under any name you choose.
[edit] Assist
This was designed for AO, so you will need to find equivalent img src=rd://.... entries for AoC <a href="text://<div align=center><img src=tdb://id:GFX_GUI_OPTION_SLIDER><br><br><br><a href='chatcmd:///macro %t /Assist %t'><img src=rdb://37970><br><font color=#FFFAAA>Click for Assist %t macro</a><br><br><br><br><a href='chatcmd:///Assist %t'><img src=rdb://156598><br>Click for quick Assist %t</a><br><br><br><br><a href='chatcmd:///macro Assist /Assist'><img src=rdb://82982><br><font color=#FFFAAA>Click for Assist macro</a><br><br><br><img src=tdb://id:GFX_GUI_OPTION_SLIDER>">Assist %t</font></a> <font color="#00B400">-|</font><font color="#E10000">Click it!</font><font color="#00B400">|-</font>
Will create buttons for "assist person", "quick assist", and just "assist". The buttons will look like cherries, a leet, and an omni token board.
[edit] LFM Announcement - For group leaders
This script is useful if you are trying to form a group. It is fairly complex but it is nicely formatted and it works. Use it as a template and include any information like how many you are still looking for, what classes you need, what levels are appropriate, etc.
<a href="text://<div align=center><font color=#ffff00 face=HYBORIANLarge>LFM</font> Cistern/Main System<br>Level 50+<br><a href='chatcmd:///w Nischa I would like an invitation, please.'>Click here</a> to request an invitation from Nischa.</div>"><font color=#ffff00 face=HYBORIANSMALL>LFM</font> Cistern/Main System (click here)</a>

