In my free time I like to hang out on a particular IRC channel, where we occasionally play some simple games. One of our favorite was Uno, a simple mIRC script that hosted Uno games. Since it is a mIRC script, it’s difficult to keep on the channel all the time, so I decided to clone it for Phenny, the Python IRC bot.
It was a nice exercise, and I think the end result is not so bad, so I’m making the code public.
- slightly modified UNO gameplay
- unlimited number of players in a round (minimum 2)
- logging of total score, games played, won, and total time spent playing per nickname
- separated strings, so localization to other languages should be easy
How to set up:
1. Download the unobot.zip file below, and extract the unobot.py file from it.
2. Install phenny. Edit the ~/.phenny/default.py config, add the unobot.py file with path to the ‘extra’ modules. Set up the other settings as desired.
3. Edit the unobot.py file, set the channel’s name (same as in default.py), and change the score file path. Make sure that Phenny has the proper rights for writing the file.
4. All set, start phenny and enjoy playing, by typing the .uno command in the channel!
Note that ordinary IRC nicknames are used to identify the players. The bot cannot react to a player leaving the channel or timeouting, either the game must be stopped (if the game owner quit then someone will have to take their nick temporarly to do the .unostop action) or someone must step in with the same nickname.
Uno Bot for Phenny is licensed under the FreeBSD license.
For more games for Phenny visit Phenny Games!