commit 0bcca1c9065e4ca65054e03bc1323047bba37ca5 Author: Gergely Polonkai Date: Fri Apr 29 22:31:36 2016 +0200 Initial version diff --git a/doc/Overview b/doc/Overview new file mode 100644 index 0000000..073a67d --- /dev/null +++ b/doc/Overview @@ -0,0 +1,3 @@ +Aszongyahogy... UnrealBot v0.0.0.1.debug.dev.priv .) + +perl diff --git a/doc/TODO b/doc/TODO new file mode 100644 index 0000000..a5bb619 --- /dev/null +++ b/doc/TODO @@ -0,0 +1,4 @@ +Change perror()s to something that doesn't write to std[in|out|err]. +E.g. logging. + +config.c:225 diff --git a/doc/commands.txt b/doc/commands.txt new file mode 100644 index 0000000..f8a2a11 --- /dev/null +++ b/doc/commands.txt @@ -0,0 +1,7 @@ +MSG +Sends the message to . Nick can be a channel name, too. + +LOGTOFILE +If doesn't exist, it'll be created, and will be written to it. +Otherwise will be appended to + diff --git a/doc/conf.txt b/doc/conf.txt new file mode 100644 index 0000000..7da5a44 --- /dev/null +++ b/doc/conf.txt @@ -0,0 +1,92 @@ + The UnrealBot's configfile is an XML 1.0 document, enclosed by + 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 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 +attribute. + Example: + + ... + + + As the file is a real XML document (it is parsed with expat), you can put +comments anywhere you want. + Example: + + + 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. + Example: +URbot +[nick] bot of [owner] + 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) + Example: + + 6789 + botpassword + COMMAND1 + COMMAND2 + 1 + + + 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. + Example: + + ourkey + +nt-siklm + COMMAND_IF_NEED_OP + COMMAND_IF_NEED_INVITE + COMMAND_IF_NEED_UNBAN + COMMAND_IF_NEED_LIMIT + COMMAND_IF_NEED_KEY + + + 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. + Example: + + #chan + MSG [chan] Hello, [nick]! + MSG [owner] [nick] entered [chan] + + +[] substitutions + +[open] Evaluates to [ +[close] Evaluates to ] +[owner] The nickname of the bot-owner (specified by +[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 diff --git a/doc/example.conf b/doc/example.conf new file mode 100644 index 0000000..59104de --- /dev/null +++ b/doc/example.conf @@ -0,0 +1,61 @@ + + + + + URbot + + + urB0T + URB0T + + + urbot + + [owner]'s bot + + + + SulIRC hidden server + 6668 + BotPassword + MSG NickServ IDENTIFY URbotPASS + + + + + SulIRC main hub + 6668 + MSG NickServ IDENTIFY URbotPASS + MODE [botnick] +B-ix + 1 + + + + hiddenpass + +nst-likm + + MSG [owner] I need ops on [chan] + MSG [owner] I need invite on [chan] + MSG [owner] I need unban on [chan] + MSG [owner] I need higher limit to enter [chan] + MSG [owner] Send me the key for [chan] + MSG [chan] I'm here! + + + + + + + + #bottest + MSG [nick] Hello, [nick] + MSG [chan] [nick] entered the channel + + + + + hello + MSG [chan] Hello, [nick]! + + + diff --git a/urbot.pl b/urbot.pl new file mode 100644 index 0000000..b4b0421 --- /dev/null +++ b/urbot.pl @@ -0,0 +1,6 @@ +#! /usr/bin/perl + +use strict; +use Net::IRC; + +