kloon_za
03-05-2007, 07:03 AM
Hey im writing a smal php based irc bot that uses sockets to talk with the irc server. Now my problem is im not getting all my data through to the server if it has multiple lines.
function cmd_send($command)
{
global $con, $time, $CONFIG;
/* Send the command. Think of it as writing to a file. */
fputs($con['socket'], $command."\n\r");
/* Display the command locally, for the sole purpose
of checking output. (line is not actually not needed) */
print (date("[d/m @ H:i]") ."-> ". $command. "\n\r");
}
if(strtoupper(substr($con['buffer']['text'], 0, 7)) == '!EPINFO'){
$eps = strtoupper(substr($con['buffer']['text'], 8, strlen($con['buffer']['text'])-2));
$info=file_get_contents('http://episodeworld.com/botsearch/'.$eps);
print(rtrim($info));
cmd_send(prep_text("please",strip_tags($info)));
}
I only get the first line through
function cmd_send($command)
{
global $con, $time, $CONFIG;
/* Send the command. Think of it as writing to a file. */
fputs($con['socket'], $command."\n\r");
/* Display the command locally, for the sole purpose
of checking output. (line is not actually not needed) */
print (date("[d/m @ H:i]") ."-> ". $command. "\n\r");
}
if(strtoupper(substr($con['buffer']['text'], 0, 7)) == '!EPINFO'){
$eps = strtoupper(substr($con['buffer']['text'], 8, strlen($con['buffer']['text'])-2));
$info=file_get_contents('http://episodeworld.com/botsearch/'.$eps);
print(rtrim($info));
cmd_send(prep_text("please",strip_tags($info)));
}
I only get the first line through