RTE Scripting

To assist in testing bots, the Robot Testing Environment "BotBox" supports a form of scripting language.  The server can run a script at login.  A script is merely a list of messages to send to the bot connection, though there are several non-message commands that can be used to control flow a bit.  Each script is run in its own thread, allowing you to suspend any given thread without pausing the rest of execution. This can be used by loading a new script to continue one conversation, while another sleeps for a certain number of seconds.  As always, there is a facility for "raw" text that is sent unparsed.  Raw text is created by placing a number as the first character on the line.  A script may have comments in it if the first character is a pound sign (#).  A series of three example scripts are included in the distribution.  login.bbs is to run at login (if you include the -script option), which will then load script.bbs, and finally exec 2.bbs.

Also, three variables exist that can be used in the scripts that will be changed into the values of internal server variables.  The variables are "$channel", "$botname", and "$users".  The comparison is case insensitive and runs only the length of the string.  For instance, "$usersusers" would map to "10users" if the server thinks there are ten users online.  I apologize that there are not more commands or better flow control via the script, but I am time-pressed these days and will not have time to add those things for a few days minimum.

Commands
Commands may be abbreviated when unambiguous.  All letters in the brackets may be left off if desired.  The format specifications use the shortest allowed string.
Command contents
CommandFormat
ActionMessage

b[an]/b <user> <banner> [reason]
Generates a message saying that <user> was banned by <banner> and includes the reason, if given.  Note: this command does not generate a leave message.1018 INFO "<user> was banned by <banner> ([reason])."

chang[euserstate]/chang <user> <flags>
Change a user's flags.  Flags are parsed to verify that they are hexadecimal.1009 USER <user> <flags>

chann[el]/chann <channel>
Moves the bot to a new channel and purges user list in the server.1007 CHANNEL <channel>

em[ote]/em <user> <action>
Causes <user> to generate an emote.  This is equivalent to the user typing "/me <action>".1023 EMOTE <user> <user's flags> "<action>"

er[ror]/er <message>
Generates an error message.1019 ERROR "<error text>"

ex[ec]/ex <millisecond delay> <script>
Loads and executes a new script named as the argument.  The script parser for the new script will sleep for the specified number of milliseconds before beginning.  This is equivalent to placing "/sleep <time delay>" on the first line of the new script.  Note: the current script terminates immediately upon exec if the exec is successful.

i[nfo]/i <info>
Generate an information message.1018 INFO "<information>"

j[oin]/j <user> <flags> <client>
A new user is created and joins the channel.  Note that the client type is included in the message, despite the brackets.1002 JOIN <user> <flags> [<client>]

k[ick]/k <user> <flags> <kicker> [reason]
Sends a kick message.  Note: does not actually remove user.  Include a separate leave command for that.  When the reason is omitted, the parantheses around it are also omitted.1018 INFO "<user> was kicked out of the channel by <kicker> ([reason])."

l[eave]/l <user>
The named user is removed from the server list and a leave message is generated to indicate this to the bot.1003 LEAVE <user> <user's flags>

r[un]/r <millisecond delay> <script>
Loads and executes a new script named as the argument.  The script parser for the new script will sleep for the specified number of milliseconds before beginning.  This is equivalent to placing "/sleep

s[leep]/s <millisecond delay>
The delay is converted to an integer and then the thread processing the script will Sleep ( ) for that number of milliseconds.  This is useful for slowing script execution if you are trying to make a realistic conversation.

t[alk]/t <user> <flags> <speech>
The given user speaks with the specified flags.1005 TALK <user> <flags> "<speech>"

un[ban]/un <user> <unbanner>
Generates an unban information message.1018 INFO "<user> was unbanned by <unbanner>."

us[er]/us <user> <flags> <client>
This message is identical in layout to the /join command.  This command is used immediately after a /channel call    it makes no sense to use it during the middle of a conversation.1001 USER <user> <flags> [<client>]

w[hisper]/w <user> <flags> <whisper>
The bot receives a whisper from the named user with the specified flags.  There is no facility for generating whisper confirmations, as these are senseless.  There is also no facility for doing whispers between pseudo-users as the bot could not detect these.1004 WHISPER <user> <flags> "<whisper>"