This guide will help players to write scripts within The Secret World Legends, that allow:

  • Popup and notifications
  • Changing ingame settings
  • Adding chat channel links
  • Adding /tell links

Installing and running your script

By default there isn't a Scripts folder. Therefore one needs to be created within:

~\Funcom\Secret World Legends
Note: this will be in your Secret World Legends game folder. Once created, scripts can be stored in ~\Funcom\Secret World Legends\Scripts

The script file(s) can be named anything and even a file extention such as .txt or .html will not matter.

To execute the script, start by typing in chat.

Lets take the following example of a file I created called PopupExample.txt. Once the file is created in Scripts, it can be run immediately. Once does not even have to run /reloadui

The script is run, by typing:

/PopupExample.txt

or even send the popup/link in the channel that you currently using.

/Pop[tab-button]

This will auto-complete the command.

Here is some sound advice: Create your own private channel for testing your script. If you run the script from any other public channel, and the script is broken, you could potentially flood the channel. This will get you in trouble... I speak with experience. So stay safe, and first get it working. Nothing always works perfectly the first time around.

It all needs to be in one continious line.
If there is a line brake([enter]) in the popup, it will not work.
use <BR> for line break.

A sample script

Code:

<a href="text://Hello Secret World">Click here</a>

You need to start with:
/Text <a href="text://
Then put the text you want in the popup, then end with:
">
If you put any " between those in your text, it will not work.
The next thing is what you want to appear as the clickable link, in this case:
Click here
Finally end it with:
</a>

This was the basics of course, but if you want to add colours, links to chat-channels, websites and /tell messages, then we need to add links in that space between <a href="text:// and ">

 

Formatting

Colour

There are two ways to do it:

Code:
<font color=blue>text you want to be blue</font>
and if you want a more specific color:

Code:
<font color=#00CCFF>text you want to be that special shade of blue</font>
Note: This must be done within the <a href="text:// and "> and no other " are to be used, else it won't work.

 

Font size and Bold

To be accuratem the font size isn't being changed, you change the font face.
The same with making text bold and italic.
<b> and <i> do not work. (<u> </u> does though)

Font face

Code:

<font face=LARGE>text you want to be large</font>


Bold

Code:
<font face=NORMAL_BOLD>text you want to be bold</font>

 

Here are the options:

NORMAL Size: 12
NORMAL_BOLD Size: 12
LARGE Size: 14
LARGE_BOLD Size: 14
HUGE Size: 15
TSWLARGE Size: 16
HYBORIANLARGE Size: 18
HEADLINE Size: 21

 

Adding chat channel links to the popup

Remember the note about not having any " between <a href="text:// and ">.
We need a quote mark to put in links, luckily we still have ', meaning that you are not allowed to use that either in the links you put in the popup.
you can safely use ´and ` though, id you want to spell don´t or use it for other things.

The principle of the code is chatcmd://
A code that executes what comes after it in chat.
Meaning if you put in chatcmd:///say Hi
The character clicking it will say "Hi"
Just like that we write it so it allows people to join a chat-channel with a single click:
chatcmd:///join chat IC
We need to put it into a link for it to work though:


Code:
<a href='chatcmd:///chat join IC'>Join the IC channel</a>



Adding /tell links to the popup

Sending a /tell via link works the same as chat channel links, it uses the chatcmd:// command, but rather with a chatcmd:///tell MrRobot if you want the reader to easily be able to contact MrRobot.

Writing it out like this means that no matter who posts the code, the tells will always go to the same person, so be sure they are online.

Code:
<a href='chatcmd:///tell Daath I read your popup'>Send MrRobot a tell</a>
If you want to make it so you, the one posting the popup gets the message, here is the code for you:

Code:
<a href='chatcmd:///tell %m I read your popup'>Send %m a tell</a>
%m is automatically replaces with the name of the one sending the popup.
For more more variables, for scripts see the section later in the posts.

 

Adding website links to the popup

This is kind of complex, and relies on the previous methods and then some.
Hence I will post the code and then try to explain it afterwards:


Code:
<a href='chatcmd:///option WebBrowserStartURL &quot;http://www.thesecretworld.com&quot; \n /option web_browser 1'>open the SWL website</a>


WebBrowserStartURL is supposedly meant to set the permanent starting address for the browser..
But it is not working like that at the moment, it only affects the next time the browser is opened.
Which is actually what we want, so that is fine: no permanent damage there.


There is the problem that the way it works, if you want to use it is:
/option WebBrowserStartURL "https://www.reddit.com/r/SecretWorldLegends/"
and it does not work without the ".

Therefore, use &quot; is another way of writing ", and as &quot; in passed at a later stage it does not interfere with the popup.


Limitations

  • It all has to be in -one- line, no [Enter], use <BR>.
  • Keep the popup under 1900 characters all included. Recommended size: 1024 or lower.
  • You will -always- see it as a link, but if it is too long -everyone else- will see it as a wall of HTML text in the chat, getting you ignored and reported for spamming rather quickly.
  • <B> and <I> do not work
    To change font size or type use <font face=XXXX>.
    See the list of possible font faces above.
  • No " between <a href="text:// and ">.
    So the text in your popup -can not- contain any " besides the starting and ending one.
  • No ' between <a href='chatcmd:// and '>.
    Meaning write your linkified /tell messages without ' but using ´ instead.
  • Use ANSI, UTF-8 encoding does not work.
    If your script works, and you do not know what the above means, do not worry; only nerds will run into this problem.

 

Variables in scripts

In the popup examples %m is mentioned, and it is the most useful one for most popups, there are other variables though:
%m your own nickname.
Hi my name is %m
%t your target's nickname
Hello %t
%f your fighting-target's nickname
Let us all attack %t
/Delay 1000 a delay/sleep/pause for 1 second (1000 milliseconds)
You can adjust the value to what you seem fit
%0 The script's own name
/%0 will call the same script again, creating an infinite loop
CTRL+SHIFT+F1 or /reloadui Will stop infinite loops

If you write %1 in a script called Test
It will be replaced by the first word after the script name eg. Hello in the following.
/Test Hello

For a more practical example, a link popup:

Code:
<a href="text://Click the link below to open it in the browser<br><a href='chatcmd:///option WebBrowserStartURL &quot;%1&quot; \n /option web_browser 1'>%1</a>">%1</a> %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19 %20 %21 %22 %23 %24 %25 %26 %27 %28 %29 %30 %31 %32


Where if you write:
/Link https://www.reddit.com/r/SecretWorldLegends/ Check the forums
It will make a popup with the link being clickable, and you can do that for any web address you want.

as you can see there are %2 %3 etc. as well, I know of no limit, but have tested up to %50
A command to write all of them is:
%*
But in the example above that would mean that the web address would appear too. So add spaces in between.