Getting /names list

Help
2004-11-15
2013-04-09
  • 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 ?

       
    • Peter
      Peter
      2004-11-18

      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);
        }

       
    • Peter
      Peter
      2004-11-18

      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...