Jump to content

Recommended Posts

Are you able to output or log the incomming server text?

Perhaps it will tell you why you're the bot is timing out?
I haven't used php sockets but I have done my own IRC Client with VB.NEt and I can toggle on/off the parsing of the IRC server text.  Sometimes it can give you clues as to why you connection drops/timesout.

[quote author=SharkBait link=topic=123057.msg508762#msg508762 date=1169235895]
Are you able to output or log the incomming server text?

Perhaps it will tell you why you're the bot is timing out?
I haven't used php sockets but I have done my own IRC Client with VB.NEt and I can toggle on/off the parsing of the IRC server text.  Sometimes it can give you clues as to why you connection drops/timesout.


[/quote]

yes i can, i said this in a previous post. there seems to be no common link of why my bot is leaving.
okay i got it,it seems for no reason my bot runs the whole script again and again every now and then :P

this is my connect code.

[code]
<?php
set_time_limit(0);

//set vars
$host = 'irc.barafranca.com';
$port = '6667';
$nickname = "Bot";
$channel = file('../bot/channels.txt');

//open data.txt and botlines.txt
$cokehandle = fopen('../coke/data.txt', w);

$lineshandle = fopen('../botlines.txt', a);
fwrite($lineshandle, "\n\n\n");

$killmode['#chan'] = 'on';
$ks = array();

//connect to IRC
$socket = fsockopen($host, $port);
stream_set_timeout($socket, 60*60*24*365);
fwrite($socket, "NICK ".$nickname."\r\n");
fwrite($socket, "USER ".$nickname." 8 * :Nick's Bot\r\n");
fwrite($socket, "MODE ".$nickname." +B\r\n");
while ($line=fgets($socket)) {
  if (strpos($line, "433")>0) die();
  if (strpos($line, "004")>0) {
      $chancount = count($channel);
      fwrite($socket, "PRIVMSG nickserv :IDENTIFY Bot hello123\r\n");
      for ($i = 0; $i < $chancount; $i++) {
            fwrite($socket, "JOIN ".$channel[$i]."\r\n");
      }
      break;
  }
}

?>[/code]

there is a [color=blue]$lineshandle[/color]  to log my lines and there are a lot of random "\n\n\n" in the middle of all the lines. this must mean that my whole php script just randomly starts again after a while :s and some times is give me an EOF because it doent run again, it just ends :P

how do i stop this?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.