BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Khalem on July 29, 2005, 08:25:38 pm

Title: Solution: Bot doesnt listen to org chat
Post by: Khalem on July 29, 2005, 08:25:38 pm
[Edit]

There should no longer be a need to use this workaround. A proper fix has been added to BeBot 0.2.3 and 0.3.x versions.
[/edit]

I finally had time to sit down and look into this problem and traced it back to a problem in AOChat itself.

Open up AOChat.php and find the following code snippit:
Code: [Select]
    function lookup_group($g, $type=0)
    {
      if($type && ($gi = (strlen($g) === 5 && ord($g[0]) < 0x10)))
        return $g;
      if(!$gi)
        $g = strtolower($g);
      return empty($this->gid[$g]) ? false : $this->gid[$g];
    }

Replace it with:
Code: [Select]
    function lookup_group($g, $type=0)
    {
      if($type && ($gi = (strlen($g) === 5 && ord($g[0]) < 0x10)))
        return $g;
      if(!$gi)
        $g2 = strtolower($g);

        if (!empty($this->gid[$g]))
          return $this->gid[$g];
        else if (!empty($this->gid[$g2]))
          return $this->gid[$g2];
        else
          return false;
    }

The double check im doing is probably not needed, but i dont know why strtolower was used in the first place (it wasnt in earlier versions of the AOChat library, hence it wont affect the IGN release thats out for example)
Ive contacted Auno about it but have still yet to hear back.
SimplePortal 2.3.7 © 2008-2024, SimplePortal