Due to popular demand, I gave in and wrote this introduction to luabot
luabot commands can be extended/added through the MUC, so I won't document many commands here. Instead I will list the built-in commands, which cannot be over-ridden, and cannot (usually) be used in commands added through the MUC.
If <nick> is omitted, HAL will make you a moderator
If <nick> is omitted, HAL will make you an administrator
If <nick> is omitted, HAL will make make you a normal participant
!join <room JID>
Join a room
Leave the room
Change the room's topic/subject to <topic>
Sets the bot's nickname in the current room. If <nick> is omitted, he will assume his default nick
Invite <JID> to the current conference
!xep <XEP name or number>
Searches for an XEP, given part of its name, or its number
Links to the XMPP RFCs
!rfc <RFC number>
Return a link to an RFC. For the laziest of the lazy.
Netspeak to English converter. idkh2s indeed! Responses are roughly censored.
!tell <nick> <message>
When <nick> comes online, send them your message. It will be shown in public. If you would like me to change this, let me know :)
Tell him to forget anything you wanted him to say to <nick>
All do the same thing. See the section below for more on the Lua features.
Run the code, and run it every time the bot restarts
Wakes up HAL's AI, he'll get a lot more talkative :)
Shuts him up
For when you really have no answer
Reload the bot. Used to let code changes take effect, and wake him back up after an uncaught error.
Super-admins only ;)
Shows (or if a value is given, sets) the value of a configuration option. These options are per-room.
Version of the bot
Running Lua code
Using the !do command, you can run Lua code from the MUC. Often you will find that you are restricted to evaluating expressions, and calling functions. Creating functions and changing variable requires admin access, or the configuration option "allowfunctions=yes".
If someone types a message beginning with ! in a MUC or PM, luabot will attempt to use the message as a command:
It will first check if <command> is a built-in function. If it is, it will always
run that function.
Otherwise, luabot will check the sandbox for a variable named <command>. If that variable doesn't exist, he will remain silent, and ignore the command (if it was one).
If that variable does exist, HAL will check its type. If it is a function, he will execute that function, and show what the function returned to the MUC.
If the variable is a string or number, he will simply show the value of the variable in the MUC.
Some information you can access with code executed with !do:
\_ role (string: moderator, participant, etc.)
\_ affiliation (string: admin, owner, etc.)
\_ status (string: available, xa, dnd, etc.)
\_ show (string: Status message)
\_ name (string: The room ID)
\_ server (string: The server the room is on)
\_ jid (string: The bot's room JID)
\_ nick (string: The nickname of the user who is currently executing the code)
A special function count() can be used to find the number of occupants in the room. ie. count(room.occupants). You cannot
iterate over each nick in the room with a for ... loop.
All standard Lua functions are stripped of their table prefix. ie. string.format() becomes just format(), math.random() is random(). Standard functions cannot be over-ridden.
Metatables are disabled by default, just so you can't hide functions in places I won't notice :)