Scripting 101

Here you can share your knowledge about Rubi-Ka and the Shadowlands with others

Moderator: Generals

Post Reply
Shohizzle
Squad Commander
Posts: 222
Joined: Sat Oct 15, 2005 4:51 pm

Scripting 101

Post by Shohizzle »

To make a script:
1) Go in to your Anarchy Online Directory (mine is C:/Program Files/Funcom/Anarchy Online) and create a folder called scripts.
2) Open up notepad, type some text (doesn't matter what just yet) and save it in the scripts folder under the name test.
3) Log into AO and type /test.txt. It should spit out what you put into your notepad file.

Basic scripting:
You can change the color of your text with <font color='#RRGGBB'>text</font>. Common hexidecimal color codes can be found here

You can underline text with <u>text</u>

You can input variables with %1, %2, %3, etc. These can only be replaced by 1 word.

Example:
Script (name is script.txt):

Code: Select all

/tell %1 can you buff me with %2 please?
To run the script type /script.txt Shohizzle MOP

It will send a /tell to Shohizzle with the text "can you buff me with MOP please?"

Windows:
To make a clickable link that creates a window...

Code: Select all

<a href="text://<br>line 1<br>line 2<br>">Window title</a>
You cannot hit return in a link's content. Instead use <br>

Text commands:
These can only be used in a window. It makes a clickable link that either makes a macro, or sends a /tell, etc.

Code: Select all

<a href="text://<br><a href='chatcmd://text command'>Link title</a>">Window title</a>
Example scripts:

Code: Select all

<a href="text://<br>Click --><a href='chatcmd:///macro assist /assist %1'>Here</a><--">Assist Macro</a>

Code: Select all

<a href="text://<br>Level 115-160 AI raid looking for %1 more.<br><br><a href='chatcmd:///tell Shodocizzle'>Click here</a> and send me your profession/level">It's about that time again...</a>

Code: Select all

/tell %1 <a href="text://<br>Omni Ent platform bank is at 985x580<br>that is east of the grid terminal between the wompas">Wrangles Available at Ent Platform Bank</a>
Last edited by Shohizzle on Mon May 08, 2006 1:11 am, edited 1 time in total.
User avatar
bling
Squad Commander
Posts: 150
Joined: Sun Dec 25, 2005 1:42 am
Location: Portugal

Post by bling »

good work sho :D
that's very usefull :)
fenster
VIP
Posts: 6
Joined: Wed Apr 26, 2006 10:49 pm
Contact:

Post by fenster »

Real geeks use vim :[
User avatar
Havagrim
Unit Member
Posts: 152
Joined: Thu Mar 02, 2006 5:55 am
Location: Sweden

Post by Havagrim »

Awsome Sho. That stuff sure helps alot. :)
Thorbius - 215/13 - Opifex/Fixer
Havagrim - 177/9 - Solitus/Adventurer
Baccus - 104 - Atrox/Soldier
Eldheimner - 63/3 - Atrox/Enforcer
Haldur - 42/3 - Solitus/Soldier

And yes. Scrabble sucks.

http://www.youtube.com/havagrim
User avatar
ClockworkD
General
Posts: 868
Joined: Tue Oct 04, 2005 3:33 am
Location: New Jersey

Post by ClockworkD »

Yes, nice work Sho... I made a nice script that should be appreciated by the org. :)
User avatar
Sorhan
President
Posts: 2034
Joined: Mon Oct 03, 2005 8:49 am
Location: Prince of Persia

Post by Sorhan »

A couple of points that haven't been mentioned...

#1 After you've made the .txt file for the script, you can rename it and remove the extension.

#2 You can use %t in a script which of course puts in the target's name.

#3 You can add delays in your script using '/delay xxxx' where xxxx is a number in milliseconds.

So for example with Sho's buff script, you can save yourself a little typing using #1 and #2, so that all you need to do is target Sho and type '/script mop' instead of '/script.txt shohizzle mop' since by that time Shohizzle has already run away ;)
Image
User avatar
Sozinho
General
Posts: 3042
Joined: Mon Oct 03, 2005 5:54 am
Location: Norway
Contact:

Post by Sozinho »

How do you make the "fake description" that you can link to the chat ? Like mosbricka and fake nanos and nerfbats ?
User avatar
Toffemaster
General
Posts: 839
Joined: Tue Jul 11, 2006 6:26 pm
Location: Sweden
Contact:

Post by Toffemaster »

A lot of work to get the colors and everything right, but just as a regular pop up. I can post some of the ones that I've made when I get home unless someone else wanna reveal the secret.
:: Chrazydoc :: Toffemaster :: Chrazysol :: Coffemaster :: Chrazysama :: Chrazycat :: Drainem
Image
User avatar
Sozinho
General
Posts: 3042
Joined: Mon Oct 03, 2005 5:54 am
Location: Norway
Contact:

Post by Sozinho »

Toffemaster wrote:A lot of work to get the colors and everything right, but just as a regular pop up. I can post some of the ones that I've made when I get home unless someone else wanna reveal the secret.
Okay please do. Woud like to make some (=
User avatar
Toffemaster
General
Posts: 839
Joined: Tue Jul 11, 2006 6:26 pm
Location: Sweden
Contact:

Post by Toffemaster »

Here's the hard coding that I'v done with the nerf bat. I've divided the sections for easier overview. You can copy/paste it and use it but you do need to change it so it all goes into the same line. Notice the '%1' mod, here's an example of how to use it.
Example: /bat Toffe
naming the script 'bat' will activate it and print out: "*smacks Toffe with the OO Nerf Bat*". Feel free to use it but pls add a tag saying I made it so I can get some credz for taking my time doing them scripts :D

=======
*smacks %1 with the <a href="text://<font color=#e3e33d>OO Nerf Bat</font><br>
<font color=#75a575>NODROP UNIQUE</font><br>
<font color=#4add4a>Quality level: </font><font color=#75a575>SPECIAL</font><br>
<font color=#4add4a>Requirements:</font><br><font color=#75a575> Wield:<br> Member of Obsidian Order<br>
<font color=#4add4a>Damage: </font><br><font color=#75a575> 500-1500(2000)</font><br>
<font color=#4add4a>Speed:</font><br><font color=#75a575> Attack 0.13s<br> Recharge 0.37s<br></font>
<font color=#4add4a>Location: </font><font color=#75a575>RightHand</font><br>
<font color=#4add4a>Special: </font><font color=#75a575>Snipe Burst FlingShot FullAuto SneakAttack FastAttack </font><br>
<font color=#4add4a>Attack skills: </font><font color=#75a575>Nerfage 100%</font><br>
<font color=#4add4a>Defence skills: </font><font color=#75a575>Nerf Resist 100%</font><br>
<font color=#4add4a>Description:</font><br><font color=#75a575> Those who deserve it shall have it..</font> ">OO Nerf Bat</a>*
:: Chrazydoc :: Toffemaster :: Chrazysol :: Coffemaster :: Chrazysama :: Chrazycat :: Drainem
Image
User avatar
Toffemaster
General
Posts: 839
Joined: Tue Jul 11, 2006 6:26 pm
Location: Sweden
Contact:

Post by Toffemaster »

I'm offering my services to ppl that are too lazy or just don't know how to make scripts. Just post here or talk to me in game about the script you want made and I'll see what I can do.

Here's the LE research script btw, I know someone wanted to have it.
Right Clicky and save, also remove the .txt if you want.
Simply save in your script foled in AO and do /le in game to use it.
:: Chrazydoc :: Toffemaster :: Chrazysol :: Coffemaster :: Chrazysama :: Chrazycat :: Drainem
Image
User avatar
Sozinho
General
Posts: 3042
Joined: Mon Oct 03, 2005 5:54 am
Location: Norway
Contact:

Post by Sozinho »

So basically it's html codes then. Very nicely done with the OO nerfbat. Gonna try make something sometime when there's less RL this week.
Post Reply