Archive > AO 0.6 support

Server merge!

<< < (3/6) > >>

Ezzii:
Yes Mawerick, probably you are right but I went forward with the extra spacing of the array to try to eliminate all possible pitfalls of not being intimately familiar with this code.

 -- Ezzii

Ezzii:
Part IV   Part V

* If the real developers want to step in at any moment and make the clean changes then please do.  I won't be offended at all.  -- until then here is my hacking.

Although the bot can now log into the chat server side, at this point the Roster update had been failing.

Someone posted that the PoRK look up dimension is not really 5 but still 1 now.  For us in Shadow Company -- I'm not sure of old RK2 orgs having been merged but I'm guessing they are same as us and do PoRK lookups using '1'.

Part IV
--------
With your bot not running, change the table named scbot_users to scbot_users_orig
this will allow your bot to make a new clean empty user table in its rosterupdate,
plus you get to have a back up of the original.  :)

You need your mysql username for your BeBot and respective password.

mysql session below:
[scbot is the prefix/name of my bot so yours will be different in that respect. :p
 do show tables; to figure out your exact *_users table name ;)  ]

** AGAIN! DO NOT use the instructions below with scbot verbage you need your own bot name
** see above.


--- Code: ---Ez@omni-sc ~/scbot/main $ mysql -h localhost -u scbot -p

         <you'll be prompted for your password, type'y type'y>
mysql>
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| scbase             |
| test               |
+--------------------+
3 rows in set (0.13 sec)

mysql>
mysql> use scbase;
mysql> SHOW TABLES;

| scbot_users                |

mysql> rename table scbot_users to scbot_users_orig;

mysql> SHOW TABLES;

| scbot_users_orig           |

mysql> exit;

Ez@omni-sc ~/scbot/main $
--- End code ---


Part V
-------
For this Part you need your new Org ID.  Ours is 4670 but yours better be differnt.  :)

So look it up.

They changed org ID's last nite on PoRK.  Ours was longer.  One good way to look it up is
goto http://people.anarchy-online.com/character/bio/d/1/name/YourToonNameAllLowerCase
(* you really have to change this URL ... the last part to your toons name in lower case)
then click your org name, then scroll to the bottom and click " XML version of this membership roster,"
then scroll back up to top and find your org ID in the XML tags.  :p  <id>4670</id>

On with the file modding:
Change the BeBot/main/10_Roster.php file here around line 316 to be like this:


--- Code: ---        // Get the guild roster
        if ($this->bot->game == "ao") {
            $dimension = $this->bot->dimension;
            switch (strtolower($dimension)) {
            case "testlive":
                $dimension = "0";
                break;
            case "atlantean";
                $dimension = "1";
                break;
            case "rimor":
                $dimension = "2";
                break;
            case "die neue welt":
                $dimension = "3";
                break;
            case "rubi-ka";           // Addded by Ezzii
                $dimension = "5";    //
                break;              //
            }
            $members = $this->parse_org($dimension, $this->bot->guildid);
--- End code ---


also, Change the BeBot/main/10_Roster.php file here around line 837 like this:
Make sure you use YOUR org's ID and NOT 4670!  In the line that has 4670 replace with your org's ID.

--- Code: ---            // Get the guild roster
            $i = 0;
            $xml_roster = $this->bot->core("tools")
                // ->get_site("http://people.anarchy-online.com/org/stats/d/$dim/name/$id/basicstats.xml");  // original line
                ->get_site("http://people.anarchy-online.com/org/stats/d/1/name/4670/basicstats.xml");    //  hard coded testing line       Ezzii
            $faction = $this->bot->core("tools")
--- End code ---


Ok having done that start the bot up and it will take a while to update the roster then add members to its friend list.

If at anytime PoRK starts using 5 instead of 1  then we'll get to do some more of this ;p .

What is still to be done I think is the !whois module looking up individual toons in the same way but I'm going to take a break for a while feel free to jump in.

 -- Ezzii

Heffalomp:

--- Quote from: Ezzii on February 27, 2013, 08:07:37 pm ---also, Change the BeBot/main/10_Roster.php file here around line 837 like this:
Make sure you use YOUR org's ID and NOT 4670!  In the line that has 4670 replace with your org's ID.

--- Code: ---            // Get the guild roster
            $i = 0;
            $xml_roster = $this->bot->core("tools")
                // ->get_site("http://people.anarchy-online.com/org/stats/d/$dim/name/$id/basicstats.xml");  // original line
                ->get_site("http://people.anarchy-online.com/org/stats/d/1/name/4670/basicstats.xml");    //  hard coded testing line       Ezzii
            $faction = $this->bot->core("tools")
--- End code ---

--- End quote ---
the $xml_roster part should be like this instead:

--- Code: ---$xml_roster = $this -> bot -> core("tools") -> get_site("http://people.anarchy-online.com/org/stats/d/1/name/$id/basicstats.xml");
--- End code ---
and set org-id in the bot's config file, especialy if running more than 1 bot from same folder (like I do). :-)

Ezzii:
Yeh you're right Hefalomp,

All we need to hard code was $dim to 1 and nothing else.

Thanks for pointing out the right way.

 -- Ezzii

Heffalomp:
To fix !whois

in core/ao/Whois.php change the function get_playerxml($name) (should start around line 410) so it looks like this before the $xml= part

--- Code: ---        function get_playerxml($name)
        { // Start function get_playerxml()
                $name = strtolower($name);

                if ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "funcom_auno")
                {
                        $site1NAME = "Anarchy-Online";
                        // $site1URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site1URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";

                        $site2NAME = "Auno";
                        // $site2URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site2URL = "http://auno.org/ao/char.php?output=xml&dimension=1&name=" . strtolower($name);
                }
                elseif ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "funcom_only")
                {
                        $site1NAME = "Anarchy-Online";
                        // $site1URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site1URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";
                        $site2NAME = FALSE;
                }
                elseif ($this -> bot -> core("settings") -> get("Whois", "LookupOrder") == "auno_only")
                {
                        $site1NAME = "Auno";
                        // $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=1&name=" . strtolower($name);
                        $site2NAME = FALSE;
                }
                else
                {
                        $site1NAME = "Auno";
                        $site1URL = "http://auno.org/ao/char.php?output=xml&dimension=" . $this -> bot -> dimension . "&name=" . strtolower($name);
                        $site2NAME = "Anarchy-Online";
                        // $site2URL = "http://people.anarchy-online.com/character/bio/d/" . $this -> bot -> dimension . "/name/" . strtolower($name) . "/bio.xml";
                        $site2URL = "http://people.anarchy-online.com/character/bio/d/1/name/" . strtolower($name) . "/bio.xml";
                }

--- End code ---
note: auno lookup will fail for all chars from rk2 until auno syncs the new rk1 exports, funcom lookup will work just fine for characters activated in game, inavtive ones will not be avaliable for lookup.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version