MWNBot

MWNBot is an IRC bot I made in Java for a channel I have with my friends from college. It has a few standard IRC bot commands with a few tweaks.
What you need
The bot's source can be found here
. It uses the PircBot library found here.

How to use it
IRC bots generally have a special character that they look for at the start of message in a channel which signifies a bot command. This bot uses "!". As long as that character is at the start of your message, and what follows is a valid command, the bot will recognize it.

There is one feature that doesn't require a special character. Any links sent to the channel (starting with "http://" or "https://"
) will have their title shown in the channel. If a link's content is not text and HTML, no title will be shown. So direct links to pictures and videos will not have their title shown. This feature also works in a private message to the bot.

The commands
Here is a table of commands that can be used with this bot:

Command Arguments (italics = optional, bold = exact argument) Description
roulette [None] Plays one shot of Russian Roulette with a six-chamber gun and one bullet.
wstats word
Shows the top 5 most commonly used words in the channel since the last word count reset. Punctuation (except for apostrophes and hyphens), command messages, words less than three letters long, numbers, some specific words, and URLs are not counted. Words are changed to lowercase before counting. If an argument is given, the total count for that word will be given.
rstats nick Displays some stats about the games of Russian Roulette played in the channel. Shows the user with the most shots, highest death rate, highest survival rate, and the average bullet position. When given a nick, shows the death rate, survival rate, and number of shots taken by that user.
reload [None] Reloads the Russian Roulette gun. When reloading on the 5th and 6th chambers this command has a 50% chance of firing the gun instead.
coin [None] Flips a coin and tells you heads or tails.
later nick message Saves a message to deliver to the specified user when they join the channel or next send a message to it.
karma
nick Displays the current karma of the given user. If no nick is specified, your own karma will be shown. To increase a user's karma, send a message to the channel with a "++" appended to their nick. To decrease it, use "--".
clear roulette or karma nick nick nick...
or
words
or
word word word word...
or
all
Admins only. Clears the Russian Roulette stats (roulette), the karma data (karma), word count data (words), or all of those (all). If a nick (or nicks) is specified for roulette or karma, it will only clear the stats for that nick (or all nicks listed). You may also remove specific words form the word count list by specifying the option "word" and listing them after that.
help command Displays help information about the given command or gives a list of available help topics if no command is specified

You'll notice that the "clear" command is for admins only. The bot has a list of admin nicks stored in the code. To become an admin, you must add your nick to this list. Admins may also shut the bot down by sending "disconnect" (note that there is no "!") in a private message to the bot. When the bot disconnects, it will save roulette and karma information.The bot may also be shut down via standard input by simply pressing enter.

There is also a list of words to ignore in the word count. These are currently hard coded. Additions to the list require a bot restart to take effect.
Comments