IRC Uno bot for Phenny
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.
Features:
- 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!
Known issues:
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!
7 Responses to IRC Uno bot for Phenny
MINDEN VÉLEMÉNY SZÁMÍT! Kilépés a válaszból
Kategóriák
- Games (2)
- Lakás (1)
- Stuff from the net (1)
- Uncategorized (5)
Blogroll





Wooo!
I’m having trouble starting Uno. Phenny keeps telling me that there is not enough players to play with 2+ people joined.
Phenny is at one of the latest versions.
I do not know enough about python yet to dig myself out… any help would be apprecitated.
Every player (except the one who started the game) needs to type join to join, the bot will acknowledge this, something like this:
[19:01] join Dealing unoPlayer into the game as player #2!
[19:01]
Do you see this? Does the bot still say there are not enough players?
If so, can you copy and paste the session? Or you could let me know which server and channel can I find this bot and I’ll try it myself.
Thanks for the feedback!
I love this game! But I’ve come across a bug or a problem. In a 2player game, after someone plays a WD4 or a D4 card nothing else will play on that. I’ve tried every color this the S, R, and D2, and even the WD4 and D4 when the top card is a WD4. What card is suppose to be played after the WD4?
A WD4 is like a W, except that it causes a skip and the skipped player to draw 4 cards.
When playing a WD4 you can choose what color do you want next. For example:
.play WD4 r
This will cause the bot to display [*] in red, meaning you can play any red card. Of course you can choose any other color too (g, b, y).
I hope that cleared it up, if you’re still confused then let me know and I’ll be happy to demonstrate. You can visit #eperland on irc.quakenet.org where we usually play.
Having trouble getting people to join. Phenny is up to date. When anyone types “join” the bot does not respond. Any ideas? I’m trying to decipher the code but failing miserably.
Thanks,
.rkitect
Just for the record, if anyone else has this problem: the join function clashes with some other module, so renaming it solves the issue. You need to change this code:
To:
That should enable join. If not try contacting me (on IRC or e-mail).