Skip to content

Custom Command Guide

Vaerys-Dawn edited this page May 17, 2017 · 49 revisions

Everything you need to know about S.A.I.L's Custom Command Feature.

S.A.I.L's Custom command system is basically a programming language in its own right.
you input some text and if you use tags you can tell S.A.I.L to run some code to get
a different output.

Creating a Custom command.

You can create a custom command using S.A.I.L by running the following command:
$NewCC [Command Name] [Contents]
Each user gets a certain amount of Custom command slots based on their position
in the server:

Base User +10  
Trusted Role +20  
Manage Messages Perms +40  
Administrator Perms +100

when you run out of slots you will be unable to create any more custom commands.

To top

Helpful Commands

  • $CClist [PageNum/@User/userID}
    This command lists all of the custom commands 16 commands at a time
    you can also see all of the custom commands of a certain user by mentioning
    them in the command, if you have a user's ID and don't want to mention them
    or can't mention them you can just use UserID and this will
    work the same way as mentioning the user in the command
  • $CCInfo [Command Name]
    This command gives you all of the information about a custom command
    example:
> Here is the information for command: Echo  
    Creator: @S.A.I.L v2.0#7261  
    Time Run: 126  
    Is Locked: true  
    Is ShitPost: false  
  • $getCCData [CommandName]
    This command gives you a download of the raw information about the custom
    command in the form of a .txt file.
    This command is useful for seeing how other user's made their commands.

  • $EditCC [CommandName] (Mode) [Args]
    This command will allow you to edit your custom commands.
    Modes:
    - replace: will just replace all of the contents in your command with the new contents.
    (default mode)
    - ToEmbed: Will attempt to add the tag to your command.
    - delCall: will add the tag to your command.
    - append: will append the Args to the end of your command.
    Admin Modes:
    - Shitpost: will toggle the shitpost setting for the command.
    - Lock: will toggle the locked setting for the command.

To top

Tags and how to use them.

Custom commands tags are basically code. they allow you to create messages based
on variables and other things.

<args>

<args> is the most basic of custom commands. this tag will be replaced with
any text placed after the command name upon execution.

How to use <args>

When creating a custom command simply put <args> where you would like text to be  
replaced as an example here is how we create a simple echo command:  
"$NewCC Echo <args>"  
This command when run will now echo anything you put after the command name.  
"$$Echo Hello World" Will respond with "Hello World".

Notes:

  • $$Echo is auto-generated for you on all guilds that S.A.I.L is on.
  • <args> is limited to 500 chars for all instances of in the custom command
    for instance if you have 2 instances of then each instance will be limited
    to 250 chars each.

To top

<args!>{[Position]}

Much like <args> this tag will grab text that was placed after the command name
however unlike <args> <args!> will grab a specific word from the position specified
when creating the custom command.

How to use <args!>{}

When creating a custom command simply place <args!>{[Position]} where you like  
one thing to note is that [Position] should be replaced with a number. here is  
how you would go about creating a custom command using <args!>:  
"$NewCC Args! <args!>{2}"
This command will now print out the word that is placed second when executing it:
"$$Args! Hello World" will respond with "World"

Notes:

  • If you use anything other than a number when using this tag it will print
    out #ERROR# in place of the tag when you execute the command.

To top

<random>{[Rand1];;[Rand2];;[Rand3]...}

This tag allows for a purely random output based on what you input when creating the
command. you can put as many options as you like as long as you don't go over the char
limit.

How to use <random>{}

Creating a custom command using <random> is fairly simple here is an example:  
"$NewCC random <random>{Hello;;World}"
This command will then choose at random the output:
"$$random" will respond with either "Hello" or "World" at random.

Notes:

  • Don't try to nest tags or any other tags that use {} as it will
    just print an error.

To top

<ifRole>{[Role Name];;[Response True];;[Response False]}

The <ifRole> Tag allows you to have a specific response based on the roles
the person executing the command has.

How to use <ifRole>{}

The tag <ifRole> is pretty much the same as and other type of "if" code you need  
to say what you want the role name to contain and the true and false outputs of  
the command, here is an example:  
"$NewCC IfRole <ifRole>{Admin;;Hello Admin;; Hello World}"
This sets it up so that based on whether or not a user has a role with admin in  
the name it will respond with either "Hello Admin" if they do and "Hello World"  
if they don't.

Notes:

  • Don't try to nest tags or any other tags that use {} as it will
    just print an error.
  • The role name portion of the tag can doesn't need to be the full role name
    to get the true response, it can just be a portion of it and isn't case sensitive

To top

<ifName>{[Display Name];;[Response True];;[Response False]}

The <ifName> Tag allows you to have a specific response based on the Display
Name of the user running the custom command.

How to use <ifName>{}

The tag <ifName> Works in a very similar way to \<ifRole> in that it responds  
based on a variable. the way you use it is is as follows:  
"$NewCC IfName <ifName>{Dawn;;Hello Dawn;; Hello World}"
This is great for responding to specific people or for hiding something from  
people without the variable in their display name here, i.e. if my Display name  
contained "Dawn" and I ran the above command it would respond with "Hello Dawn"  
but if it didn't it would simply respond with "Hello World"  

Notes:

  • Don't try to nest tags or any other tags that use {} as it will
    just print an error.
  • It's best to use only a part of the Display name unless you want to limit it
    to a specific user.

To top

<ifArgsEmpty>{[Response True];;[Response False]}

will replace the tag with a response based on if is empty or not.

how to use <ifArgsEmpty>

<ifArgsEmpty> is great to set up default responses if the   
user doesnt give you any arguments.

e.g. $newCC Hello <ifArgsEmpty>{Hello;;World}
$$hello -> Hello
$$hello there -> World

Notes:

  • Don't try to nest tags or any other tags that use {} as it will
    just print an error.
  • The word or phrase you test for will ignore casing of the letters.

To top

<ifArgs>{[Test to];;[Response True];;[Response False]}

The <ifArgs> Tag allows you to have a specific response based on anything after
the command name like but instead of placing text it lets you test and
respond based on the contents of the arguments.

How to use <ifArgs>{}

<ifArgs> is pretty much used the same way as the other two IF tags you  
have something you want to test against the arguments of the command  
and then you have a true and false response  
"$NewCC ifArgs <ifArgs>{Hello;;How are you;;Hello World}"
this command will now respond with "How are you" if you run the command  
"$$ifArgs Hello" which contains the word that it is testing for,  
alternatively it will respond with "Hello World" if the command does not  
have the word you are testing for  

Notes:

  • Don't try to nest tags or any other tags that use {} as it will
    just print an error.
  • The word or phrase you test for will ignore casing of the letters.

To top

<replace>{From;;To} or <replace!>(From::To)

<replace> is a pretty straight forward tag to use, you tell it what you want replaced
and it replaced it with the second parameter.

How to use {} or <replace!>()<\r>

Firstly you need to tell it what you want replaced and then what you  
want it to be changed into:  
"$newCC Replace <replace>{#text#;;Hello World}#text#"  
which then when the "$$Replace" command will respond with "Hello World"  

Notes:

  • Don't try to nest {} tags or any other tags that use {} as it will
    just print an error.
  • However you can nest ()<\r> inside of other tags but you can't nest
    nest it within itself this is useful for having certain tasks editing the output of other
    tags.

To top

<randNum>{MinNum;;MaxNum}

<randNum> is quite literally a random number generator and that's about it.
you can specify the max number and the minimum number it draws from.

How to use <randNum>{}

Let's create a basic Roll D6 command for this one.
"$newCC D6 <randNum>{1;;6}"
"$$D6" will then respond with a number from 1 to 6 inclusive

Notes:

  • Don't try to nest {} tags or any other tags that use {} as it will
    just print an error.

To top

<author> and <username>

<authour> Replaces the tag with the DisplayName of the user that ran the command.
whereas replaces the tag with the user that ran the command's username.

How to use <author> or <username>

For this we will create a WhoAmI command.  
"$newCC WhoAmI I am <username> and my nickname is <author>"  
The command "$$WhoAmI" Will then respond with:  
"I am Dawn Felstar and my nickname is [Admin] Dawn Felstar"  
when the user "Dawn Felstar" with nickname "[Admin] Dawn Felstar" runs  
the command.  

To top

<spacer> and <!break>

These two commands are advanced commands and will not be used by most users
<spacer> gets replaced with a character with nothing in it a blank character
this blank character will not take up any space and is great for use with the
IF tags as it can be placed in either true or false and not show anything
without the tag printing an error
<!break> is a tag that you will only really use if you are working in a text
editor to create your custom commands, if you place this tag at the end of the
line and then press enter the command will act as though you didn't press enter.
this is mostly useful for making your commands look neat.

How to use <spacer> and <!break>

These tags are pretty hard to show how to use but here is an example use of both:  
"$NewCC spacerBreak <space>  
This is The second line of the command  
This is The third line <!break>  
This is also the third line"  
This command will then respond with:  
"  
This is The second line of the command  
This is The third line This is also the third line"  

Notes:

  • <spacer> can be used to start a command off with an empty line as well.

To top

<toCaps>

allows you to set all contents of a command to capital letters.

how to use <toCaps>

This tag is pretty useful for when you want to have sail shout something
all you have to do it put <toCaps> into your command and it will turn
"hello world" into "HELLO WORLD".

Notes:

  • this tag will mess up URLs when put into a command so be careful.

To top

<embedImage>

allows you to embed your images. meaning that you no longer have to see the Image URL

how to use <embedImage>{}

This tag is pretty straightforward to use, simply  
put <embedImage>{ImageURL} into your command

Notes:

  • this tag is limited to one per command
  • image url must end in .png, .jpg, .gif or .webp

To top

<delCall>

Deletes the message used to send the custom command

how to use <delCall>

This tag is pretty straightforward to use, simply  
put <delCall> into your command

Notes:

  • this tag is limited to one per command

To top

<repError>{ReplaceWith}

Replaces #ERROR# with the arguments supplied

how to use <repError>

This will run after all of the tags that can output #ERROR#,
using this will allow you to remove the #ERROR# tag and replace it
with something else
e.g.
$newCC roll <randNum>{1;;<args>}
$$roll error >> #ERROR#
$$roll 20 >> 13
$editcc roll append <repError>{You must supply a number.}
$$roll error >> You must supply a number.

Notes:

  • Should not be placed within other tags.

To top