BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Alreadythere on December 03, 2005, 11:25:18 pm

Title: send_* runs into infinite loop on too large blobs
Post by: Alreadythere on December 03, 2005, 11:25:18 pm
When the blobsize gets too large on sending something, bebot produces infinite loops for me - till the bot crashs.

Looks like this then:
(http://img525.imageshack.us/img525/5294/glitch6cr.jpg) (http://imageshack.us)

Always happens when bebot thinks it needs at least 3 pages.
I think the error is in the cut_size() function in Bot.php - but haven't gotten around to check more exactly yet.
Title: send_* runs into infinite loop on too large blobs
Post by: Wolfbiter on December 04, 2005, 06:32:01 am
You're probably using <br> in the blob. You need to modify the cut_size function in bot.php

Code: [Select]
function cut_size($msg, $type, $to="", $pri=0)
    {
    preg_match("/^(.*)<a href=\"(.+)\">(.*)$/isU", $msg, $info);
    $info[2] = str_replace("<br>","\n",$info[2]);
    $content = explode("\n", $info[2]);
.... (original code past this point)
Title: send_* runs into infinite loop on too large blobs
Post by: Alreadythere on December 04, 2005, 01:51:40 pm
Thanks, worked like a charm.
Title: send_* runs into infinite loop on too large blobs
Post by: Khalem on December 04, 2005, 06:14:54 pm
Comitted to SVN. Thanx.
Title: Re: send_* runs into infinite loop on too large blobs
Post by: Hotshot on September 09, 2006, 02:15:30 pm
Im having trouble seeing where to put this fix, i see the "cut_size" text in the bot.php but im not sure where i put this fix,
"{
         $this -> cut_size($msg, "tell", $to, $low);
         $send = false;
      }"

thats whats in there at the moment, do i replace it with the new coding or what?

Also how do i get it to work on Guildbot?
Title: Re: send_* runs into infinite loop on too large blobs
Post by: Khalem on September 09, 2006, 08:11:51 pm
This fix has been in the bot for almost a year soon, so unless you are running a really really really old version of the bot, it's already in there.

An additional bug in Bot Help was fixed fairly recently.

Regardless, the function cut_size is still in Bot.php, you are just looking at one location where the function is called, not the actual function.
Title: Re: send_* runs into infinite loop on too large blobs
Post by: Hotshot on September 10, 2006, 03:30:59 pm
how come !memberlist doesnt work?
Title: Re: send_* runs into infinite loop on too large blobs
Post by: Khalem on September 21, 2006, 04:59:52 pm
Memberlist is not a part of the core bot, so i can't say.

JJ just pointed out that the fix has somehow managed to be omitted from the 0.2 branch. My apologies for the major oversight.
SimplePortal 2.3.7 © 2008-2024, SimplePortal