php irc bot
Posted: Wed Apr 30, 2003 12:56 pm
well im trying to make one.
it can connect to server, but the server sends a ping command which requires a PONG to be sent back.. except i cant work out how to know when this is sent, and how to send back teh correct number
here is my code
i just got it froma tutorial
anyway when it connects this is printed out:
NOTICE AUTH :*** Looking up your hostname NOTICE AUTH :*** Checking Ident NOTICE AUTH :*** Couldn't look up your hostname PING :1757207385 :London.UK.Eu.Netgamers.org 451 c0wphpBot c0wphpBot :Register first. :London.UK.Eu.Netgamers.org 513 c0wphpBot :Your client may not be compatible with this server. :London.UK.Eu.Netgamers.org 513 c0wphpBot :Compatible clients are available at ftp://ftp.undernet.org/pub/irc/clients ERROR :Closing Link: c0wphpBot by London.UK.Eu.Netgamers.org (Ping Timeout)
it wants me to send PONG :1757207385 back to it
only i dont know how to check when i recieve the ping message!
if someone could help that would be cool
many thanks
Tom
it can connect to server, but the server sends a ping command which requires a PONG to be sent back.. except i cant work out how to know when this is sent, and how to send back teh correct number
here is my code
Code: Select all
<?php
$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP); // create the socket
$connection = socket_connect($socket,'irc.netgamers.org',6667);
socket_write($socket,"USER RHAP RHAP RHAP :RHAP\r\n"); // Send the Username to
socket_write($socket,"NICK c0wphpBot \r\n"); // Change our nickname
socket_write($socket,"JOIN #php \r\n");
socket_write($socket,"MSG #php look this is c0ws scripit i wonder if it works\r\n"); //
while($data = socket_read($socket,2046)) // read whatever IRC is telling us
{
echo $data;
}
?>anyway when it connects this is printed out:
NOTICE AUTH :*** Looking up your hostname NOTICE AUTH :*** Checking Ident NOTICE AUTH :*** Couldn't look up your hostname PING :1757207385 :London.UK.Eu.Netgamers.org 451 c0wphpBot c0wphpBot :Register first. :London.UK.Eu.Netgamers.org 513 c0wphpBot :Your client may not be compatible with this server. :London.UK.Eu.Netgamers.org 513 c0wphpBot :Compatible clients are available at ftp://ftp.undernet.org/pub/irc/clients ERROR :Closing Link: c0wphpBot by London.UK.Eu.Netgamers.org (Ping Timeout)
it wants me to send PONG :1757207385 back to it
only i dont know how to check when i recieve the ping message!
if someone could help that would be cool
many thanks
Tom