IRC Bot written in PHP Use with php4-cgi only ### installation ### 1. untar & gunzip > tar zxvf bot_v0.5.tgz 2. edit config file: config.txt edit at least "server" and "channel" config entries with brackets are used as arrays, comma seperated entries too. 3. start bot > php4 bot.php use php4.exe instead on windows systems #### usage ### The home_channel config option is a channel where all errors, joins, parts etc. are printed. Channel is an array of channels the bot should join. After the bot joined your favorite channel you can test with ".time" if the bot answers and start writing your own extensions. some useful commands: .exit [msg] bot will quit ( with a given quit msg) .version prints the bots version .op gives/removes someone op .voice/devoice gives/removes voice from someone .say [#channel] msg prints something to the (given) channel .action [#channel] msg performs an action in the (given) channel .kick [#channel] nick kicks this person from the (given) channel .nick newnick changes the nick of the bot .join #channel let the bot join another channel .part [#channel] let the bot part the given oder actual channel .mode new_mode performs a mode .reload [ext|handler] reloads all extensions oder all handler .unload [extname] unloads a particular extension oder handler .load [extname] loads a extension .debug [1|0] enables/disables debugging output ### writing extensions ### there are two types of extensions, privmsg extensions alias commands and handler. Privmsg extensions are fired if someone types for example .test and there is a 'test' in extensions = (...) configured and a 'ext_test = extensions/test.php' entry. Privmsg get can use some global variables to generate output. $_CHANNEL = name of the channel the command has been typed. This can be the username if someone gave the command via query. $_WHO = the name of the person who gave the command $_WHAT = the name of the command $_INPUT = all parameters everything returned or printed by the extension is printed to the channel. there are two types of handler, the privmsg handler and the all handler. The privmsg handler is fired every time a privmsg arrives. The all handler is fired all the time. Handler can use two global variables: $_WHAT = the name of the handler $_INPUT = is array of the exploded server response Be careful, handler can extremly affect performance. Try to keep them small and simple. ### history ### 0.5 added op/deop, fixed some bugs and changed print to stdout 0.4 fixed bugs and added ctcp support 0.3 complete rewrite with module support 0.2 first public version copyright: Sven Nierlein 2004 comments&questions sven@nierlein.org