BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Akarah on November 27, 2005, 02:57:02 pm

Title: modified alts
Post by: Akarah on November 27, 2005, 02:57:02 pm
this is actually a custom core change, not a module, but i added in a "altadmin" feature, so admins can add alts to mains, when they recruit the alt.

add to the commands array init:
Code: [Select]

  $commands["tell"]["altadmin"] = &$alts;


find this in function tell:
Code: [Select]

      else if (preg_match("/^" . $this -> bot -> commpre . "alts$/i", $msg))
        $this -> bot -> send_tell($name, $this -> show_alt($name, $name));


add this after it, before the final else:
Code: [Select]

      else if (preg_match("/^" . $this -> bot -> commpre . "altadmin add ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> add_altadmin($info[1], $info[2]));
      else if (preg_match("/^" . $this -> bot -> commpre . "altadmin (rem|del) ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> remove_altadmin($info[2], $info[3]));


then, after add_alt and remove_alt functions, add these two:
Code: [Select]

function add_altadmin($main, $alt)
{
  if ((!$this -> bot -> aoc -> get_uid($alt)) || (!$this -> bot -> aoc -> get_uid($main)))
    return "Character <font color=#ffff00>" . $main . "</font> or <font color=#ffff00>" . $alt . "</font> does not exist.";
  else
  {
    $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($main)) . "'");
    $result2 = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' OR main = '" . ucfirst(strtolower($alt)) . "'");
    if (!empty($result))
      return "<font color=#ffff00>" . $main . "</font> is registered as an alt of <font color=#ffff00>" . $result[0][0] . "</font> and cannot have alts registered to it.";
    else if (!empty($result2))
      return "<font color=#ffff00>" . $alt . "</font> already exists in the database.";
    else
    {
      $this -> bot -> db -> query("INSERT INTO alts (alt, main) VALUES
                                  ('" . ucfirst(strtolower($alt)) . "', '" . ucfirst(strtolower($main)) . "')");
      return "<font color=#ffff00>" . $alt . "</font> has been registered to <font color=#ffff00>" . $main . "</font>.";
    }
  }
}

function remove_altadmin($main, $alt)
{
  if ((!$this -> bot -> aoc -> get_uid($alt)) || (!$this -> bot -> aoc -> get_uid($main)))
    return "Character <font color=#ffff00>" . $main . "</font> or <font color=#ffff00>" . $alt . "</font> does not exist.";
  else
  {
    $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' AND main = '" . ucfirst(strtolower($main)) . "'");
    if (empty($result))
      return "<font color=#ffff00>" . $alt . "</font> is not registered to <font color=#ffff00>" . $main . "</font>.";
    else
    {
      $this -> bot -> db -> query("DELETE FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "'");
      return "<font color=#ffff00>" . $alt . "</font> has been removed from the database.";
    }
  }
}


standard disclaimer applies, of course :)
Title: modified alts
Post by: Akarah on November 27, 2005, 03:07:56 pm
this actually depends on custom rights management, as i do not check if $name is actually an admin before sending it to add/remove_altadmin functions. so to use it you'll have to /tell yourbot !commands enable tell altadmin Admin first.

can add these 2 lines to the end of $botdir/help/alts.txt :
Code: [Select]


<font color=CCInfoHeader><pre>altadmin (add|rem) &lt;mainname&gt; &lt;altname&gt;</font>
<font color=CCInfoText>Adds/Removes &lt;altname&gt; to &lt;mainname&gt; (Admin only)


could be redone more foolproof, but ehh :)
Title: Re: modified alts
Post by: Glarawyn on January 19, 2006, 04:47:47 am
Thanks for this mod. I took it a step further.


http://zibby.isa-geek.net/bebot/PointsToMainAlts.zip

This modification is inteded for raidbots with PointsToMain set to on. The default Alts module pretty much allows stealing of raid points using the Alts command. This mod only allows users to view alts. Raidleaders, Admins, and Superadmins are allowed to add/remove alts.

I just borrowed Akarah's code, took out what wasn't needed, added security checks, and called it dun. :)
Title: Re: modified alts
Post by: Xenixa on January 20, 2006, 05:16:06 pm
Problem with this one.
If an admin tries to remove an Alt that is a Deleted character you'll get the "Character <main> or <alt> does not exist." reply.

BTW... check it. My custom version of Alts looks like this:
Title: Re: modified alts
Post by: Glarawyn on January 20, 2006, 06:17:21 pm
Problem with this one.
If an admin tries to remove an Alt that is a Deleted character you'll get the "Character <main> or <alt> does not exist." reply.

To [Campalot]: !alts del Lilredhot Glarawyn
Campalot: Glarawyn is not registered to Lilredhot.
To [Campalot]: !alts del Glarawyn Lilredhot
Campalot: Lilredhot has been removed from the database.

Seems alright... :)

But I see what you mean with the deleted character thing. But that shouldn't be an issue for a raid bot only allowing 190+ characters. :p

I blame Akarah. I just stole Akarah's code and changed the inputs and security around.  :P
Title: Re: modified alts
Post by: Xenixa on January 20, 2006, 11:03:14 pm
Oh, sorry Glara, it was Akarah's code I was refering to.  :o

I fixed it already for my bot by removing the (!$this -> bot -> aoc -> get_uid($alt)) and left the check for Mains name in the remove functions for both altadmin and player. Figured the Database check on alts name was enough. :)
Title: Re: modified alts
Post by: Akarah on January 21, 2006, 02:41:33 pm
yeah i just needed to add altadmin for adding alts, not deleting really..

usually all problems can be solved by a DELETE in mysql anyway ;)
Title: Re: modified alts
Post by: buff on March 23, 2006, 09:30:00 pm
Xenixa:

Do you mind to share out how you did the last seen+alts?
That looks very nice and really hope to have a taste of it also ;)
Title: Re: modified alts
Post by: Xenixa on March 23, 2006, 10:03:22 pm
Sure, you'll need a few things to make it work.

1) My Rooster_GUILD module (Xens_Rooster_GUILD.php)
2) My modified Alts module (Alts.php)

Both can be found on my FTP server here: ftp://xen.afraid.org/bebot_files/
Rename Xens_Rooster_GUILD.php to just Rooster_GUILD.php and place in /modules folder
Place Alts.php in /core folder

That Rooster_GUILD uses a different Members Table layout by the way from the default one. There's a Alter Table statement in the file you can use to adjust it using a MySQL query tool. Should look like this:
Code: [Select]
ALTER TABLE members, DROP COLUMN pic, DROP COLUMN lvlrange, ADD COLUMN lastseen INT(11) DEFAULT '0' NOT NULL after aititle, ADD COLUMN updated INT(11) after lastseen
Should all just snap right in.
You may want to review this thread also incase I missed something here:
http://bebot.link/index.php/topic,288.0.html
Title: Re: modified alts
Post by: buff on March 24, 2006, 04:34:47 am
downloaded and it works nicely
got an error when i do !member <name> command

Incorrected integer value: '' for column 'rank' at row 1

and it won't add member to my memberl in mySQL db :(


also for the last seen if the member never been online after added
i get this error

Out of range value adjusted for column 'lastseen' at row 1
Title: Re: modified alts
Post by: Xenixa on March 24, 2006, 12:33:19 pm
Hmm never seen those occur on mine. What version of MySQL server you running btw? When you set up the Members table did you verify that the it set Default for lastseen column to '0'? That would fix the "Out of range value" error when a member is added but hasn't been seen by the bot yet.

As for the Rank column I forgot I had set it to default to '0' in the Database table directly but didn't update the code that sets up the table. So make sure 'rank' is set as a tinyint(4) and the default is '0'.

P.S. I just tested my Rooster_GUILD code on my test setup with MySQL v5.0.18, PHP v5.1.2.2 and the latest v0.3.2 Bebot Code base(using AOChat v1.19 and the new AOKex.dll extension) with no errors in the console. :)
Title: Re: modified alts
Post by: buff on March 28, 2006, 01:31:05 am
I use new bebot 0.3.2 also but i'm using php4 not php5
I will upgrade to php5 later but right now still on 4 :)

I tweaked your code abit and I am now using lastseen.php code that is posted on forum somewhere with your alts.php file which i modified abit so it's working fine now

I also changed it so it shows the time/date the person last log on

Thanks alot for the original codes and all the help. :)
Title: Re: modified alts
Post by: Xenixa on March 28, 2006, 03:30:04 pm
Resolved these issues in Rooster_GUILD.php see:
 http://bebot.link/index.php/topic,288.msg2041.html#msg2041

Title: Re: modified alts
Post by: Dabaron on August 17, 2006, 10:40:05 pm
I'm using Bebot 3.2.4, MYSQL 5.0.19, and php 4.4.2

I'm getting errors when I put your Alts file in (Your modified rooster file wouldn't update my mysql but I manually made the changes you outlined and that seems to work fine now).  When I use your alts if I do the !alts command I get:
Fatal error: Call to a member function lookup() on a non-object in C:\BeBot\core\Alts.php on line 216

I'm guessing you use the caching thing that was made but I currently don't (couldn't get it to work right).  Is that the case and is what is causing my error or am I off here?  If so how can I mod this to make it work without it?

Nevermind, got the whoiscache working and this works great!!
Title: Re: modified alts
Post by: Dabaron on August 18, 2006, 03:24:56 am
I am now having a strange issue.  It works great on the first call of it, if I try and check someone else it crashes with this error:

Fatal error: Cannot use string offset as an array in C:\BeBot\Beerraid\core\Alts.php on line 233

Any ideas?

Edit: I'm using Xenixa's
Title: Re: modified alts
Post by: jjones666 on August 18, 2006, 08:16:03 am
Be careful using the latest Bebot SVN code with any modules you find on here - a lot of modules here are designed for the Bebot 2.x member table setup etc and simply will not work with the SVN version.

I'm waiting for Khalem to give the green light on 3.x before updating anything (currently using 2.x SVN from around December last year with a few additions and a lot of modules from these pages and have a rock solid stable bot).

Cheers,

-jj-
Title: Re: modified alts
Post by: Dabaron on August 18, 2006, 08:39:56 am
I'm not using SVN code, I'm still in the .2 series not the .3 series   ;)
Title: Re: modified alts
Post by: Naturalistic on August 18, 2006, 05:53:18 pm
Sucks for me, as I started with Bebot 0.2.3 and just re-coded a lot of it. Now, not possible to svn update it :P
Title: Re: modified alts
Post by: jjones666 on August 18, 2006, 06:54:02 pm
Same Naturalistic, damn Xenixa and the other community people for making so many useful mods :-)
Title: Re: modified alts
Post by: Dabaron on August 18, 2006, 07:27:45 pm
Any idea whats causing my error though?  I'm not SVN'd so no clue what it could be.
Title: Re: modified alts
Post by: Khalem on August 18, 2006, 10:48:52 pm
Xen's site appears to be down so i can't look at the source code.

However the error you are getting indicates a missing error check on the MySQL return. It's very common to see this error when the code is not written to handle the event of no return values from the MySQL query, or plain simply a MySQL error.
Title: Re: modified alts
Post by: Dabaron on August 19, 2006, 02:12:29 am
Here is her code for it.

Code: [Select]
<?
  /*
   * Alts.php - Alternative character management
   *
   * BeBot - An Anarchy Online Chat Automaton
   * Copyright (C) 2004 Jonas Jax
   *
   * Developed by Blondengy (RK1)
   * Special thanks goes out to Khalem (RK1) for his support.
   *
   * File last changed at $LastChangedDate: 2004-12-29 01:41:32 +0100 (Wed, 29 Dec 2004) $
   * Revision: $Id: Alts.php 8 2004-12-29 00:41:32Z blondengy $
   *
   * Added altadmin command by Akarah
   * Cleaned up Info view of alts - Xenixa
   */

  /*
  Prepare MySQL database
  */
  $db -> query("CREATE TABLE IF NOT EXISTS alts
        (alt VARCHAR(255) NOT NULL PRIMARY KEY,
        main VARCHAR(255))");



  $alts = new Alts($bot);

  $commands["tell"]["alts"] = &$alts;
  $commands["pgmsg"]["alts"] = &$alts;
  $commands["gc"]["alts"] = &$alts;
  $commands["tell"]["altadmin"] = &$alts;



  /*
    The Class itself...
  */
  class Alts
  {
    var $bot;


    /*
      Constructor:
        Hands over a referance to the "Bot" class.
    */
    function Alts (&$bot)
    {
      $this -> bot = &$bot;
      $this -> bot -> alts = &$this;
      $this -> date_format = 'M j, Y';
    }



    /*
      This gets called on a tell with the command
    */
    function tell($name, $msg)
    {
      if (preg_match("/^" . $this -> bot -> commpre . "alts add (.+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> add_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (rem|del) (.+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> remove_alt($name, $info[2]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (.+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> show_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts$/i", $msg))
        $this -> bot -> send_tell($name, $this -> show_alt($name, $name));
      else if (preg_match("/^" . $this -> bot -> commpre . "altadmin add ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> add_altadmin($info[1], $info[2]));
      else if (preg_match("/^" . $this -> bot -> commpre . "altadmin (rem|del) ([a-zA-Z0-9]+) ([a-zA-Z0-9]+)$/i", $msg, $info))
        $this -> bot -> send_tell($name, $this -> remove_altadmin($info[2], $info[3]));
      else
      $this -> bot -> send_help($name);
    }



    /*
      This gets called on a msg in the privgroup with the command
    */
    function pgmsg($name, $msg)
    {
      if (preg_match("/^" . $this -> bot -> commpre . "alts add (.+)$/i", $msg, $info))
        $this -> bot -> send_pgroup($this -> add_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (rem|del) (.+)$/i", $msg, $info))
        $this -> bot -> send_pgroup($this -> remove_alt($name, $info[2]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (.+)$/i", $msg, $info))
        $this -> bot -> send_pgroup($this -> show_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts$/i", $msg))
        $this -> bot -> send_pgroup($this -> show_alt($name, $name));
    }



    /*
      This gets called on a msg in the guildchat with the command
    */
    function gc($name, $msg)
    {
      if (preg_match("/^" . $this -> bot -> commpre . "alts add (.+)$/i", $msg, $info))
        $this -> bot -> send_gc($this -> add_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (rem|del) (.+)$/i", $msg, $info))
        $this -> bot -> send_gc($this -> remove_alt($name, $info[2]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts (.+)$/i", $msg, $info))
        $this -> bot -> send_gc($this -> show_alt($name, $info[1]));
      else if (preg_match("/^" . $this -> bot -> commpre . "alts$/i", $msg))
        $this -> bot -> send_gc($this -> show_alt($name, $name));
    }


    /*
      Add an alt to your list.
    */
    function add_alt($name, $alt)
    {
      if (!$this -> bot -> aoc -> get_uid($alt))
        return "Character <font color=#ffff00>" . $alt . "</font> does not exist.";
      else
      {
        $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($name)) . "'");
        $result2 = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' OR main = '" . ucfirst(strtolower($alt)) . "'");
        if (!empty($result))
          return "You are registered as an alt of <font color=#ffff00>" . $result[0][0] . "</font> and cannot register alts to yourself.";
        else if (!empty($result2))
          return "<font color=#ffff00>" . $alt . "</font> already exists in the database.";
        else
        {
          $this -> bot -> db -> query("INSERT INTO alts (alt, main) VALUES
                                      ('" . ucfirst(strtolower($alt)) . "', '" . ucfirst(strtolower($name)) . "')");
          return "<font color=#ffff00>" . $alt . "</font> has been registered as your new alt.";
        }
      }
    }


    function add_altadmin($main, $alt)
    {
    if ((!$this -> bot -> aoc -> get_uid($alt)) || (!$this -> bot -> aoc -> get_uid($main)))
    return "Character <font color=#ffff00>" . $main . "</font> or <font color=#ffff00>" . $alt . "</font> does not exist.";
    else
    {
    $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($main)) . "'");
    $result2 = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' OR main = '" . ucfirst(strtolower($alt)) . "'");
    if (!empty($result))
    return "<font color=#ffff00>" . $main . "</font> is registered as an alt of <font color=#ffff00>" . $result[0][0] . "</font> and cannot have alts registered to it.";
    else if (!empty($result2))
    return "<font color=#ffff00>" . $alt . "</font> already exists in the database.";
    else
    {
    $this -> bot -> db -> query("INSERT INTO alts (alt, main) VALUES
                                  ('" . ucfirst(strtolower($alt)) . "', '" . ucfirst(strtolower($main)) . "')");
    return "<font color=#ffff00>" . $alt . "</font> has been registered to <font color=#ffff00>" . $main . "</font>.";
    }
    }
    }


    /*
      Remove an alt from your list.
    */
    function remove_alt($name, $alt)
    {
      if (!$this -> bot -> aoc -> get_uid($alt))
        return "Character <font color=#ffff00>" . $alt . "</font> does not exist.";
      else
      {
        $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' AND main = '" . ucfirst(strtolower($name)) . "'");
        if (empty($result))
          return "<font color=#ffff00>" . $alt . "</font> is not registered as your alt.";
        else
        {
          $this -> bot -> db -> query("DELETE FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "'");
          return "<font color=#ffff00>" . $alt . "</font> has been removed as your alt.";
        }
      }
    }


function remove_altadmin($main, $alt)
{
if ((!$this -> bot -> aoc -> get_uid($alt)) || (!$this -> bot -> aoc -> get_uid($main)))
return "Character <font color=#ffff00>" . $main . "</font> or <font color=#ffff00>" . $alt . "</font> does not exist.";
else
{
$result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "' AND main = '" . ucfirst(strtolower($main)) . "'");
if (empty($result))
return "<font color=#ffff00>" . $alt . "</font> is not registered to <font color=#ffff00>" . $main . "</font>.";
else
{
$this -> bot -> db -> query("DELETE FROM alts WHERE alt = '" . ucfirst(strtolower($alt)) . "'");
return "<font color=#ffff00>" . $alt . "</font> has been removed from the database.";
}
}
}


    /*
      Show mains/alts
    */
    function show_alt($name, $who)
    {
      $main = $this -> main($who);
      $alts = $this -> get_alts($main);
      return $main . "'s alts: " . $this -> make_alt_blob($main, $alts);
    }



    /*
      Return main char
    */
    function make_alt_blob($main, $alts)
    {
      $who = $this -> bot -> whois -> lookup($main);
      $mainlog = $this -> bot -> db -> select("SELECT nickname, lastseen FROM members WHERE nickname = '$main'");
  if ($mainlog[0][1] == 0) $date_m = "This Bot hasn't Seen this character online.";
      else $date_m = gmdate($this -> date_format, $mainlog[0][1]);
      $result = "<font color=CCInfoHeadline>::: ".$who['firstname']." \"$main\" ".$who['lastname']." :::</font>\n\n";
      $result .= "• Level/AL: <font color=CCCCTextColor>".$who['level']." / <font color=#33FF33>".$who['at_name']."(".$who['at'].")</font></font>\n";
      $result .= "• Breed: <font color=CCCCTextColor>".$who['breed']."</font>\n";
      $result .= "• Gender: <font color=CCCCTextColor>".$who['gender']."</font>\n";
      $result .= "• Profession: <font color=CCCCTextColor>".$who['profession']."</font>\n";
      $result .= "• Org Rank: <font color=CCCCTextColor>".$who['rank']."</font>\n\n";
      $result .= "Last Login/out: <font color=#0099FF>$date_m</font>\n\n";
      $result .= "<font color=CCInfoHeadline>::: " . $main . "'s Alts :::</font>\n";
      $result .= "----------------------------------\n";
      if (!empty($alts))
        foreach ($alts as $alt)
        {
          $whoalt = $this -> bot -> db -> select("SELECT nickname, rank_name, lastseen FROM members WHERE nickname = '$alt'");
          if ($whoalt[0][2] == 0) $date = "Never";
          else $date = gmdate($this -> date_format, $whoalt[0][2]);
          if (empty($whoalt[0][0])) $rank = "None";
          else $rank = $whoalt[0][1];
          $result .= "• <font color=CCCCTextColor><a href='chatcmd:///tell <botname> <pre>whois $alt'>$alt</a></font>";
          $result .= " (".$rank.") <font color=#0099FF>Last Seen: $date</font>\n";
        }
      else
        return "No alts found.";
      return $this -> bot -> make_blob("View Alts", $result);
    }



    /*
      Return main char
    */
    function main($char)
    {
    $char = $this -> bot -> aoc -> get_uname($char);
      $result = $this -> bot -> db -> select("SELECT main FROM alts WHERE alt = '" . ucfirst(strtolower($char)) . "'");
      if (empty($result))
        return ucfirst(strtolower($char));
      else
        return $result[0][0];
    }



    /*
      Return array of alts
    */
    function get_alts($char)
    {
    $char = $this -> bot -> aoc -> get_uname($char);
      $result = $this -> bot -> db -> select("SELECT alt FROM alts WHERE main = '" . ucfirst(strtolower($char)) . "' ORDER BY alt ASC");
      $ret = array();

      if (!empty($result))
        foreach ($result as $res)
          $ret[] = $res[0];

      return $ret;
    }
  }
?>
Title: Re: modified alts
Post by: Khalem on August 19, 2006, 08:05:15 am
Replace make_alt_blob with the following code:
Code: [Select]
    function make_alt_blob($main, $alts)
    {
  $date = "Never";
  $rank = "None";
      $who = $this -> bot -> whois -> lookup($main);
      $mainlog = $this -> bot -> db -> select("SELECT nickname, lastseen FROM members WHERE nickname = '$main'");
  if ($mainlog[0][1] == 0) $date_m = "This Bot hasn't Seen this character online.";
      else $date_m = gmdate($this -> date_format, $mainlog[0][1]);
      $result = "<font color=CCInfoHeadline>::: ".$who['firstname']." \"$main\" ".$who['lastname']." :::</font>\n\n";
      $result .= "• Level/AL: <font color=CCCCTextColor>".$who['level']." / <font color=#33FF33>".$who['at_name']."(".$who['at'].")</font></font>\n";
      $result .= "• Breed: <font color=CCCCTextColor>".$who['breed']."</font>\n";
      $result .= "• Gender: <font color=CCCCTextColor>".$who['gender']."</font>\n";
      $result .= "• Profession: <font color=CCCCTextColor>".$who['profession']."</font>\n";
      $result .= "• Org Rank: <font color=CCCCTextColor>".$who['rank']."</font>\n\n";
      $result .= "Last Login/out: <font color=#0099FF>$date_m</font>\n\n";
      $result .= "<font color=CCInfoHeadline>::: " . $main . "'s Alts :::</font>\n";
      $result .= "----------------------------------\n";
      if (!empty($alts))
        foreach ($alts as $alt)
        {
          $whoalt = $this -> bot -> db -> select("SELECT nickname, rank_name, lastseen FROM members WHERE nickname = '$alt'");
  if (!empty($whoalt))
  {
if ($whoalt[0][2] == 0) $date = "Never";
else $date = gmdate($this -> date_format, $whoalt[0][2]);
if (empty($whoalt[0][0])) $rank = "None";
else $rank = $whoalt[0][1];
  }
          $result .= "• <font color=CCCCTextColor><a href='chatcmd:///tell <botname> <pre>whois $alt'>$alt</a></font>";
          $result .= " (".$rank.") <font color=#0099FF>Last Seen: $date</font>\n";
        }
      else
        return "No alts found.";
      return $this -> bot -> make_blob("View Alts", $result);
    }
Title: Re: modified alts
Post by: Ainen on August 19, 2006, 06:29:41 pm
I tried to plug that fix into the given alts.php on my bot and got this:
PHP Fatal error:  Call to a member function on a non-object in /home/pcm/BeBot3/core/Alts.php on line 218

This being the guilty line in function make_alt_blob:
$who = $this -> bot -> whois -> lookup($main);
Title: Re: modified alts
Post by: Dabaron on August 20, 2006, 01:10:03 am
Do you have the WhoisCache thing setup?  Your error looks like it has to do with a reference to that.  Instead of doing a direct query to FC servers to get the data it checks your MySQL server first.  Without that setup it can't do that.

And I'll try the mod that you suggested Khalem and let you guys know how it goes.
Title: Re: modified alts
Post by: Dabaron on August 20, 2006, 10:27:21 am
Worked like a charm... just don't make teh mistake of trying to lookup an alt of someone that isn't a member or it still dies.  No biggie though.
Title: Re: modified alts
Post by: Khalem on August 20, 2006, 11:59:19 am
Code: [Select]
      $mainlog = $this -> bot -> db -> select("SELECT nickname, lastseen FROM members WHERE nickname = '$main'");
  if ($mainlog[0][1] == 0) $date_m = "This Bot hasn't Seen this character online.";
      else $date_m = gmdate($this -> date_format, $mainlog[0][1]);

Change to:

Code: [Select]
      $date_m = "This Bot hasn't Seen this character online.";
      $mainlog = $this -> bot -> db -> select("SELECT nickname, lastseen FROM members WHERE nickname = '$main'");
      if (!empty($mainlog[0][1]))
      {
         if ($mainlog[0][1] != 0)
         {
            $date_m = gmdate($this -> date_format, $mainlog[0][1]);
          }
       }
Title: Re: modified alts
Post by: Dabaron on August 21, 2006, 09:57:48 am
Very cool, works perfectly now.   Thanks Khalem.  One last question, anyone know how to get this to show in the logon announcement (the alts part) and have it use this modified version?
Title: Re: modified alts
Post by: Dabaron on August 22, 2006, 01:56:57 am
Ok, I was wrong... that only semi-fixed it.  Now it does say that there are no alts found if its a non-org member, but if I do an alts on someone that is in org but has an alt that has never been seen it crashes it with:
Fatal error: Cannot use string offset in array in C:\BeBot\Beerraid\core\Alts.php on line 239

As far as the alts thing I have it semi-figured out.  I can get it to show the "Alts" in the string but it isn't clickable.  Been trying to compare with code in the Online.php module but just can't quite get it working.
Title: Re: modified alts
Post by: Khalem on August 22, 2006, 05:51:03 am
Could you post line 239 in your version along with a few lines of code leading up to and following line 239?
Title: Re: modified alts
Post by: Dabaron on August 22, 2006, 07:40:26 am
Code: [Select]
      if (!empty($alts))
        foreach ($alts as $alt)
        {
          $whoalt = $this -> bot -> db -> select("SELECT nickname, rank_name, lastseen FROM members WHERE nickname = '$alt'");
          if ($whoalt[0][2] == 0) $date = "Never";
          else $date = gmdate($this -> date_format, $whoalt[0][2]);
          if (empty($whoalt[0][0])) $rank = "None";
          else $rank = $whoalt[0][1];
          $result .= "• <font color=CCCCTextColor><a href='chatcmd:///tell <botname> <pre>whois $alt'>$alt</a></font>";
          $result .= " (".$rank.") <font color=#0099FF>Last Seen: $date</font>\n";
        }
      else
        return "No alts found.";
      return $this -> bot -> make_blob("View Alts", $result);

This one is line 239:
Code: [Select]
if ($whoalt[0][2] == 0) $date = "Never";
Title: Re: modified alts
Post by: Khalem on August 22, 2006, 11:20:21 am
Hrm.
Try this, find:
Code: [Select]
          $whoalt = $this -> bot -> db -> select("SELECT nickname, rank_name, lastseen FROM members WHERE nickname = '$alt'");
          if ($whoalt[0][2] == 0) $date = "Never";
          else $date = gmdate($this -> date_format, $whoalt[0][2]);
          if (empty($whoalt[0][0])) $rank = "None";
          else $rank = $whoalt[0][1];

Replace with:
Code: [Select]
          $date = "Never";
          $rank = "None";
          $whoalt = $this -> bot -> db -> select("SELECT nickname, rank_name, lastseen FROM members WHERE nickname = '$alt'");
          if (!empty($whoalt))
          {
            if (!empty($whoalt[0][2]))
            {
              $date = gmdate($this -> date_format, $whoalt[0][2]);
            }
            if (!empty($whoalt[0][0]))
            {
               $rank = $whoalt[0][1];
            }
          }
Title: Re: modified alts
Post by: Dabaron on August 30, 2006, 09:03:18 am
Just realized I never posted an update.  With both changes that Khalem suggested this works perfectly.  Thank you very much!!
Title: Re: modified alts
Post by: Xenixa on September 03, 2006, 01:56:44 am
I am now having a strange issue.  It works great on the first call of it, if I try and check someone else it crashes with this error:

Fatal error: Cannot use string offset as an array in C:\BeBot\Beerraid\core\Alts.php on line 233

Any ideas?

Edit: I'm using Xenixa's

I see Khalem helped you out already with this. BTW I had fixed this problem back in May. I forgot to update the copy on my ftp server that was placed there in March, sorry. I took a slightly different route than what Khalem did for fixing it however. But it works. :)

You can find my most current(fixed) version on my server BTW using the same link I have posted here earlier. If you care to compare that is.
Title: Re: modified alts
Post by: neongen on September 20, 2006, 04:56:28 pm
Xenixa isent there any way your alts list can be used on a raid bot?

oki i just played a little with it think i got close but it's not nice codeing  ::)

http://bebot.dyndns.dk (http://bebot.dyndns.dk)
Title: Re: modified alts
Post by: neongen on September 21, 2006, 05:51:05 pm
oki can someone help me out a little plz

i'm trying to put in a online in my alts


Code: [Select]
if (!empty($alts))
foreach ($alts as $alt)
{
if ($this -> bot -> aoc -> buddy_online($alt))
$online2 .= " is <font color=#00ff00>online</font>";
else
$online2 .= " is <font color=#ff0000>offline</font>";

$result .= "• <font color=CCCCTextColor><a href='chatcmd:///tell <botname> <pre>whois $alt'>$alt</a></font>";
$result .= "".$online2."\n";

}
else
return "No alts found.";

but with this code i get

toon is offline
toon is offline is online

how do i do so it don't post the is offline the hole way down the alt list?
Title: Re: modified alts
Post by: Alreadythere on September 21, 2006, 08:49:14 pm
change
Code: [Select]
if ($this -> bot -> aoc -> buddy_online($alt))
$online2 .= " is <font color=#00ff00>online</font>";
else
$online2 .= " is <font color=#ff0000>offline</font>";
to
Code: [Select]
if ($this -> bot -> aoc -> buddy_online($alt))
$online2 = " is <font color=#00ff00>online</font>";
else
$online2 = " is <font color=#ff0000>offline</font>";

Only change is the switch from .= to =, as you aren't reinitializing $online2 you would produce endless strings otherwise.
Title: Re: modified alts
Post by: Dabaron on September 21, 2006, 09:11:45 pm
oki can someone help me out a little plz

i'm trying to put in a online in my alts


Code: [Select]
if (!empty($alts))
foreach ($alts as $alt)
{
if ($this -> bot -> aoc -> buddy_online($alt))
$online2 .= " is <font color=#00ff00>online</font>";
else
$online2 .= " is <font color=#ff0000>offline</font>";

$result .= "• <font color=CCCCTextColor><a href='chatcmd:///tell <botname> <pre>whois $alt'>$alt</a></font>";
$result .= "".$online2."\n";

}
else
return "No alts found.";

but with this code i get

toon is offline
toon is offline is online

how do i do so it don't post the is offline the hole way down the alt list?

Once you have this working can you post a copy of it here.  I wouldn't mind looking at your full code   ;)
Title: Re: modified alts
Post by: neongen on September 21, 2006, 11:46:11 pm
oki just put in the modifications. thx Alreadythere it works now  ;D

they are on http://bebot.dyndns.dk (http://bebot.dyndns.dk) here you can download the alts and whois with the modifications. but the pic is not the rigth on.

the is online is placed:

::: Zero "Neongen" Angel ::: is (offline|online)

and

• Neonenfo is (offline|online)
Title: Re: modified alts
Post by: neongen on September 26, 2006, 02:43:01 pm
Just made a little update on my alts and whois.
here is a pic of it here (http://85.82.216.42/bebot/alts.jpg)

you need 3 files for it to work alts (http://85.82.216.42/bebot/download/alts.phps), whois (http://85.82.216.42/bebot/download/whois.phps) and lastvisit (http://85.82.216.42/bebot/download/lastvisit.phps)

or you can download them as a zip here (http://85.82.216.42/bebot/download/altswhoislast.zip)

but for it to work people have to join the bot for it to get the last visit!
Title: Re: modified alts
Post by: Dabaron on September 26, 2006, 07:25:49 pm
Not bad, I do like it.  Not using the whois cache though huh
Title: Re: modified alts
Post by: neongen on September 27, 2006, 11:40:13 am
uups  ;D

you don't need the whois for it to work. i only use it because it have alts and postit on the whois
Title: Re: modified alts
Post by: jjones666 on September 27, 2006, 08:37:05 pm
- updates (guildbot specific):

http://www.jjones.co.uk/files/whois2.php (rename to whois.php)
http://www.jjones.co.uk/files/logon_guild.php
http://www.jjones.co.uk/files/alts.php

- added Xenixa style !alts to guild logon display and !whois
- updated alts info to be more specific to guild bot (obviously alts outside org won't have last seen time)
- added online/offline status to alts info
- alts.php includes Khalem's fixes in the last few pages

- required: Alreadythere's Whoiscache (http://bebot.link/index.php/topic,223.0.html)
- required: Blacklist module (original or http://bebot.link/index.php/topic,496.0.html)
- required: Xenixa's Rooster_Guild module with integrated last seen (http://bebot.link/index.php/topic,288.0.html)

- notes: !whois built on version here (http://bebot.link/index.php/topic,314.0.html) includes fixes for blacklist and Glara's !postit features.
Title: Re: modified alts
Post by: Dabaron on September 28, 2006, 08:52:36 am
Love the updates.  Very very nice additions!!
Title: Re: modified alts
Post by: jjones666 on September 28, 2006, 09:02:43 am
- small cosmetic fix to alts.php (added main to the clicky).

(above link applies).

-jj-
Title: Re: modified alts
Post by: jjones666 on October 13, 2006, 01:06:27 am
- again small cosmetic fixes to alts.php

(above link applies).

-jj-
Title: Re: modified alts
Post by: jjones666 on October 15, 2006, 03:28:18 am
- again cosmetic fixes to alts.php:

(last seen online details will not show for people not in org,
online/offline will not show for people not on buddy list, i.e. works for guests too)

- fix for whois.php:

(!postit view <player> now works as intended)

http://www.jjones.co.uk/files/alts.php
http://www.jjones.co.uk/files/whois2.php (rename to whois.php)

Title: Re: modified alts
Post by: Malosar on October 17, 2006, 01:24:34 am
Just upgraded my bot to the alts and of course had to make the Roster changes as well. All worked great, and looks fantastic, thankyou.

Also if people switch to the Roster with builtin lastseen and want to keep all their timestamps and aren't mysql savvy, here's a command to move them over:

update members,last_seen set members.lastseen = last_seen.timestamp where members.nickname = last_seen.player;
Title: Re: modified alts
Post by: jjones666 on October 17, 2006, 01:48:36 am
All credit to Xenixa who did the main work :-)  Btw, if you look on the last page of the Rooster_Guild update, there are some updates (again Xenixa's work that I changed a little) for autoinvite which work very well also, it only invites guests and not members (the original distributed module was somewhat bugged - I'm not sure if it still is).  Kinda useful if guildies have alts in other orgs or farm orgs with a notification in GC (linked to the alts table) of who is auto invited.

Glad you liked the setup.

Cheers,

-jj-
Title: Re: modified alts
Post by: neongen on October 22, 2006, 12:03:36 am
hmmm where is the files? can't get them :(
Title: Re: modified alts
Post by: jjones666 on October 22, 2006, 02:17:22 am
appear to have problem with the domain name.

http://jjones.kicks-ass.net/files/alts.php

should work in the meantime :)
Title: Re: modified alts
Post by: neongen on October 23, 2006, 07:34:13 pm
thx alot  :)
Title: Re: modified alts
Post by: jjones666 on December 17, 2006, 04:06:41 pm
rest of links
(http://bebot.link/index.php/topic,204.msg3369.html#msg3369)

- fix for whois.php

(!postit view <player> returned a blank line, instead of remarking that no record exists.)

http://www.jjones.co.uk/files/whois2.php (rename to whois.php)
Title: Re: modified alts
Post by: taconis on December 28, 2006, 07:49:19 pm
Ok.  I updated my alts.php, whois.php, and lastseen.php per this thread.  When restarting the bot I get


Fatal error: Cannot redeclare class alts in C:\BeBot\modules\Alts.php on line 32

I'm attaching a copy of the alts.php for assistance.  Please keep in mind that I'm using this on my bot which is setup as a raidbot (2.10, mysql 5, php 5.1.45? or whatever came with bebot).
Title: Re: modified alts
Post by: Malosar on December 28, 2006, 08:43:00 pm
It means it's already loading an existing Alts module. The Alts.php usually sits in the /core folder, so check there. Most likely all you need to do is move your Alts.php from the /module to /core and overwrite the existing one in /core.
Title: Re: modified alts
Post by: taconis on December 28, 2006, 11:10:18 pm
Ok.  Removed all alts.php from /modules directory.  The bot starts but when I go do any alt related command or whois, the bot shuts down and starts back up.  I take this means the bot is getting a null return.  Think this is because it's a raidbot and not a guildbot, and the fact that rooster_guild.php doesn't point to the org?  And if so, how does one institute rooster_guild.php?  Cause when I do try php'ing the rooster_guild with bot shut down, it says couldn't open the input file.  Sorry if I'm asking stupid questions, but BeBot is new to me and I'm still learning the intricacies of it.
Title: Re: modified alts
Post by: Malosar on December 29, 2006, 12:00:03 am
Shouldn't you be using Rooster_RAID? Also make sure there is a Alts.php in the core folder, and it should be the new one as you mentioned you were trying to do. If you just deleted the new Alts.php from your modules, then the core/Alts.php is an old one?
Title: Re: modified alts
Post by: taconis on December 29, 2006, 06:16:50 am
The alts file is taken care of by simply deleting it out of /modules.  I'll have to find a rooster_raid and give that a go.
Title: Re: modified alts
Post by: jjones666 on December 29, 2006, 01:36:02 pm
Hmm, I do have a modified version of the !alts for use with raidbots, I don't think I ever posted it tho.  As far as I remember, I hacked the lastseen code support into the rooster_raid (which is also hacked to pieces to use 100% the whois cache for the adding and updating of members).  Didn't post it due to the fact i'd changed the rooster file itself so much.  I have no issue to post if people need.

@taconis:
Btw, referring to one of the previous messages, you should use Xenixa's rooster_guild for the orgbot version, this has integrated last seen (hence you don't need seperate lastseen.php).  You can choose not to use Xenixa's rooster version but I suggest it as it fixes other issues.

-jj-
Title: Re: modified alts
Post by: taconis on December 29, 2006, 05:12:01 pm
jj,

The funny thing is I'm using my Tacnet as a testbed before the great Mew applies it to Wolfnet.  Yes, Tacnet is a raidbot and Wolfnet is a guildbot but there are much similarities.  I don't mind borking my version because, well, I hardly use it.

So...... To bring this thread back totally on topic, and for all those individuals like myself who don't speak MySQL and PHP daily (please correct me if I'm wrong).......

To put in !altadmin into your Guild Bot, you need the following:

http://jjones.kicks-ass.net/files/alts.php (goes into botdir/core)
http://www.jjones.co.uk/files/whois2.php (renamed to whois.php and goes into botdir/modules)
http://bebot.link/index.php/topic,288.msg2041.html#msg2041 (rooster_GUILD.php by Xenia)
http://bebot.link/index.php/topic,223.0.html (WhoisCache.php)

To put in !altadmin into your Raid Bot, you need the following:

http://jjones.kicks-ass.net/files/alts.php (goes into botdir/core)
http://www.jjones.co.uk/files/whois2.php (renamed to whois.php and goes into botdir/modules)
rooster_GUILD
http://bebot.link/index.php/topic,223.0.html (WhoisCache.php)

I would like to make a few simple requests to all you developers here (and the hosters of this site)...

a) Please, in each bot forum section, have a moderated, stickied forum for everything version 2, everything version 3, etc. that everyone is using so that folks can find things;

e.g. BeBot>Forum>Version 2>2.10>Modules>Guild Bots
{thread}  Here is the latest and greatest for your guild bot.  Make sure you _ those modules you don't want loaded...  alts.php (botdir/core), whois.php (botdir/modules), blah, blah, blah

b) Continue the great work!   I don't think anyone can express what you are doing for the AO community.  Without your hard work and dedication, AO wouldn't still be around.
Title: Re: modified alts
Post by: Naturalistic on December 29, 2006, 06:10:42 pm
After the holidays and stuff...it can be cleaned up. Right now, you'll just have to be patient :P
Title: Re: modified alts
Post by: Khalem on December 29, 2006, 06:19:43 pm
We probably should split modules forum into branches anyways.
Title: Re: modified alts
Post by: jjones666 on December 30, 2006, 10:51:29 am
@taconis:

I wouldn't suggest to use rooster_guild in a raidbot type setup as a lot of the functionality is un-needed (ie. updating roster from guild XML on connect).  Also the wording I used in the alts for guildbots kinda doesn't make sense for a raidbot.  Basically, i just integrated the lastseen code into the raidbot roster and modified the alts code to suit.

EDIT:
I forgot I left the raidbot draft setup on my webserver, ignore the .conf settings, these are fake and were a joke directed at Tojejedno (RK1 people love Klingons!).

Try these and let me know how they work:
http://www.jjones.co.uk/files/uprraid/core/alts.php
http://www.jjones.co.uk/files/uprraid/modules/Roster_RAID.php

Notes:
- Please delete or amend line 341 to remove the debug code (ie, sending me a tell every time info is updated).
- Changes to DB structure on first run should be done automatically using the info contained in lines 34-36 (please comment these out after first running).
- !updateroster YES in tell to the bot will sychronise the member table with the entries in the whois cache.  You don't ever need to use this feature, otherwise the member table will update whenever people logon and if their data is more than 3 days old, as previously.
- caveat emptor - this code may not be the most effective technology and hasn't been tested 100% - let me know if any bugs :)
- Not running whois cache for raidbot, then this won't work!  Would also suggest to use one cache database for both raidbot and orgbot.

I'll tidy up code and post proper versions after holiday.


@khalem:

Regarding cleaning the forum up, as I don't contribute to the coding directly, I can volunteer to help here.  I was thinking the same thing regarding confusing threads etc.

-jj-
Title: Re: modified alts
Post by: pusikas on January 18, 2007, 04:08:07 pm
How do you set up two bots so they share a table? The whois table in this case? I am not native to mysql... does it have something similar to synonyms in oracle? :)
If you use a seperate raidbot for an org, I could imagine sharing a lot more tables than only whois. The alts table and raidpoints, local items database... actually most tables would make sense to be shared, wouldn't they?
Title: Re: modified alts
Post by: jjones666 on January 18, 2007, 04:14:18 pm
Heya,

The structure is database.table in the SQL reference, for example create a seperate database called cache, change ALL the SQL references from cache to cache.whois in the whois-cache PHP and it'll work fine.

See enclosed example: http://www.jjones.co.uk/files/uprraid/modules/whoiscache.php

We have alts, whois cache, quotes, items, symbs shared between our 3 bots.

The only problem is on module upgrades, you need to remember u're not using standard database structure ;-)

-jj-
Title: Re: modified alts
Post by: Malosar on January 18, 2007, 04:39:01 pm
Or have it check the main org bots db instead of creating a 3rd db. I have my raidbot check my orgbots whoiscache, membertable, items, symbs etc

Where it references whois, just change it to orgbotdb.whois (obviously replacing orgbotdb with the name of the database the org bot runs on).
Title: Re: modified alts
Post by: Alreadythere on January 18, 2007, 07:25:58 pm
You could go and backport the 0.3 MySQL.php (actually I think you could just use it without changes) and add the names for mastertable and suffix to the MySQL.php. Then you could add #___ (3 slashes) as suffix to each tablename and setup a structure in one database. Would even be compatible to 0.3.
Title: Re: modified alts
Post by: pusikas on January 18, 2007, 10:43:15 pm
Hmmmmmmm.... I may just do that. Not today, but mebbe I find the time this weekend. :)
Title: Re: modified alts
Post by: jjones666 on February 11, 2007, 11:19:00 pm
- updates (guildbot specific):

http://www.jjones.co.uk/files/whois2.php (rename to whois.php)
http://www.jjones.co.uk/files/logon_guild.php
http://www.jjones.co.uk/files/alts.php

- notes: !whois built on version here (http://bebot.link/index.php/topic,314.0.html) includes fixes for blacklist and Glara's !postit features.

- added !postit search to search contributors and player information for your searchterm (code based on Glara's updated Quotes module).

http://www.jjones.co.uk/files/whois2.php (rename to whois.php)
Title: Re: modified alts
Post by: jjones666 on March 29, 2007, 12:36:34 am
!alts updated:

- checks if user exists before processing main loop (no idea why this wasn't there before).
- will post to GC if entries in table are for deleted toons on any call to !alts (configurable).
- now shows level, ai level, rank, org for people outside of org and guestlist.
- online status will now show correctly for people on guestlist or in org.
- !altadmin check (tell only) will verify there are no duplicate characters/deleted characters in the alt database (we have 1255 alts logged from Vhanet plus other sources, so this is prolly something useful only to me). :-)

Because the option to warning on junk is configurable you now need Glara's Module Settings plugin!

Warning: because this is a core module and the module settings plugin is set to load AFTER the alts module, you need to rename ModuleSettings.php to 1ModuleSettings.php to ensure it loads first otherwise the module will crash...  There is a better fix but this should work for the time being ;-p

http://www.jjones.co.uk/files/alts.php - people wishing the old version can download alts_old.php

-jj-
Title: Re: modified alts
Post by: pusikas on March 31, 2007, 06:47:03 pm
- online status will now show correctly for people on guestlist or in org.

Online status does not show for out-of-org alts on guestlist. I checked, they are on the bot's buddylist.
Title: Re: modified alts
Post by: jjones666 on March 31, 2007, 09:51:09 pm
Oops, redownload and let me know if that works for u ;-p

-jj-
Title: Re: modified alts
Post by: pusikas on April 01, 2007, 05:30:17 pm
OK, much better, just one small thing... if the main is not in org, but on the guestlist (and so are some of his alts), and you do !alts <name of main>, then you see the onlince status of all his alts on guestlist, but not of the main. :) That was prolly the most complicated way possible to explain it, sorry. ^^
Title: Re: modified alts
Post by: jjones666 on April 01, 2007, 10:15:13 pm
Double check the person is in buddy list.  I had similar issue where people were in guestlist but not on buddy list.  The code is already there to differentiate online/offline mains.

I guess I'll just add a !sync to the guestlist so it makes sure to add all buddies.

-jj-
Title: Re: modified alts
Post by: pusikas on April 02, 2007, 07:36:08 pm
This bot is kinda moody when it comes to guests. Example: A is in org and has his alt B (out-of-org) on !guest. I restart the bot. B is logged on, and gets listed as
Code: [Select]
[BUDDY] [LOG]   B logged [on] (guest)Still, !alts shows B as offline. I restart the bot, and B is not listed among the "logged on" anymore. So I check if that is true:
Code: [Select]
[2007-04-02 17:31:21]   [TELL]  [INC]   Luuv: !is B
[2007-04-02 17:31:22]   [BUDDY] [LOG]   B logged [on] (guest)
[2007-04-02 17:31:22]   [TELL]  [OUT]   -> Luuv: B is online
If I try Molasar's !is from http://bebot.link/index.php/topic,514.0.html (http://bebot.link/index.php/topic,514.0.html) on A, I get:
Code: [Select]
A and his/her alts are offline
Uhm... I guess there is a prob with my bot, not with this module. I just have no clue what it is.  :o

Edit: just saw what happens if I try !is again:
Code: [Select]
[2007-04-02 17:38:37]   [TELL]  [INC]   Luuv: !is B A
[2007-04-02 17:38:37]   [TELL]  [OUT]   -> Luuv: A and his/her alts are offline
[2007-04-02 17:38:37]   [BUDDY] [ERROR] B logged on despite of already being marked as logged on!!
Title: Re: modified alts
Post by: jjones666 on April 02, 2007, 09:07:57 pm
Try remove the guest (!guest del) and readd, worked in my case :-)

-jj-
Title: Re: modified alts
Post by: pusikas on April 02, 2007, 10:29:01 pm
Code: [Select]
[2007-04-02 20:22:15]   [TELL]  [INC]   Spamheal: !guest del B
[2007-04-02 20:22:15]   [BUDDY] [DEL]   B
[2007-04-02 20:22:15]   [TELL]  [OUT]   -> Spamheal: B has been removed from guestlist.
[2007-04-02 20:22:32]   [TELL]  [INC]   Spamheal: !guest B
[2007-04-02 20:22:32]   [BUDDY] [ADD]   B
[2007-04-02 20:22:32]   [TELL]  [OUT]   -> Spamheal: B has been added to guestlist.
[2007-04-02 20:22:32]   [BUDDY] [LOG]   B logged [on] (guest)
[2007-04-02 20:22:39]   [TELL]  [INC]   Spamheal: !alts A
[2007-04-02 20:22:40]   [TELL]  [OUT]   -> Spamheal: Alts :: [link]View A's Alts[/link]
Alt list shows the toon as offline. It is the only alt on guestlist, and the only alt that shows as offline - the others do not have a status. (since they are not on guestlist)
Code: [Select]
[2007-04-02 20:22:53]   [TELL]  [INC]   Spamheal: !is A
[2007-04-02 20:22:53]   [TELL]  [OUT]   -> Spamheal: A and his/her alts are offline
[2007-04-02 20:27:47]   [TELL]  [INC]   Spamheal: !is B
[2007-04-02 20:27:47]   [BUDDY] [ERROR] B logged on despite of already being marked as logged on!!
[2007-04-02 20:28:04]   [TELL]  [INC]   Spamheal: !is B
[2007-04-02 20:28:04]   [TELL]  [OUT]   -> Spamheal: B is online

I am kinda clueless atm... and the bot really seems to have a bad day. It set my character ID to 0 today, which resulted in the bot crashing each time I logged on. Mebbe the whole machine just needs a hard kick in the butt.
Title: Re: modified alts
Post by: jjones666 on April 02, 2007, 10:47:45 pm
It definately shows the main as OFFLINE?

   if ($this -> bot -> aoc -> buddy_exists($main))
   {
      if ($this -> bot -> aoc -> buddy_online($main))
         $result .= "Online Status: <font color=#33FF33>Online</font>\n";
      else
         $result .= "Online Status: <font color=#ff0000>Offline</font>\n";
   }

See if the buddy isn't found, the code shouldn't show anything.  Its just bizarre that its finding the buddy but showing it offline when it is actually online :-)

Same for the alts list, it checks if the alt is on memberlist then guestlist and then shows on/offline status only if so.

We did have some weird issues on Zodsnet where Maical sent the bot into infinite loop due to the buddy list (even in game one) just constantly logging on and off ;-p

-jj-
Title: Re: modified alts
Post by: pusikas on April 03, 2007, 12:16:39 pm
The main (in org) was offline, and correctly showed that way. The alt (out of org) was online and on guestlist, but both, your !alts command and Malosar's !is command had serious trouble with that alt. Two days ago, it all worked for me, and I only had this slight glitch that a main that was not in org did not correctly show as online. But his status did not show at all - guess that was just a problem with him not being on buddylist. Easy to fix, just removed and added him to guestlist. Now, since yesterday, I am having the strangest of problems with everyone that is on buddylist but not in org - guests namely. And from what I can tell, your code looks good. I never really understood the code in the !is modules, since to me it always looked like a buddy was added, but never removed. But your !alts code looks good to me.

I may be completely wrong, but I think the buddy commands are not working correctly for me. So this is not a real problem with your module anymore, but the base commands, and I am actually posting in the wrong thread. Will try to somehow pinpoint it.
SimplePortal 2.3.7 © 2008-2024, SimplePortal