what i have found is via the registerTimerhandler i can send a message, but this is not what I want.
I taskes a time until I can send. So if active listen and then the time handler the message will be send.
So How can I start the listen() until I get DEBUG_MESSAGEHANDLER: calling internal method "net_smartirc->_event_mode" (by string)
stop him and send the message that i want?
Any hints?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you have to call $irc->listen() or $irc->listenFor() otherwise the sendbuffer is never send....
if you want an one time message and then quit right away, use listenFor(SMARTIRC_TYPE_JOIN); this means after a JOIN message is received (your own join msg should be enough) it will quit automagic...
listenFor() is made for quick things...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I try to use SmartIRC which sound great in his funtionality.
When I try to send an hello or anythig erlse it does not apear on the channel.
Following code:
<code>
$irc =& new Net_SmartIRC();
$irc->setDebug(SMARTIRC_DEBUG_ALL);
$irc->setUseSockets(TRUE);
$irc->connect( $irc_config['server'], $irc_config['port']);
$irc->login( $irc_config['ircname'], $irc_config['realname'] );
$irc->join( array($irc_config['testroom']) );
$irc->message(SMARTIRC_TYPE_CHANNEL, $irc_config['testroom'], "this is a test");
$irc->disconnect();
</code>
I can see that the connect an join works but no message will be send.
Ouput from the debug::
Oct 30 19:04:12 SmartIRC.php(824) DEBUG_CONNECTION: connecting
Oct 30 19:04:12 SmartIRC.php(829) DEBUG_SOCKET: using real sockets
Oct 30 19:04:12 SmartIRC.php(858) DEBUG_CONNECTION: connected
Oct 30 19:04:12 SmartIRC.php(983) DEBUG_CONNECTION: logging in
Oct 30 19:04:12 SmartIRC.php(1495) DEBUG_IRCMESSAGES: sent: "NICK testi"
Oct 30 19:04:12 SmartIRC.php(1495) DEBUG_IRCMESSAGES: sent: "USER root 0 * : Watcher Deamon"
Oct 30 19:04:12 SmartIRC.php(1495) DEBUG_IRCMESSAGES: sent: "QUIT"
Oct 30 19:04:13 SmartIRC.php(906) DEBUG_CONNECTION: disconnected
May someone help what I have made wrong?
Regards
Peter
Okay,
what i have found is via the registerTimerhandler i can send a message, but this is not what I want.
I taskes a time until I can send. So if active listen and then the time handler the message will be send.
So How can I start the listen() until I get DEBUG_MESSAGEHANDLER: calling internal method "net_smartirc->_event_mode" (by string)
stop him and send the message that i want?
Any hints?
you have to call $irc->listen() or $irc->listenFor() otherwise the sendbuffer is never send....
if you want an one time message and then quit right away, use listenFor(SMARTIRC_TYPE_JOIN); this means after a JOIN message is received (your own join msg should be enough) it will quit automagic...
listenFor() is made for quick things...
Actually, listen for the SMARTIRC_TYPE_CHANNEL instead - that way, the bot will quit after it sees its own message.