So ich habe das programm jetzt einigermahßen fertig,
wer es haben möchte muss allerdings zuerst phpirc 1.1 runterladen:
phpIRC 1.1 ist ein irc-layer realisiert in php. es ermöglicht die programmierung von irc-bots, online-checkers und einigem mehr.
http://www.phpwelt.de/archiv/arccount.php?arcid=4&was=dlurl
und hier is das script!
<?
$bot_nick = "nick"; // The nick of the bot
$own_nick = "own_nick"; // The nick of the bot owner
$bot_serv = "irc.webchat-network.de"; // Server to connect
$bot_port = 6667; // Port to connecto, default is 6667
$bot_chan = "#fjs-board"; // chanel to seat at
$bot_pass = "password"; // Bot Password del ( if it exist)
$irc_default_nick = $bot_nick;
$irc_default_realname = $own_nick;
$irc_default_identd = $bot_nick;
$irc_valid_identd = 1;
$irc_host = $bot_serv;
include "phpIRC.php";
function ini() {
global $bot_nick, $bot_serv, $bot_port, $bot_chan, $bot_pass;
error_reporting(63);
if(!irc_init())
die(_Error_starting_);
irc_change_nick ($bot_nick);
if (irc_connect($bot_serv, $bot_port)) {
}
else {
die ("\nError de coneccion\n");}
$channel_handle = irc_join($bot_chan);
if(!$channel_handle)
die(_Error_join_);
irc_put_message("NickServ IDENTIFY $bot_pass");
} // ini()
function fPublicos ($code, $nick, $identd, $host, $destination, $text) {
global $bot_chan;
$nick_list = irc_get_nick_list($bot_chan);
echo "Folgende User sind Online:<BR>";
while(list($key, $value) = each($nick_list))
{
echo "<BR>".addslashes($value);
}
exit;
} // fPublicos
irc_set_debug_mode(1);
ini();
irc_add_callback(IRCCB_ONCHANNELMSG, "fPublicos");
irc_add_callback(IRCCB_ONPRIVMSG, "fPublicos");
irc_privmsg($bot_nick,"/quit");
irc_idle(IRC_NOBREAK);
?>
aber wie gesagt das script is noch nicht ausgereift, aber es functioniert!