Skip to content
Oxillen Glow edited this page Jun 9, 2026 · 12 revisions

This page gives examples of working "source code" of bots made from Botbot.

Examples


exampleBot

!createbot &test @exampleBot
(+init) -> Hi I am a bot;  
^!randomnumber$ -> [1,2,3,4,5,6,7,7,8,9,0]
^!set\s+(\w+)\s+(\w+)$ -> !var ${groups[1]} = ${groups[2]};
^!print\s+(\w+)$ -> ${groups[1]}
  • !createbot &test Makes the bot in the room test.
  • (+init) Makes the bot say "Hi I am a bot" in test room. Note the ; which marks the end of a command.
  • ^!randomnumber$, ^) Specifies that the message that the command that will initialize the reply has to start with "!randomnumber". $) The message has to end with "!randomnumber". This means that the only message that initialize this response is "!randomnumber". [1,2,3,4,5,6,7,8,9,0]) Is for responding from choosing randomly one of the numbers to output. [Hi,,,,] means that there is a 20% chance "Hi" is the response and 80% that there is no response

Clone this wiki locally