Page 1 of 1

Apached Don't WildPHP Bot not joining Server!

PostPosted: 11. July 2016 16:54
by DonGolss
Hello,
when i start and go to localhost/bot.php it says:
"Undefine Offset on line 113"
Here's the code:
unction main($config)
{
$data = fgets($this->socket, 256);

echo nl2br($data);

flush();

$this->ex = explode(' ', $data);


if($this->ex[0] == 'PING')
{
$this->send_data('PONG', $this->ex[1]); //Plays ping-pong with the server to stay connected.
}

LINE 113 >> $Command = str_replace(array(chr(10), chr(13)), '', $this->ex[3]);

switch($Command) //List of commands the bot responds to from a user.
{
case ':!join':
$this->join_channel($this->ex[4]);
break;
case ':!part':
$this->send_data('PART '.$this->ex[4].' :', 'Wildphp.com Free IRC Bot Script');
break;

case ':!say':
$message = "";
for($i=5; $i <= (count($this->ex)); $i++)
{
$message .= $this->ex[$i]." ";
}

$this->send_data('PRIVMSG '.$this->ex[4].' :', $message);
break;

case ':!restart':
echo "<meta http-equiv=\"refresh\" content=\"5\">";
exit;
case ':!shutdown':
$this->send_data('QUIT', 'Wildphp.com Free IRC Bot Script');
exit;
}

$this->main($config);
}

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 11. July 2016 20:28
by Altrea
Hi,

Debug $this->ex[3].

best wishes,
Altrea

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 12. July 2016 07:16
by DonGolss
Thanks :)

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 12. July 2016 08:43
by DonGolss
I'm sorry but how to debug?
I'm a begginer.
Please help me

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 12. July 2016 08:59
by Altrea
Output the contents of $this->ex with var_dump or print_r
Check if the third key of this array exists and contains the expected value.
If not, debug where the array comes from and debug the source data from this.

Most preferred: Ask the developer of this script to debug this issue.

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 13. July 2016 20:11
by DonGolss
Can u Debug it for me please?
I didn't know how to do it.

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 13. July 2016 20:54
by Altrea
No. I don't have access to your environment and code, log files, etc.
It is your code (or the code of someone else) and we cannot provide any support for third party scripts.
Ask the developer of the script what to do with this issue.

Re: Apached Don't WildPHP Bot not joining Server!

PostPosted: 13. July 2016 21:14
by DonGolss
okay thanks