Create Custom Commands in AyScript

v Get Started v


Let's learn the basics:

Adding a command in custom commands is extremely easy! Just type w!add <command_name> <response> and the once the command is typed, the bot will respond accordingly.


Now let's move onto the bigger things. In custom commands, we call the language used "AyScript". Here are some functions that can be used in AyScript, but these are only a few - there's much more to discover!


You have now learnt the basics of custom commands! Now lets get you started!


Use our ScriptNow Console to test out AyScript! (Beta)

Simple Input/Output Example



All Functions in AyScript

[RAN5] - Selects a random number from 1 to 5. Function Arguments: change

 

[RAN10] - Selects a random number from 1 - 10. Function Arguments: change

 

[RAN100] - Selects a random number from 1 - 100. Function Arguments: change

 

[DICE] - Selects a random number from 1 - 6. Function Arguments: change, result

 

[RPS] - Randomly chooses between Rock, Paper and Scissors. Function Arguments: change

 

[COIN] - Randomly chooses between Heads and Tails. Function Arguments: change, result

 

[FISH] - Randomly Fishes any Fish from the /fish command. Function Arguments: change

 

[RAN1] - Selects a random number from 0.1 to 1.0. Function Arguments: change

 

[RANTH5] - Selects a random number from 1 to 5 and adds either "st", "nd", "rd" or "th". Function Arguments: change

 

[COLOUR] - Sends a random colour. Function Arguments: change, hexcode

 

[SHAPE] - Sends a random shape. Function Arguments: change

 

; - Shows the end of a line or a function. Again, not required in your code but can help it be easier to read and understand.

 

{ping} - Displays the bots delay in milliseconds.

 

{username} - Displays the name of the user who typed the command.

 

{usernick} - Displays the nickname of a member who typed the command, if a user has no nickname, it displays "None"

 

{userid} - Displays the user's ID.

 

{usertoprole} - Displays the top role that the user has.

 

{usertoprole:colour} - Displays the hex code of the colour of the top role that the user has.

 

{servername} - Displays the name of the server you typed the command in.

 

{channelname} - Displays the name of the channel the command is typed in.

 

{date} - Displays in current date in YYYY-MM-DD format, you can change this format by using {date:format=eu} or {date:format=us} and the format will change accordingly.

 

{@:username} - Pings the user who typed the command.

 

{servercount} - Sends the number of users in the server.

 

{useravatar} - Sends the profile picture of the user who used the command.

 

{serveravatar} - Sends the server profile picture of the user who used the command.

 

(intro:ayscript) - Gives a basic intro message, linking to this webpage.

 

(join:command) - Shows how to make a basic User Join command, linking to this webpage.

 

(ayscript:info) - Gives some basic info on AyScript, linking back to this webpage.