jimie, the ones on SourceForge are pre-alpha at best, but you can steal code to get you started. I started on one but my comrades and I couldn't get a free web host that had the right conditions. Trawling through free web hosting listings on the Internet testing them is a pain in the arse.
http://users.on.net/~conheady/patbot.tar.gz is my code. It's
partially functional; let me know what you think of the coding style and the commenting.
Basically, the blocker I ran into was that many PHP installations set a time limit of, say, 30 seconds, for a script to run. This is to stop bad code spawning never-ending loops, which just chew CPU time and waste money.
It also means that your bot will connect to the channel for a grand total of 30 seconds before it is killed.
You need a web host where either
a) there is no time limit
b) you can change the relevant INI setting in your PHP code. The name of this setting is buried in the PHP manual.
Another concern is the firewall on the web server. The web server might be blocked from making outgoing connections, or even specifically IRC might be blocked.
Alternatively, the firewall might be very relaxed, and you might be able to bind listening sockets from within PHP code. This would allow you to run, for example, an IRC server.
If you can get it working, it is extremely useful. It provides another IP address to connect to servers from (good for avoiding bans and clone limits), and doesn't affect your process count on any shell accounts. Plus, web hosting is probably easier to get anonymously from many sources simultaneously than shell accounts. More people give out web hosting than shell accounts.
An IRC bot is one thing, but if that works, hack up an SSH server, a proxy and more, all running in PHP.
As yet another approach you might take, you could use backticks to run binaries on your web server. This way, you could run eggdrop! Again, this is subject to countless restrictions by PHP and the server, and I can't even describe which parts of the fair usage agreements you might break.
Backticks also have the advantage that if the PHP script timeout is your only obstacle, backgrounding a shell script (or a PHP script through the CGI or CLI PHP binaries) will often allow you to run code all day.
OP, to make multiple connections with the one process (I rudely assume you're trying to circumvent the shell account process limit), you might need to edit some code yourself. Threads might be what you are after, but I'm not sure how multithreading interacts with the process limit. Editing code can be messy, but if you'll feel really good if you introduce new and useful functionality to an open-source product.
-pcweirdo.
I love logic, therefore a polar bear is gay and I am the President. Or I'm thinking too much. I love this website.