|
Location: Web development - Python License: A Public Domain dedication Making an Module for PhennyPosted by FrankMaking an extra module (extra commands) for Phenny the irc-bot. |
Skill: BeginnerPosted: 04/12/2008Views: 417Rating: 4.00 /5Popularity: 0.00 |
| Sign Up to vote for this article |
Phenny is a simple irc-bit written in Python. And it's not so hard to make an extra module for her. Basic knowledge of Python is enough for simple modules.
I'm going to explain how to add an extra module. In this article I'm going to explain how to make the .kill command. Just a command for fun.
.kill is supposed to work like this:
Should be too hard. ;)
We're going to store the kills in an MySQL database so you need to install MySQLdb first. So read the docs at this website first: http://mysql-python.sourceforge.net/
After you installed MySQLdb you have to install Phenny. Download Phenny from here http://inamidst.com/phenny/ and read README.txt for the installation instructions.
Create a new MySQL databse (something like 'phenny') and import this SQL:
That is the table that contains all the kills + some free kills from me.
And here is the Python code you need, I have added comments to explain everything:
Put this code in [the folder where phenny is installed]/modules/kill.py and startup Phenny and you can start killing on the irc.
This article, along with any associated source code and files, is licensed under A Public Domain dedication
| Frank
| Location: |
Sign up to post message on the article message board!