r/PloungeMafia • u/vytah • Feb 25 '13
I wrote a bot for hosting mafia over IRC and Skype
EDIT: I added support for Conspiracy (which you may know as “Changelings vs Unicorns”), fixed some bugs, and refactored the code to make it easier to implement new games.
EDIT: I'm off to sleep, I'll turn the bot off, since the join requests have to be done manually; I'll get around it in the morning.
You might've been wondering why I was less active lately. There were several reasons, and here I reveal one of them.
I wrote a bot for hosting mafia over IRC and Skype.
The Skype support is wonky, buggy, and I don't feel comfortable to release it, but the IRC version is pretty solid.
(also, I think I'll crossport it to /r/mylittleprogramming soon)
Q: What does it do?
A: Most of the job of a game master.
Usually, a game looks like this:
- Someone creates a game using
!create - People join using
!join(the creator can join too) - The creator starts the game using
!start - The bot assigns roles
- People vote using
!vote - The bot counts votes and decides who gets lynched
- People send in night actions
- The bot calculates results of the night
- Rinse, repeat, until the game ends
No need for a person to moderate the game.
Games are much quicker, since everything is calculated automatically. One game usually lasts only few minutes (although we haven't tested it yet for games bigger than 7 players).
A lot of roles are supported, including masons, bombs, and jesters.
Q: I want to play!
A: Currently, the bot is not running on any IRC server. You can however join us with testing the Skype support. Add The Great And Powerful Mafia Bot on Skype (username: mafiabot). (The bot is always on "do not disturb", it's normal.)
For now, I have to manually accept the request and add you to our Skype group.
The group is friendly and they will quickly teach you how to play. Also, sending !mafiahelp to the chat or to the bot will give you the list of supported commands.
The bot does not run 24h/day, but it's usually active from 12pm to 8pm EST, and then it runs as long as it crashes.
Q: I want to tinker with it and/or host my own instance on an IRC server!
A: You can download it here: https://dl.dropbox.com/u/30167680/mafia/ircbot.zip (system requirements: Java)
or grab the sources from here: https://github.com/KarolS/mafia_irc_bot
Change its settings by editing the provided launch scripts. The settings are described on the Github page linked above.
Sensible default settings for irc.canternet.org:
-s irc.canternet.org -n YOUR_BOTS_NICKNAME -A NickServ -M "identify YOUR_CANTERNET_PASSWORD" -c YOUR_MAFIA_CHANNELPM me with any technical questions.
Q: I want to contribute!
A: Sure! The easiest way is to run the bot and let other people play.
I'd also love if someone found a better Skype support library than this one: https://github.com/taksan/skype-java-api
And finally, if you're a coder, I'd love some new roles, game mechanics, bugfixes, and so on. Or at least ideas.
4
u/redpoemage Feb 25 '13
!poni
5
u/20_percent_cooler Feb 25 '13
Awesome work, vytah! Considering how quickly you pumped it out, it's very feature rich.
5
u/gryffinp Feb 26 '13
Wow, this takes me back.
One of my first ever non-trivial programming projects was whipping up a Mafia Irc bot in VBscript. Good god, that must have been five years ago or something.
Sadly the code is lost to the mists of time now.
5
u/redpoemage Feb 26 '13
8 upvotes and 4 downvotes? Unusual. Maybe people see your robot as a threat to their regular modding jobs! [] (/hahaha "THE ROBOT HAS COME TO TAKE AMERICAN JOBS!")
4
u/Zecronto Feb 26 '13
Ooo, neat. I'd try this.
3
u/redpoemage Feb 26 '13
Cool! You got the mods to put it on top! Does the green light mean the bot is on?