ClueNet is looking for a new Chief Technical Admin. More information here.
Bot:BotController
From ClueWiki
BotController is a bot owned by Cobi.
BotController is The PHPServ BotServ Master Bot.
BotController is in: #services,#botshed-control.
BotController's administrators are: Cobi,Crispy.
Any problems, please contact Cobi.
BotController is included in the List of Bots.
BotController is an FAQ article and is included in the List of FAQs.
BotController is an PHPServ article and is included in the List of PHPServ articles.
BotController is PHPServ's master bot for the BotServ module.
What is BotController
BotController allows users to get their own scriptable bot in their own channel that has super powers in that channel. Your bot may have a custom nick/ident/host.
What kind of nicks/idents/hosts can I use
You may use any nick/ident/host as long as:
- it doesn't match that of another user or bot.
- it doesn't contain vulgarity.
- Cobi approves it.
What can I do with my bot
You can do anything that doesn't disrupt the network with it including:
- making the bot say things.
- making the bot notice you things.
- making the bot invite people.
- making the bot mode the channel.
- making the bot set the topic.
- making the bot kick users.
- giving other users access to your bot.
What language do I use to script the bot
The bots use a variant of the PHP language.
What are the commands
The following are the commands for:
BotController
Admin-only Commands
Help
Shows help on the bot.
Bot Add
Adds a bot to BotController.
Syntax: Bot Add <nick> <ident> <host> <owner> <channel> <nick> is the nick that the bot will use. <ident> is the ident that the bot will use. <host> is the host that the bot will use. <owner> is the owner's OperServ UserName. <channel> is the channel that the bot will operate on.
Bot Del
Removes a bot from BotController.
Syntax: Bot Del <nick> <nick> is the nick that the bot is using.
Template Add
Adds a template to BotController.
Syntax: Template Add <command> <script> <command> is the command of the template to add. <script> is the script of the template to add.
Template Del
Removes a template from BotController.
Syntax: Template Del <command> <command> is the command of the template to remove.
User Commands
There are no user commands for BotController.
Channel Bots
Admin-only Commands
There are no admin-only commands for channel bots.
User Commands
Help
Displays the help for the bot.
Command Add
Adds a script to your bot.
Syntax: Command Add <command> <script> <command> is the command that you wish to add a script for. <script> is the script for the command.
Command Del
Removes a script from your bot.
Syntax: Command Del <command> <command> is the command that you wish to remove.
Command List
Lists all scripts on your bot.
Syntax: Command List
Command Show
Gets a script from your bot.
Syntax: Command Show <command> <command> is the command that you wish to view.
Command Template Add
Adds a script template to your bot.
Syntax: Command Template Add <command> <command> is the template command that you wish to add to your bot.
Command Template Show
Gets a script template.
Syntax: Command Template Show <command> <command> is the template command that you wish to view.
Command Template List
Lists all script templates.
Syntax: Command Template List
Access Add
Adds a user to your bot.
Syntax: Access Add <username> <level> <username> is the user's phpserv username that you wish to add. <level> is the level that you wish to add them at. This will be available in the scripting language as $blvl.
Access Del
Removes a user from your bot.
Syntax: Access Del <username> <username> is the user's phpserv username that you wish to remove.
Access List
Lists all users on your bot.
Syntax: Access List
Coowner Add
Adds a coowner to your bot.
Syntax: Coowner Add <username> <username> is the user's phpserv username that you wish to add.
Coowner Del
Removes a coowner from your bot.
Syntax: Coowner Del <username> <username> is the user's phpserv username that you wish to remove.
Coowner List
Lists all coowners on your bot.
Syntax: Coowner List
Set Trigger
Sets the in-channel command trigger for your bot.
Syntax: Set Trigger <trigger> <trigger> is the trigger you wish to set for the bot. The trigger may be one of the following: . - + ! ` ~ * ; '
The scripting language
The scripting language is mostly PHP. There are a few functions and variables to allow you to interact with the IRC channel though:
Events
Events are implemented as a command name when adding commands.
__e_join
The __e_join event catches channel joins.
__e_part
The __e_part event catches channel parts.
__e_kick
The __e_kick event catches channel kicks.
__e_ctcp
The __e_ctcp event catches CTCPs to the bot.
__pm__<command>
The __pm__<command> allows you to catch commands in PM to the bot.
__ch__default
The __ch__default allows you to run an event every time someone speaks in the channel ... use sparingly.
__ch__<command>
The __ch__<command> allows you to set a command that doesn't need a trigger and/or has a different trigger.
Functions
Functions are predefined functions in the scripting language to allow you to interact with the channel.
say
The say() function allows you to say things in the channel.
Syntax: say($message);
act
The act() function allows you to do actions in the channel.
Syntax: act($message);
kick
The kick() function allows you to kick users from the channel.
Syntax: kick($nick,$message);
mode
The mode() function allows you to set modes in the channel.
Syntax: mode($modestring);
topic
The topic() function allows you to set the topic of the channel.
Syntax: topic($topic);
invite
The invite() function allows you to invite users to the channel.
Syntax: invite($nick);
notice
The notice() function allows you to notice things back to the user who triggered the command.
Syntax: notice($message);
ctcpreply
The ctcpreply() function allows you to send a ctcpreply to the user who triggered the command.
Syntax: ctcpreply($ctcpstring);
Variables
These variables are predefined to provide information about the command.
$nick
The $nick variable contains the nick who triggered the command.
$command
The $command variable contains the command that triggered the script.
$message
The $message variable contains the useful information after the command.
$channel
The $channel variable contains the bot's assigned channel.
$me
The $me variable contains the bot's nick.
$user
The $user variable contains the PHPServ username of the user who triggered the command.
$uid
The $uid variable contains the PHPServ username ID of the user who triggered the command.
$nickd
The $nickd variable is an array containing all sorts of useful /whois information on the person who triggered the command.
$level
The $level variable contains the global PHPServ level of the user who triggered the command.
$blvl
The $blvl variable contains the local PHPServ level of the user who triggered the command. (This is set by the Access Add command.)
$owner
The $owner variable is true if the user who triggered the command is the bot's owner.
$coowner
The $coowner variable is true if the user who triggered the command is one of the bot's coowners.
$type
The $type variable only exists in the __e_ctcp event, and contains the CTCP type.
$trig
The $trig variable contains the bot's in-channel trigger.
$who
The $who variable only exists in the __e_kick event, and contains the kicked nick.
$reason
The $reason variable only exists in the __e_kick and __e_part events, and contains the kick and part reasons respectively.
Cool, how do I get one
To get a bot, you must first register with PHPServ. You can do this by typing:
/msg PHPServ register <user> <pass> <pass>
Then you may join #botshed and ask Cobi.

