Bucket is one of the bots on CTWUG IRC Channels. The source is available here, which includes a sample database with a minimal configuration.
The bot was copied from xkcd-Bucket. Some of the links below reference the original documentation.
Bucket is a bot that can be taught factoids that will be triggered when certain phrases are said. The full documentation is available here, but this document will serve as a quick overview of some of Bucket's functionality.
Bucket must be addressed to be taught factoids, either as "Bucket:" or "Bucket," (or whatever you choose to name your instance), most clients should do this by tab-completion.
- Clone this repository.
- Set up a MySQL database, other databases may work but are not guaranteed to do so.
$ sudo apt-get install mysql-server
*Replace this appropriately depending on your operating system. - Create the tables in bucket.sql. You may need the arguments
--user=root --password
in order for it to work.$ mysql -D bucket < bucket.sql $ mysql -D bucket < sample.sql```
- Create a user for Bucket, and grant all perms on the bucket database.
$ echo 'grant all on bucket.* to bucket identified by "s3kr1tP@ss"' | mysql
- Edit config file (bucket.yml)
- Install perl modules.
Lingua::EN::Syllable YAML HTML::Entities URI::Escape XML::Simple```
- Set bucket.pl as executable.
$ chmod +x bucket.pl
- Pre-flight checklist
- Register your Bucket's nick with NickServ
- Register your Bucket's logging and config channels, and configure them as private and restricted.
- Add your Bucket's nick to the allow list for the logging and config channels.
- Start Bucket.
$ ./bucket.pl
- Start adding factoids!
This is only a brief overview, the full documentation is here.
This is the most common and basic method of teaching Bucket factoids, it is added by simply saying X is Y
.
If "X" is said later, Bucket will reply with "X is Y". Be careful, though, as it is also easy to accidentally
create factoids this way. X is also Y
will have the same effect.
X is Y is Z
will be split between X
and Y
, and Bucket will respond to the trigger "X" with "X is Y is Z."
X is Y <is> Z
must be used for "X is Y" to trigger "X is Y is Z." See the section on s below.
This is used identically to X is Y
, with the exception being that Bucket will respond to "X" with "X are Y."
Bucket is smart enough to know verbs! X loves Y
and similar phrases will cause X to trigger "X loves Y."
X<'s> Y
is a special variant of this, making "X" trigger "X's Y."
Perhaps the second-most used factoids are X <reply> Y
factoids. Saying "X" will make Bucket respond "Y."
This will make Bucket use a /me
when he replies. Thus, saying "X" will make Bucket /me Y
.
Bucket is not a client! Teaching him factoids such as Quit <reply> /quit
will not work as intended.
Bucket has the ability to remember things that users have said. Remember {nick} {snippet_from_line}
will remember
that user's line under the trigger "nick quotes."
literal X
will list all the factoids associated with that trigger, separated by |
. If there are too many, Bucket
will automatically create a new page and append "n more." literal[*p*] X
will list page number p.
literal[*] X
will make Bucket produce a URL of a text file with all of the associated factoids.
X =~ /m/
will make Bucket reply with the first factoid in trigger "X" containing "m."
"what was that?" will make Bucket list the last spoken factoid with all of its details: "That was X(#000): Y", the number being the factoid ID.
X =~ s/m/n/
will replace "m" with "n" in the trigger "X." X =~ s/m/n/i
(adding an "i" flag) will replace case-insensitively.
If there is more than one appearance of "m" in "X," it will replace the first instance. Channel operators can add a "g" flag to
replace all.
undo last
undoes the last change to a factoid. Non-ops can only undo last
if they made the last change.
Variables will only work in responses.
$noun
and $nouns
will add random noun(s) where they are placed.
$verb
, $verbed
and $verbing
will do similarily with verbs.
$adjective
and $preposition
have similar effects.
$who
will be replaced with the person who triggered the factoid, while $someone
will choose a (semi-)random user.
$to
will be replaced by the intended recipient, for example, <someuser> anotherguy: blah blah
will replace $to with "anotherguy."
Bucket also has gender variables (among other variables.) They can be found here.
Items can be put in Bucket, given to Bucket, or items given to Bucket. Bucket is also smart enough to understand posession, and will
add "username's item" appropriately. Bucket's inventory can be listed with the command inventory
.
Ops can delete items using detailed inventory
and delete item #x
.
$item
, $giveitem
, and $newitem
are all variables concerning items. $item
will use an item in Bucket's inventory, $giveitem
will
use an item and discard it, and $newitem
will use a random item from previously learned items.
Bucket also has some factoids for hard-coded uses. These include "Don't Know", "Automatic Haiku" and "Band Name Reply."
Any bugs, feature requests or questions should be directed to spin at irc.ctwug.za.net. Or, ask people on #bucket there.