Initial version

This commit is contained in:
Gergely Polonkai 2016-04-29 22:31:36 +02:00
commit 0bcca1c906
6 changed files with 173 additions and 0 deletions

doc/Overview Normal file
View File

@ -0,0 +1,3 @@
Aszongyahogy... UnrealBot .)

doc/TODO Normal file
View File

@ -0,0 +1,4 @@
Change perror()s to something that doesn't write to std[in|out|err].
E.g. logging.

doc/commands.txt Normal file
View File

@ -0,0 +1,7 @@
MSG <nick> <rest>
Sends the message <rest> to <nick>. Nick can be a channel name, too.
LOGTOFILE <file> <text>
If <file> doesn't exist, it'll be created, and <text> will be written to it.
Otherwise <text> will be appended to <file>

doc/conf.txt Normal file
View File

@ -0,0 +1,92 @@
The UnrealBot's configfile is an XML 1.0 document, enclosed by
<urbot></urbot> tags. In the urbot tag, you have to specify, which version is
the file was written (e.g the first public release, 1.0 requires <urbot
version="1.0"></urbot> tag-pair). I don't plan to change the bot so much in
the future, so any later bots will read this file, but it's not sure that older
bots will, too. If you omit the version attribute, it defaults to 1.0
Also, you MUST set the owner's nickname in this tag, too, with the owner
<urbot version="1.0" owner="MyNick">
As the file is a real XML document (it is parsed with expat), you can put
comments anywhere you want.
<!-- This is a comment -->
In the main section you can define the bot's parameters: nickname (nick tag),
username (uname tag) and real name (realname tag). You cannot use the []
substitutions in these tags ([] substs are described later), except [owner].
Others will evaluate to "" (null-string), even if they are already declared).
If you don't use services, it is possible that the bot's nick is already
chosen by someone else, so you can set alternative nicknames with the altnick
tag. You can chose more then one altnick.
<realname>[nick] bot of [owner]</realname>
This will set the nickname to "URbot", and realname to " bot of MyNick".
You can add a server with the server tag. The only thing you have to declare
here is the server's address within the server tag. The port, if omitted,
defaults to 6667. If the server wants a password from you, you can specify it
between password tags. You can define commands to execute when the bot is
connected to the server. You can define the order the bot tries these servers
with the autoconnect tag. If you omit this tag, the bot will try the server if
it is said to. (See commands.txt)
<server address="">
Each channel you want your bot to watch on is between chan tags. You have to
specify the name for the channel only. You can, at your option, set actions
what to do if the bot doesn't have ops, need invite to enter the channel, etc.
If the bot has ops on the channel, it can preserve channel modes, too. If the
channel has a key, you can set it with the chankey tag. The bot will use it
automatically when tries to enter the channel.
<chan name="#chan">
The most important option of the UnrealBot is to react to events on IRC.
These events are: join (happens when someone joins a watched channel), part
(happens when someone leaves a watched channel), msg (when someone sends a
private message to the bot), pub (when someone says something on a watched
channel), quit (when someone on a watched channel leaves IRC). If you want a
specific event to occur only on a specific channel, you can set it with the
chan tag. You have to set the command(s) you want to execute on this event.
<react type="join">
<command>MSG [chan] Hello, [nick]!</command>
<command>MSG [owner] [nick] entered [chan]</command>
[] substitutions
[open] Evaluates to [
[close] Evaluates to ]
[owner] The nickname of the bot-owner (specified by <owner></owner>
[server] The name of server the bot is connected to. Specified by
[chan] The channel's name (e.g which the event occured on)
[nick] The nickname (e.g who triggered the event)
[rest] The rest of the text (e.g the message in a msg event, or the quit
message of a quit event.
A complete example can be found in the source tarball under doc/example.conf
*** Written by W00d5t0ck 2003-08-10

doc/example.conf Normal file
View File

@ -0,0 +1,61 @@
<?xml version="1.0"?>
<!-- This is my own bot's config, with - of course - changed passwords -->
<urbot version="1.0" owner="W00d5t0ck">
<!-- The nickname will be URbot -->
<!-- As on my server there are services such as NickServ, it is not -->
<!-- needed, it's for demonstation only .) -->
<!-- An active ident server may override this setting. Consult your -->
<!-- network admins about this -->
<!-- The real name will be W00d5t0ck's bot -->
<realname>[owner]'s bot</realname>
<!-- The bot will never connect to this server, only if it's said to -->
<server address="wood.wx">
<name>SulIRC hidden server</name>
<initcmd>MSG NickServ IDENTIFY URbotPASS</initcmd>
<!-- This will be the first server the bot will try, because I set -->
<!-- autoconnect to 1 -->
<server address="">
<name>SulIRC main hub</name>
<initcmd>MSG NickServ IDENTIFY URbotPASS</initcmd>
<initcmd>MODE [botnick] +B-ix</initcmd>
<!-- This bot is monitoring #URchan and #bottest -->
<chan name="#URchan">
<!-- Because of chanserv, these are not neccessary -->
<op>MSG [owner] I need ops on [chan]</op>
<invite>MSG [owner] I need invite on [chan]</invite>
<unban>MSG [owner] I need unban on [chan]</unban>
<limit>MSG [owner] I need higher limit to enter [chan]</limit>
<key>MSG [owner] Send me the key for [chan]</key>
<initcmd>MSG [chan] I'm here!</initcmd>
<chan name="#bottest">
<!-- This will greet everyone who joins #bottest, and tell the members -->
<!-- about her/his arrival. Since on my network #bottest is a bot-testing -->
<!-- channel, the bot can do _anything_ -->
<react type="join">
<command>MSG [nick] Hello, [nick]</command>
<command>MSG [chan] [nick] entered the channel</command>
<!-- This will react to public messages which contain the word hello -->
<!-- on every monitored channels. -->
<react type="pub">
<rest type="ci">hello</rest>
<command>MSG [chan] Hello, [nick]!</command>

6 Normal file
View File

@ -0,0 +1,6 @@
#! /usr/bin/perl
use strict;
use Net::IRC;