well i am not have great luck with SmartIRC but this "mostly" works.. i am using Unreal irc server - whcih i think is not very rfc 2812 compliant - so i get a lot of SmartIRC debug error msgs... but...
oh yea... one other thing though... SmartIRC crashes on me a lot.. if i do a refresh on page with the above code... after 4 or 5 refreshes my Apache server jumps to 100% cpu... and i do have the sockets extension included..
i just figure that SmartIRc is buggy...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
how to get the "simply" IRC command (/names) to work ?
I need the results into an array.
Greetings!
If you use setChannelSyncing(TRUE), use this:
foreach ($irc->channel[$data->channel]->users as $value) {
echo $value->nick;
}
$data->channel = "channel name" and need the bot are joined in channel.
hmmm that thingie could not help me!
It does not work!
Another idea ?
well i am not have great luck with SmartIRC but this "mostly" works.. i am using Unreal irc server - whcih i think is not very rfc 2812 compliant - so i get a lot of SmartIRC debug error msgs... but...
include_once('SmartIRC/SmartIRC.php');
$irc = &new Net_SmartIRC();
$irc->setUseSockets(false);
$irc->connect('192.168.1.101', 6667);
$irc->login('Net_SmartIRC_Scanner', 'Net_SmartIRC Client', 0, 'Net_SmartIRC');
$irc->join(array('#TheSportsConnection'));
$irc->names(array('#TheSportsConnection'));
$resultar = $irc->listenFor(SMARTIRC_TYPE_NAME);
$irc->disconnect();
$names = explode(" ",$resultar[0]);
foreach ($names as $key=>$name) {
if ($name == "") unset ($names[$key]);
if (stristr($name, "@")) $names[$key] = str_replace("@", "", $name);
}
oh yea... one other thing though... SmartIRC crashes on me a lot.. if i do a refresh on page with the above code... after 4 or 5 refreshes my Apache server jumps to 100% cpu... and i do have the sockets extension included..
i just figure that SmartIRc is buggy...
Why does the bot quit after
$irc->names(array('#test'));
$resultar = $irc->listenFor(SMARTIRC_TYPE_NAME);
$names = explode(" ",$resultar[0]);
print_r($names);
??
Just added these lines to a callback and now the bot quits after the callback...