BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: Sudoka on July 25, 2009, 06:57:34 pm

Title: AoC YG player profile module
Post by: Sudoka on July 25, 2009, 06:57:34 pm
Here is my module for fetching player profiles from the aoc.yg.com website.

Put it in the custom/modules directory

First of all you need a password for accessing Yg's xml data. Here is the procedure for that :
Quote
To request an XML password please create a YG Member account at http://members.yg.com. Then on the My Account page click the Age of Conan tab and you will be able to request your password.
Once you have a password, insert it on line 76 in the module.

You can search for player profiles on all servers, but it defaults to the server the bot is running on, that is set in the Bot.conf file under $dimension.

To show usage and check the default server name, use:
!yg

To get player profile from the default server, use:
!yg name

To get player profile from another server, use:
!yg name servername

Edit :
2009-10-23 : New procedure for getting xml password from YG.
2009-09-24 : Added "last updated", and an auto-check ,and load, if curl is disabled.

Yg.php
Code: [Select]
<?php
/*
* Yg.php - Display player profiles from the Yellow Gremlin Database (http://aoc.yg.com/)
*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg Stensås, ShadowRealm Creations and the BeBot development team.
*
* Developed by:
* - Alreadythere (RK2)
* - Blondengy (RK1)
* - Blueeagl3 (RK1)
* - Glarawyn (RK1)
* - Khalem (RK1)
* - Naturalistic (RK1)
* - Temar (RK1)
*
* See Credits file for all aknowledgements.
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; version 2 of the License only.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
*  USA
*/

/*
* Module made by Elyissa from Fury (PvP) EU
* Layout idea by Kentarii from Fury (PvP) EU
* Fetching of xml data without cURL by Getrix from Fury (PvP) EU
*/



$Yg = new Yg($bot);

class 
Yg extends BaseActiveModule
{

function __construct(&$bot)
    {
parent::__construct(&$botget_class($this));

$this -> register_command('all''yg'"GUEST");

$this -> help['description'] = "Display player profile from Yellow Gremlin Database";
$this -> help['command']['yg <name>']="Display player profile from default server";
        
$this -> help['command']['yg <name> <server>']="Display player profile from <server>";
        
$this -> help['notes'] = "Yellow Gremlin Database url : http://aoc.yg.com";
}

function command_handler($name$msg$origin)
    {
        if (
preg_match('/^yg (.+) (.+)$/i'$msg$info)) {
return $this -> showprofile($msg$info[1], $info[2]);
        }
        else if (
preg_match('/^yg (.+)$/i'$msg$info)) {
return $this -> showprofile($msg$info[1], "");
        }
else {
            return (
"##lightyellow##Usage:##end## ##white##<pre>Yg Name Server##end## ##gray##(Default Server: ".$this->bot->dimension.")##end##");
}
}

function showprofile($msg$profilename$servername)
{
    /* Password to access YG xml data */
    $password '';
        if (
$servername == "")
            
$servername $this->bot->dimension;

        
/* Check for cURL, and load xml profile data */
        
if ($this -> curl_check()) {
            
$ch curl_init ("http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password");
            
curl_setopt($chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
            
curl_setopt($chCURLOPT_RETURNTRANSFER,1);
            
$xmlprf curl_exec($ch);
            
curl_close($ch);
        }
        else {
            
$yg_link "http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password";
            
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
            if (!empty(
$ch["content"])) { $xmlprf $ch["content"]; }
            else { 
$xmlprf ""; }
        }

        
$xmlobj simplexml_load_string($xmlprf);

        
/*  Done loading xml profile data */

        
if($xmlobj->aocygplayerprofile->name)
        {
            
/* Some text formating */
            
$pvpkills str_replace(".00"""$xmlobj->aocygplayerprofile->pvpkills);
            
$pvpdeaths str_replace(".00"""$xmlobj->aocygplayerprofile->pvpdeaths);
            
$classarray = array("(Priest)""(Rogue)""(Soldier)""(Mage)");
            
$class str_replace($classarray""$xmlobj->aocygplayerprofile->class);
            
$murderer ucfirst($xmlobj->aocygplayerprofile->murderer);

            
/* Player info blob */
            
$blobname "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Character Profile</font>\n";
            
$blobname .= "##seagreen##Name##end## :: ##seablue##".$xmlobj->aocygplayerprofile->name."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->link."##end##\n";
            if(
$xmlobj->aocygplayerprofile->guild)
                
$blobname .= "##seagreen##Guild##end## :: ##seablue##".$xmlobj->aocygplayerprofile->guild."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->guildlink."##end##\n";
            
$blobname .= "##seagreen##Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->level."##end##\n";
            
$blobname .= "##seagreen##Server##end## :: ##seablue##".$xmlobj->aocygplayerprofile->server."##end##\n";
            
$blobname .= "##seagreen##Race##end## :: ##seablue##".$xmlobj->aocygplayerprofile->race."##end##\n";
            
$blobname .= "##seagreen##Class##end## :: ##seablue##".$xmlobj->aocygplayerprofile->class."##end##\n";
            
$blobname .= "##seagreen##Gender##end## :: ##seablue##".$xmlobj->aocygplayerprofile->gender."##end##\n";
            
$blobname .= "##seagreen##PvP Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->pvplevel."##end##\n";
            
$blobname .= "##seagreen##K/D Ratio##end## :: ##seablue##".$pvpkills."/".$pvpdeaths." = ".$xmlobj->aocygplayerprofile->kdratio."##end##\n";
            
$blobname .= "##seagreen##Professions##end## :: ##seablue##".$xmlobj->aocygplayerprofile->professions."##end##\n";
            
$blobname .= "##seagreen##Murderer##end## :: ##seablue##".$murderer."##end##\n";
            
$blobname .= "##seagreen##Last Updated##end## :: ##seablue##".$xmlobj->aocygplayerprofile->last_updated."##end##\n<center> </center>";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Equipped Items</font>\n";
            for(
$i=0$i<=16$i=$i+1) {
                if (
$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname)
                    
$blobname .= "##seagreen##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname."##end## :: ##seablue##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->itemname."##end##\n";
            }

            
/* If member of a guild, fetch Guild xml data */
            
if($xmlobj->aocygplayerprofile->guild)
            {
                
/* Text formating */
                
$guildid =  str_replace("guild""guildxml"$xmlobj->aocygplayerprofile->guildlink);

                
/* Check for cURL, and load xml guild data */
                
if ($this -> curl_check()) {
                    
$ch curl_init ("$guildid&pwd=$password");
                    
curl_setopt($chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
                    
curl_setopt($chCURLOPT_RETURNTRANSFER,1);
                    
$xmlgld curl_exec($ch);
                    
curl_close($ch);
                }
                else {
                    
$yg_link "$guildid&pwd=$password";
                    
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
                    if (!empty(
$ch["content"])) { $xmlgld $ch["content"]; }
                    else { 
$xmlgld ""; }
                }

                
$xmlguild simplexml_load_string($xmlgld);

                
/*  Done loading xml guild data */

                /* Guild info blob */
                
$blobguild "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
                
$blobguild .= "<font face='hyboriansmall' color='orange'>Guild Profile</font>\n";
                
$blobguild .= "##seagreen##Guild##end## :: ##seablue##".$xmlguild->aocygguild->name."##end## :: ##yellow##".$xmlguild->aocygguild->guildlink."##end##\n";
                
$blobguild .= "##seagreen##Server##end## :: ##seablue##".$xmlguild->aocygguild->server."##end##\n";
                
$blobguild .= "##seagreen##Members##end## :: ##seablue##".$xmlguild->aocygguild->member_count."##end##\n";
                
$blobguild .= "##seagreen##Murderers##end## :: ##seablue##".$xmlguild->aocygguild->murderers."##end##\n";
                
$blobguild .= "##seagreen##Average Level##end## :: ##seablue##".$xmlguild->aocygguild->averagelvl."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Level##end## :: ##seablue##".$xmlguild->aocygguild->averagepvplvl."##end##\n";
                
$blobguild .= "##seagreen##Total Kills##end## :: ##seablue##".$xmlguild->aocygguild->totalkills."##end##\n";
                
$blobguild .= "##seagreen##Total Deaths##end## :: ##seablue##".$xmlguild->aocygguild->totaldeaths."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Kills##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpkills."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Deaths##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpdeaths."##end##\n";
                
$blobguild .= "##seagreen##K/D Ratio##end## :: ##seablue##".$xmlguild->aocygguild->kdratio."##end##\n";
            }

            
/* Output info */
            
$result "##yellow##[-YG-]##end## ##white##:: ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->name$blobname);
            if(
$xmlobj->aocygplayerprofile->guild)
                
$result .= " / ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->guild$blobguild);
            
$result .= " :: [ ##seagreen##L".$xmlobj->aocygplayerprofile->level."##end## | ##seagreen##";
            
$result .= $class."##end##| ##seablue##L".$xmlobj->aocygplayerprofile->pvplevel."##end## | ##seablue##";
            
$result .= $pvpkills."/".$pvpdeaths."##end## | ##seablue##".$xmlobj->aocygplayerprofile->kdratio."##end## ]##end##";

            return 
$result;
        }
        else
        {
            
/* No profile found */
            
$profilename ucfirst(strtolower($profilename));
            
$servername ucfirst(strtolower($servername));
            
$blob "##yellow##[-YG-]##end## ##white##::##end## ##red##No profile found for ##lightyellow##$profilename##end## on server ##lightyellow##$servername##end##.##end##";
    return $blob;
        }

}

    function 
curl_check() {
    if (in_array ('curl'get_loaded_extensions()))
    return true;
    else
    return false;
    }
}
?>

Title: Re: AoC YG player profile module
Post by: Khalem on July 25, 2009, 07:18:17 pm
You should be able to bypass the issue with $ in password issue entirely by using:
Code: [Select]
  $password = '';

This means php won't try to parse anything between the quotes.
Title: Re: AoC YG player profile module
Post by: Getrix on July 25, 2009, 07:44:51 pm
Your module will only work if its runned with CURL enabled..

Replace both CURL stuff with:

$yg_link = "http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password";
$ch = $this -> bot -> core("tools") -> get_site($yg_link, 1);
if (!empty($ch["content"])) { $xmlprf = $ch["content"]; }
else { $xmlprf = ""; }

$yg_link = "$guildid&pwd=$password";
$ch = $this -> bot -> core("tools") -> get_site($yg_link, 1);
if (!empty($ch["content"])) { $xmlgld = $ch["content"]; }
else { $xmlgld = ""; }


Should be something like this tested and working with CURL disabled:

Code: [Select]
<?php
/*
* Yg.php - Display player profiles from the Yellow Gremlin Database (http://aoc.yg.com/)
*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg Stensås, ShadowRealm Creations and the BeBot development team.
*
* Developed by:
* - Alreadythere (RK2)
* - Blondengy (RK1)
* - Blueeagl3 (RK1)
* - Glarawyn (RK1)
* - Khalem (RK1)
* - Naturalistic (RK1)
* - Temar (RK1)
*
* See Credits file for all aknowledgements.
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; version 2 of the License only.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
*  USA
*
*/

/*
* Module made by Elyissa from Fury (PvP) EU
* Layout idea by Kentarii from Fury (PvP) EU
* Fixed bug when CURL is disabled by Getrix from Fury (PvP) EU
*/



$Yg = new Yg($bot);

class 
Yg extends BaseActiveModule
{

    function 
__construct(&$bot)
    {
        
parent::__construct(&$botget_class($this));

        
$this -> register_command('all''yg'"GUEST");

        
$this -> help['description'] = "Display player profile from Yellow Gremlin Database";
        
$this -> help['command']['yg <name>']="Display player profile from default server";
                
$this -> help['command']['yg <name> <server>']="Display player profile from <server>";
                
$this -> help['notes'] = "Yellow Gremlin Database url : http://aoc.yg.com";
    }

    function 
command_handler($name$msg$origin)
    {
        if (
preg_match('/^yg (.+) (.+)$/i'$msg$info)) {
            return 
$this -> showprofile($msg$info[1], $info[2]);
        }
        else if (
preg_match('/^yg (.+)$/i'$msg$info)) {
            return 
$this -> showprofile($msg$info[1], "");
        }
        else {
            return (
"##lightyellow##Usage:##end## ##white##<pre>Yg Name Server##end## ##gray##(Default Server: ".$this->bot->dimension.")##end##");
        }
    }

    function 
showprofile($msg$profilename$servername)
    {
        
/* Password to access YG xml data */
        
$password '';
        if (
$servername == "")
            
$servername $this->bot->dimension;

        
$yg_link "http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password";
    
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
    if (!empty(
$ch["content"])) { $xmlprf $ch["content"]; }
        else { 
$xmlprf ""; }
    
        
$xmlobj simplexml_load_string($xmlprf);

        
/*  Done loading xml profile data */

        
if($xmlobj->aocygplayerprofile->name)
        {
            
/* Some text formating */
            
$pvpkills str_replace(".00"""$xmlobj->aocygplayerprofile->pvpkills);
            
$pvpdeaths str_replace(".00"""$xmlobj->aocygplayerprofile->pvpdeaths);
            
$classarray = array("(Priest)""(Rogue)""(Soldier)""(Mage)");
            
$class str_replace($classarray""$xmlobj->aocygplayerprofile->class);
            
$murderer ucfirst($xmlobj->aocygplayerprofile->murderer);

            
/* Player info blob */
            
$blobname "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Character Profile</font>\n";
            
$blobname .= "##seagreen##Name##end## :: ##seablue##".$xmlobj->aocygplayerprofile->name."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->link."##end##\n";
            if(
$xmlobj->aocygplayerprofile->guild)
                
$blobname .= "##seagreen##Guild##end## :: ##seablue##".$xmlobj->aocygplayerprofile->guild."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->guildlink."##end##\n";
            
$blobname .= "##seagreen##Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->level."##end##\n";
            
$blobname .= "##seagreen##Server##end## :: ##seablue##".$xmlobj->aocygplayerprofile->server."##end##\n";
            
$blobname .= "##seagreen##Race##end## :: ##seablue##".$xmlobj->aocygplayerprofile->race."##end##\n";
            
$blobname .= "##seagreen##Class##end## :: ##seablue##".$xmlobj->aocygplayerprofile->class."##end##\n";
            
$blobname .= "##seagreen##Gender##end## :: ##seablue##".$xmlobj->aocygplayerprofile->gender."##end##\n";
            
$blobname .= "##seagreen##PvP Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->pvplevel."##end##\n";
            
$blobname .= "##seagreen##K/D Ratio##end## :: ##seablue##".$pvpkills."/".$pvpdeaths." = ".$xmlobj->aocygplayerprofile->kdratio."##end##\n";
            
$blobname .= "##seagreen##Professions##end## :: ##seablue##".$xmlobj->aocygplayerprofile->professions."##end##\n";
            
$blobname .= "##seagreen##Murderer##end## :: ##seablue##".$murderer."##end##\n<center> </center>";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Equipped Items</font>\n";
            for(
$i=0$i<=16$i=$i+1) {
                if (
$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname)
                    
$blobname .= "##seagreen##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname."##end## :: ##seablue##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->itemname."##end##\n";
            }

            
/* If member of a guild, fetch Guild xml data */
            
if($xmlobj->aocygplayerprofile->guild)
            {
                
/* Text formating */
                
$guildid =  str_replace("guild""guildxml"$xmlobj->aocygplayerprofile->guildlink);


                
$yg_link "$guildid&pwd=$password";
        
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
        if (!empty(
$ch["content"])) { $xmlgld $ch["content"]; }
        else { 
$xmlgld ""; }

                
$xmlguild simplexml_load_string($xmlgld);

                
/*  Done loading xml guild data */

                /* Guild info blob */
                
$blobguild "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
                
$blobguild .= "<font face='hyboriansmall' color='orange'>Guild Profile</font>\n";
                
$blobguild .= "##seagreen##Guild##end## :: ##seablue##".$xmlguild->aocygguild->name."##end## :: ##yellow##".$xmlguild->aocygguild->guildlink."##end##\n";
                
$blobguild .= "##seagreen##Server##end## :: ##seablue##".$xmlguild->aocygguild->server."##end##\n";
                
$blobguild .= "##seagreen##Members##end## :: ##seablue##".$xmlguild->aocygguild->member_count."##end##\n";
                
$blobguild .= "##seagreen##Murderers##end## :: ##seablue##".$xmlguild->aocygguild->murderers."##end##\n";
                
$blobguild .= "##seagreen##Average Level##end## :: ##seablue##".$xmlguild->aocygguild->averagelvl."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Level##end## :: ##seablue##".$xmlguild->aocygguild->averagepvplvl."##end##\n";
                
$blobguild .= "##seagreen##Total Kills##end## :: ##seablue##".$xmlguild->aocygguild->totalkills."##end##\n";
                
$blobguild .= "##seagreen##Total Deaths##end## :: ##seablue##".$xmlguild->aocygguild->totaldeaths."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Kills##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpkills."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Deaths##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpdeaths."##end##\n";
                
$blobguild .= "##seagreen##K/D Ratio##end## :: ##seablue##".$xmlguild->aocygguild->kdratio."##end##\n";
            }

            
/* Output info */
            
$result "##yellow##[-YG-]##end## ##white##:: ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->name$blobname);
            if(
$xmlobj->aocygplayerprofile->guild)
                
$result .= " / ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->guild$blobguild);
            
$result .= " :: [ ##seagreen##L".$xmlobj->aocygplayerprofile->level."##end## | ##seagreen##";
            
$result .= $class."##end##| ##seablue##L".$xmlobj->aocygplayerprofile->pvplevel."##end## | ##seablue##";
            
$result .= $pvpkills."/".$pvpdeaths."##end## | ##seablue##".$xmlobj->aocygplayerprofile->kdratio."##end## ]##end##";

            return 
$result;
        }
        else
        {
            
/* No profile found */
            
$profilename ucfirst(strtolower($profilename));
            
$servername ucfirst(strtolower($servername));
            
$blob "##yellow##[-YG-]##end## ##white##::##end## ##red##No profile found for ##lightyellow##$profilename##end## on server ##lightyellow##$servername##end##.##end##";
            return 
$blob;
        }

    }

}
?>

Title: Re: AoC YG player profile module
Post by: Sudoka on July 25, 2009, 07:49:35 pm
You should be able to bypass the password issue entirely by using:
Code: [Select]
   $password = '';

This means php won't try to parse anything between the quotes.

Thanks, post updated :D

Your module will only work if its runned with CURL enabled..

I guess I just presumed everyone had it enabled ;) Thanks for fixing tho.
Title: Re: AoC YG player profile module
Post by: keirou on July 26, 2009, 02:55:50 am
<-- noob.

whats curl
whats so good about it
why do some use it others not?
Title: Re: AoC YG player profile module
Post by: keirou on July 26, 2009, 03:24:06 am
btw ty :) got it up and running on gwahlur now :)

just curious.

given the scripts layout, would it be possible to steal the !whois alt information and have that listed under ALTS on the yg script.
and or removing the KD Ratio (i am on a pve server after all)

Im assuming i get rid of these lines
110
111
113
157 (or atleast the 2nd part of it)
158

Title: Re: AoC YG player profile module
Post by: Khalem on July 26, 2009, 11:48:45 am
<-- noob.

whats curl
whats so good about it
why do some use it others not?

cURL (Client for URLs) or to be more precice libcURL is a library available for PHP which provides a way for PHP scripts like BeBot to access URL's. The advantage of using libcURL for BeBot is that it should be faster than our own native solution and should be more robust.

The reason some use it and others not is that cURL is not present in all PHP installations. In addition to this, you have to specifically enable cURL within BeBot using !settings tools (this is going to change in the future as it will be automatically detected)

In any case, BeBot provides a wrapper for obtaining URL's which should be used whenever possible
get_site() which Getrix mentioned.
Title: Re: AoC YG player profile module
Post by: keirou on July 26, 2009, 01:05:18 pm
so using curl is better?
and is there is a specific version to use?
Im think im running bebot 6.3

Does using curl allow pulling other data then that which Getrix posted?

if not I might stay with the work-around listed.

Title: Re: AoC YG player profile module
Post by: Getrix on July 26, 2009, 01:17:31 pm
You get the same data, but with different ways of getting them.

Easy way to explain:
With CURL = Sportscar to get your kid from school
Without CURL = Family car to get your kid from school

You get your kid home from school, but in different speed. Not sure how much faster..

The work-around is working ok if you dont want to buy a sportscar (Install CURL)
Title: Re: AoC YG player profile module
Post by: Khalem on July 26, 2009, 01:18:09 pm
cURL is slightly better, but as an end user you really should not notice any real difference.

Use Getrix's code and you will be fine. It works the exact same way as the original module posted with the exception that it does not require cURL.
[edit]
Getrix beat me to it :P
Title: Re: AoC YG player profile module
Post by: keirou on July 26, 2009, 02:48:01 pm
and thats why it says im a rookie :D hehe
thx guys :) and thanks heaps for the module, working like a charm
Title: Re: AoC YG player profile module
Post by: Poonjab on July 26, 2009, 10:28:29 pm
Lovin this module.  Works well after I installed the non-curl version.
Title: Re: AoC YG player profile module
Post by: Huesos on July 27, 2009, 03:13:16 am
Not sure why but profiles are not found, and knw mytoon is there on yg
Title: Re: AoC YG player profile module
Post by: Poonjab on July 27, 2009, 03:59:45 am
Not sure why but profiles are not found, and knw mytoon is there on yg

Did you contact the guy at YG to get a password for XML access?
Title: Re: AoC YG player profile module
Post by: Margon on July 27, 2009, 05:33:32 pm
is it possible to fix some german letters like ä ( &auml; ) ö( &ouml; ) ü ( &uuml; ) ß ( &szlig; ) in this script? if i use the german xml data i get some letters like "ä"  (ä)  in the item/charakter names
Title: Re: AoC YG player profile module
Post by: DarkGord on July 29, 2009, 06:55:54 pm
Hi, was under the impression that using this
Code: [Select]
   $password = '';
would make me not need a password, however it is saying profile not found when looking for profiles that i know do exist.
So i assume i do need to get the password afterall ?(Using the modified code by Getrix btw)
Title: Re: AoC YG player profile module
Post by: Khalem on July 29, 2009, 07:43:53 pm
First of all you need a password for accessing Yg's xml data. You can get this by mailing them.
Once you have a password, insert it on line 76 in the module.

It quite clearly states that you do need a password...
Title: Re: AoC YG player profile module
Post by: keirou on July 29, 2009, 07:47:35 pm
You should be able to bypass the password issue entirely by using:
Code: [Select]
   $password = '';

This means php won't try to parse anything between the quotes.

you might want to delete this post then Khalem ;) giving people false hope
Title: Re: AoC YG player profile module
Post by: Khalem on July 29, 2009, 09:00:36 pm
Apologies. It was not my intention to give the impression that you could use it without a password. I have clarified my post.

Using '' instead of "" was to bypass the issue with having $ in your password, and my post was aimed at the OP.
Title: Re: AoC YG player profile module
Post by: Getrix on September 02, 2009, 02:00:18 pm
As the ygadmin's have added "last_updated" to xml and its verry usefull to check whatever the data returned is up2date ingame its good to add to script.

Place this code in line 112 or other places you want it to be showed...

Code: [Select]
$blobname .= "##seagreen##Last updated##end## :: ##seablue##".$xmlobj->aocygplayerprofile->last_updated."##end##\n";

http://forums.yg.com/showthread.php?t=605
Title: Re: AoC YG player profile module
Post by: altera on September 09, 2009, 04:24:21 pm
Anyone able to get the YG PW.  I have sent a couple of emails requesting the password, but no luck. They say they are still allowing access to this.

ANy hewlp would be appreciated, I would love to get this module working
Title: Re: AoC YG player profile module
Post by: Poonjab on September 09, 2009, 05:18:43 pm
Anyone able to get the YG PW.  I have sent a couple of emails requesting the password, but no luck. They say they are still allowing access to this.

ANy hewlp would be appreciated, I would love to get this module working

They hooked me up no problem.  I think I was up and running by the next day.  It could be he is on vacation or otherwise unable to handle your request right at the moment and will get back to you when he can, but it went real smooth for me.
Title: Re: AoC YG player profile module
Post by: WeZoN on September 12, 2009, 06:38:15 pm
same here ^^

i sent him a mail and got the password within 2 hours :P
Title: Re: AoC YG player profile module
Post by: Noevo on September 23, 2009, 09:39:07 pm
!yg is displaying correct default servername but still have to add set to any profile search or it returns no player on server.  Feel like i'm missing something simple...any ideas?
Title: Re: AoC YG player profile module
Post by: Sudoka on September 24, 2009, 12:12:56 am
Not sure what the problem is atm, but how about you hard-code the $servername in the last line like this:

/* Password to access YG xml data */
       $password = '';
        if ($servername == "")
            $servername = "Set";

Maybe that helps, if not, it may be a YG issue...  Let me know if this helps...
Title: Re: AoC YG player profile module
Post by: Noevo on September 24, 2009, 04:59:15 am
Thanks Sudoka, worked like a charm and can still search other servers.
Title: Re: AoC YG player profile module
Post by: Yite on October 23, 2009, 09:34:35 am
Tried to request a key via the email method and got the following back:
Quote
We have changed our XML request system from being e-mail based to a now completely automated system using our new YG Members section. To request an XML password please create a YG Member account at http://members.yg.com. Then on the My Account page click the Age of Conan tab and you will be able to request your password. For full details on how to use the XML system please check out this forum sticky: http://forums.yg.com/showthread.php?t=673

So for anyone else looking for a key this is the procedure :)

-Yite
Title: Re: AoC YG player profile module
Post by: YGAdmin on October 23, 2009, 10:20:26 am
Thanks for posting that Yite. I just registered to let everyone know on this thread the same thing but you beat me to it :)

Regards,
YGAdmin
Title: Re: AoC YG player profile module
Post by: Sudoka on October 23, 2009, 03:43:15 pm
Thanks for letting me know. Updated the first post with the correct procedure.
 :)
Title: Re: AoC YG player profile module
Post by: Tomate on October 28, 2009, 08:19:45 pm
I would like to use the YG module instead of the Whois module. Is it possible to replace it?

Thanks in advance!
Our Guild would be very thankful.
Title: Re: AoC YG player profile module
Post by: Poonjab on October 28, 2009, 10:34:16 pm
I would like to use the YG module instead of the Whois module. Is it possible to replace it?

Thanks in advance!
Our Guild would be very thankful.

You can use both, and probably should, as they are intended to supply different types of information.
Title: Re: AoC YG player profile module
Post by: Tomate on October 28, 2009, 11:41:50 pm
I think I expressed it the wrong way :)
I would like to replace the "Details" button in the logon messages with the YG plugin.
Is there any solution to this?
I tried it myself but failed as I am not a very good programmer.
Title: Re: AoC YG player profile module
Post by: Getrix on October 29, 2009, 09:22:09 am
IM NOT GONNA SUPPORT ON THIS HACK. Use on own risk.

Add this to the end of modules/Whois.php (After line 263)

Code: [Select]
function whois_yg($msg, $profilename) {
        $password = "CHANGEME";
        $servername = $this->bot->dimension;

        $yg_link = "http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password";
        $ch = $this -> bot -> core("tools") -> get_site($yg_link, 1);
        if (!empty($ch["content"])) { $xmlprf = $ch["content"]; }
        else { $xmlprf = ""; }
   
        $xmlobj = simplexml_load_string($xmlprf);

        /*  Done loading xml profile data */

        if($xmlobj->aocygplayerprofile->name) {
            /* Some text formating */
            $pvpkills = str_replace(".00", "", $xmlobj->aocygplayerprofile->pvpkills);
            $pvpdeaths = str_replace(".00", "", $xmlobj->aocygplayerprofile->pvpdeaths);
            $classarray = array("(Priest)", "(Rogue)", "(Soldier)", "(Mage)");
            $class = str_replace($classarray, "", $xmlobj->aocygplayerprofile->class);
            $murderer = ucfirst($xmlobj->aocygplayerprofile->murderer);

            /* Player info blob */
            $blobname = "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
            $blobname .= "<font face='hyboriansmall' color='orange'>Character Profile</font>\n";
            $blobname .= "##seagreen##Name##end## :: ##seablue##".$xmlobj->aocygplayerprofile->name."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->link."##end##\n";
            if($xmlobj->aocygplayerprofile->guild) {
                $blobname .= "##seagreen##Guild##end## :: ##seablue##".$xmlobj->aocygplayerprofile->guild."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->guildlink."##end##\n";
            }
            $blobname .= "##seagreen##Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->level."##end##\n";
            $blobname .= "##seagreen##Server##end## :: ##seablue##".$xmlobj->aocygplayerprofile->server."##end##\n";
            $blobname .= "##seagreen##Race##end## :: ##seablue##".$xmlobj->aocygplayerprofile->race."##end##\n";
            $blobname .= "##seagreen##Class##end## :: ##seablue##".$xmlobj->aocygplayerprofile->class."##end##\n";
            $blobname .= "##seagreen##Gender##end## :: ##seablue##".$xmlobj->aocygplayerprofile->gender."##end##\n";
            $blobname .= "##seagreen##PvP Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->pvplevel."##end##\n";
            $blobname .= "##seagreen##K/D Ratio##end## :: ##seablue##".$pvpkills."/".$pvpdeaths." = ".$xmlobj->aocygplayerprofile->kdratio."##end##\n";
            $blobname .= "##seagreen##Professions##end## :: ##seablue##".$xmlobj->aocygplayerprofile->professions."##end##\n";
            $blobname .= "##seagreen##Murderer##end## :: ##seablue##".$murderer."##end##\n";
            $blobname .= "##seagreen##Last updated##end## :: ##seablue##".$xmlobj->aocygplayerprofile->last_updated."##end##\n<center> </center>";
            $blobname .= "<font face='hyboriansmall' color='orange'>Equipped Items</font>\n";
            for($i=0; $i<=16; $i=$i+1) {
                if ($xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname) {
                    $blobname .= "##seagreen##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname."##end## :: ##seablue##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->itemname."##end##\n";
                }
            }
     
            /* If member of a guild, fetch Guild xml data */
            if($xmlobj->aocygplayerprofile->guild)
            {
                /* Text formating */
                $guildid =  str_replace("guild", "guildxml", $xmlobj->aocygplayerprofile->guildlink);


                $yg_link = "$guildid&pwd=$password";
                $ch = $this -> bot -> core("tools") -> get_site($yg_link, 1);
                if (!empty($ch["content"])) { $xmlgld = $ch["content"]; }
                else { $xmlgld = ""; }

                $xmlguild = simplexml_load_string($xmlgld);

                /*  Done loading xml guild data */

                /* Guild info blob */
                $blobguild = "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
                $blobguild .= "<font face='hyboriansmall' color='orange'>Guild Profile</font>\n";
                $blobguild .= "##seagreen##Guild##end## :: ##seablue##".$xmlguild->aocygguild->name."##end## :: ##yellow##".$xmlguild->aocygguild->guildlink."##end##\n";
                $blobguild .= "##seagreen##Server##end## :: ##seablue##".$xmlguild->aocygguild->server."##end##\n";
                $blobguild .= "##seagreen##Members##end## :: ##seablue##".$xmlguild->aocygguild->member_count."##end##\n";
                $blobguild .= "##seagreen##Murderers##end## :: ##seablue##".$xmlguild->aocygguild->murderers."##end##\n";
                $blobguild .= "##seagreen##Average Level##end## :: ##seablue##".$xmlguild->aocygguild->averagelvl."##end##\n";
                $blobguild .= "##seagreen##Average PVP Level##end## :: ##seablue##".$xmlguild->aocygguild->averagepvplvl."##end##\n";
                $blobguild .= "##seagreen##Total Kills##end## :: ##seablue##".$xmlguild->aocygguild->totalkills."##end##\n";
                $blobguild .= "##seagreen##Total Deaths##end## :: ##seablue##".$xmlguild->aocygguild->totaldeaths."##end##\n";
                $blobguild .= "##seagreen##Average PVP Kills##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpkills."##end##\n";
                $blobguild .= "##seagreen##Average PVP Deaths##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpdeaths."##end##\n";
                $blobguild .= "##seagreen##K/D Ratio##end## :: ##seablue##".$xmlguild->aocygguild->kdratio."##end##\n";
            }

            /* Output info */
            $result = $this->bot->core("tools")->make_blob("YG", $blobname);
            return $result;
        }
        else { return "No YG"; }
}


And this to modules\Whois.php after line 256
Quote
$result .=  " :: ". $this -> whois_yg($source, $who);
Title: Re: AoC YG player profile module
Post by: keirou on October 30, 2009, 08:42:41 am
Im getting an error

Parse error: syntax error, unexpected $end in <bot dir>\modules\Whois.php on line 351


i opened it up and all there was on 351 was

?>
Title: Re: AoC YG player profile module
Post by: Getrix on October 30, 2009, 09:45:31 am
Updated my last post
Title: Re: AoC YG player profile module
Post by: keirou on October 30, 2009, 06:01:38 pm
Thanks Getrix, now the bots boot up, however i dunno if the script it working

afaik i just put the password in the 1 spot.

but when i do a whois on myself it comes up with no yg.

but i do a yg on myself and it works.


[01:03] To [Ttlbot]: !whois Miyaichi
[01:03] [Ttlbot]: Miyaichi is a level 80 Demonologist :: Online :: Alts :: No YG
[01:04] To [Ttlbot]: !yg Miyaichi
[01:04] [Ttlbot]: [-YG-] :: Miyaichi / Third Time Lucky :: [ L80 | Demonologist | L2 | 1,577/1,248 | 1.26 ]
Title: Re: AoC YG player profile module
Post by: keirou on November 02, 2009, 01:06:54 am
any help???
Title: Re: AoC YG player profile module
Post by: keirou on November 02, 2009, 02:19:48 am
         $result .=  " :: ". $this -> whois_yg($source, $name);
not
         $result .=  " :: ". $this -> whois_yg($source, $who);


;)
Title: Re: AoC YG player profile module
Post by: Getrix on November 02, 2009, 07:08:42 am
I gave you only the function, so you need to make sure it gets correct info into the function :p
Title: Re: AoC YG player profile module
Post by: Margon on November 05, 2009, 11:34:01 am
can you post a working whois.php with this fix?

i've modified my whois.php but it doesnt work..
Title: Re: AoC YG player profile module
Post by: squattinbull on January 18, 2010, 04:21:47 am
This is an awesome module if I can get the xml password.  Is there any way or is it already in the making for the yg item module?

I see yg posted the code here:

http://aoc.yg.com/pagecontent.php?id=2

:)
Title: Re: AoC YG player profile module
Post by: snyder on January 18, 2010, 11:04:28 am
register and request your xml password
http://members.yg.com/
Title: Re: AoC YG player profile module
Post by: IKShadow on February 10, 2010, 01:32:35 pm
Can someone post the complete code how to implement it.
I tried but it does not work .. it does not find any players.
Title: Re: AoC YG player profile module
Post by: Drizzurdeen on February 10, 2010, 02:05:58 pm
Code: [Select]
<?php
/*
* Yg.php - Display player profiles from the Yellow Gremlin Database (http://aoc.yg.com/)
*
* BeBot - An Anarchy Online & Age of Conan Chat Automaton
* Copyright (C) 2004 Jonas Jax
* Copyright (C) 2005-2007 Thomas Juberg Stensås, ShadowRealm Creations and the BeBot development team.
*
* Developed by:
* - Alreadythere (RK2)
* - Blondengy (RK1)
* - Blueeagl3 (RK1)
* - Glarawyn (RK1)
* - Khalem (RK1)
* - Naturalistic (RK1)
* - Temar (RK1)
*
* See Credits file for all aknowledgements.
*
*  This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; version 2 of the License only.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with this program; if not, write to the Free Software
*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
*  USA
*
*/

/*
* Module made by Elyissa from Fury (PvP) EU
* Layout idea by Kentarii from Fury (PvP) EU
* Fixed bug when CURL is disabled by Getrix from Fury (PvP) EU
*/



$Yg = new Yg($bot);

class 
Yg extends BaseActiveModule
{

    function 
__construct(&$bot)
    {
        
parent::__construct(&$botget_class($this));

        
$this -> register_command('all''yg'"GUEST");

        
$this -> help['description'] = "Display player profile from Yellow Gremlin Database";
        
$this -> help['command']['yg <name>']="Display player profile from default server";
                
$this -> help['command']['yg <name> <server>']="Display player profile from <server>";
                
$this -> help['notes'] = "Yellow Gremlin Database url : http://aoc.yg.com";
    }

    function 
command_handler($name$msg$origin)
    {
        if (
preg_match('/^yg (.+) (.+)$/i'$msg$info)) {
            return 
$this -> showprofile($msg$info[1], $info[2]);
        }
        else if (
preg_match('/^yg (.+)$/i'$msg$info)) {
            return 
$this -> showprofile($msg$info[1], "");
        }
        else {
            return (
"##lightyellow##Usage:##end## ##white##<pre>Yg Name Server##end## ##gray##(Default Server: ".$this->bot->dimension.")##end##");
        }
    }

    function 
showprofile($msg$profilename$servername)
    {
        
/* Password to access YG xml data */
        
$password 'type PW here';
        if (
$servername == "")
            
$servername $this->bot->dimension;

        
$yg_link "http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password";
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
if (!empty($ch["content"])) { $xmlprf $ch["content"]; }
else { $xmlprf ""; }
    
        
$xmlobj simplexml_load_string($xmlprf);

        
/*  Done loading xml profile data */

        
if($xmlobj->aocygplayerprofile->name)
        {
            
/* Some text formating */
            
$pvpkills str_replace(".00"""$xmlobj->aocygplayerprofile->pvpkills);
            
$pvpdeaths str_replace(".00"""$xmlobj->aocygplayerprofile->pvpdeaths);
            
$classarray = array("(Priest)""(Rogue)""(Soldier)""(Mage)");
            
$class str_replace($classarray""$xmlobj->aocygplayerprofile->class);
            
$murderer ucfirst($xmlobj->aocygplayerprofile->murderer);

            
/* Player info blob */
            
$blobname "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Character Profile</font>\n";
            
$blobname .= "##seagreen##Name##end## :: ##seablue##".$xmlobj->aocygplayerprofile->name."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->link."##end##\n";
            if(
$xmlobj->aocygplayerprofile->guild)
                
$blobname .= "##seagreen##Guild##end## :: ##seablue##".$xmlobj->aocygplayerprofile->guild."##end## :: ##yellow##".$xmlobj->aocygplayerprofile->guildlink."##end##\n";
            
$blobname .= "##seagreen##Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->level."##end##\n";
            
$blobname .= "##seagreen##Server##end## :: ##seablue##".$xmlobj->aocygplayerprofile->server."##end##\n";
            
$blobname .= "##seagreen##Race##end## :: ##seablue##".$xmlobj->aocygplayerprofile->race."##end##\n";
            
$blobname .= "##seagreen##Class##end## :: ##seablue##".$xmlobj->aocygplayerprofile->class."##end##\n";
            
$blobname .= "##seagreen##Gender##end## :: ##seablue##".$xmlobj->aocygplayerprofile->gender."##end##\n";
            
$blobname .= "##seagreen##PvP Level##end## :: ##seablue##".$xmlobj->aocygplayerprofile->pvplevel."##end##\n";
            
$blobname .= "##seagreen##K/D Ratio##end## :: ##seablue##".$pvpkills."/".$pvpdeaths." = ".$xmlobj->aocygplayerprofile->kdratio."##end##\n";
            
$blobname .= "##seagreen##Professions##end## :: ##seablue##".$xmlobj->aocygplayerprofile->professions."##end##\n";
            
$blobname .= "##seagreen##Murderer##end## :: ##seablue##".$murderer."##end##\n<center> </center>";
            
$blobname .= "<font face='hyboriansmall' color='orange'>Equipped Items</font>\n";
            for(
$i=0$i<=16$i=$i+1) {
                if (
$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname)
                    
$blobname .= "##seagreen##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->slotname."##end## :: ##seablue##".$xmlobj->aocygplayerprofile->equipment->slot[$i]->itemname."##end##\n";
            }

            
/* If member of a guild, fetch Guild xml data */
            
if($xmlobj->aocygplayerprofile->guild)
            {
                
/* Text formating */
                
$guildid =  str_replace("guild""guildxml"$xmlobj->aocygplayerprofile->guildlink);


                
$yg_link "$guildid&pwd=$password";
        
$ch $this -> bot -> core("tools") -> get_site($yg_link1);
        if (!empty(
$ch["content"])) { $xmlgld $ch["content"]; }
        else { 
$xmlgld ""; }

                
$xmlguild simplexml_load_string($xmlgld);

                
/*  Done loading xml guild data */

                /* Guild info blob */
                
$blobguild "<center><font face='hyborianlarge' color='yellow'>Yellow Gremlin</font></center>\n";
                
$blobguild .= "<font face='hyboriansmall' color='orange'>Guild Profile</font>\n";
                
$blobguild .= "##seagreen##Guild##end## :: ##seablue##".$xmlguild->aocygguild->name."##end## :: ##yellow##".$xmlguild->aocygguild->guildlink."##end##\n";
                
$blobguild .= "##seagreen##Server##end## :: ##seablue##".$xmlguild->aocygguild->server."##end##\n";
                
$blobguild .= "##seagreen##Members##end## :: ##seablue##".$xmlguild->aocygguild->member_count."##end##\n";
                
$blobguild .= "##seagreen##Murderers##end## :: ##seablue##".$xmlguild->aocygguild->murderers."##end##\n";
                
$blobguild .= "##seagreen##Average Level##end## :: ##seablue##".$xmlguild->aocygguild->averagelvl."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Level##end## :: ##seablue##".$xmlguild->aocygguild->averagepvplvl."##end##\n";
                
$blobguild .= "##seagreen##Total Kills##end## :: ##seablue##".$xmlguild->aocygguild->totalkills."##end##\n";
                
$blobguild .= "##seagreen##Total Deaths##end## :: ##seablue##".$xmlguild->aocygguild->totaldeaths."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Kills##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpkills."##end##\n";
                
$blobguild .= "##seagreen##Average PVP Deaths##end## :: ##seablue##".$xmlguild->aocygguild->averagepvpdeaths."##end##\n";
                
$blobguild .= "##seagreen##K/D Ratio##end## :: ##seablue##".$xmlguild->aocygguild->kdratio."##end##\n";
            }

            
/* Output info */
            
$result "##yellow##[-YG-]##end## ##white##:: ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->name$blobname);
            if(
$xmlobj->aocygplayerprofile->guild)
                
$result .= " / ".$this->bot->core("tools")->make_blob($xmlobj->aocygplayerprofile->guild$blobguild);
            
$result .= " :: [ ##seagreen##L".$xmlobj->aocygplayerprofile->level."##end## | ##seagreen##";
            
$result .= $class."##end##| ##seablue##L".$xmlobj->aocygplayerprofile->pvplevel."##end## | ##seablue##";
            
$result .= $pvpkills."/".$pvpdeaths."##end## | ##seablue##".$xmlobj->aocygplayerprofile->kdratio."##end## ]##end##";

            return 
$result;
        }
        else
        {
            
/* No profile found */
            
$profilename ucfirst(strtolower($profilename));
            
$servername ucfirst(strtolower($servername));
            
$blob "##yellow##[-YG-]##end## ##white##::##end## ##red##No profile found for ##lightyellow##$profilename##end## on server ##lightyellow##$servername##end##.##end##";
            return 
$blob;
        }

    }

}
?>
Title: Re: AoC YG player profile module
Post by: Getrix on February 10, 2010, 04:54:25 pm
Its probly because aoc.yg.com is down atm...

http://aoc.yg.com/

EDIT: down / up, unstable :P
Title: Re: AoC YG player profile module
Post by: Drizzurdeen on February 11, 2010, 12:41:55 pm
hmmmm realy ??? ... the yg-module works perfekt by me ... no probs and we us ist very often ... maybe just luck ^^

greez da drizz

ps: btw. @getrix how is the other module going on *gg*
Title: Re: AoC YG player profile module
Post by: Tsamoonia on October 16, 2010, 08:16:48 am
can someone tel me when i log into yg site... where on teh home page am i supposed to go to contact whoever it is for an xml password.  i dont see anything about contacting anyone or requesting anything
Title: Re: AoC YG player profile module
Post by: Tsamoonia on October 21, 2010, 10:00:50 pm
is anyone available to help me?  i know this is an old topic and maybe some things have changed on how this is done.   any ideas on what i should do... how do i get a hold of the YG guy for a password
Title: Re: AoC YG player profile module
Post by: BoA-Gert on October 22, 2010, 12:54:09 am
Register and login on the YG site, once that's done click your name at the top right, then Age of Conan to show:

Quote
Age of Conan Settings

You can request access to our AoC database's XML System here..

That will get you the access...


And the info on their site:

Quote
If you do not have a password yet and wish to request one please create a YG Member account if you do not already have one and go to the Age of Conan tab under the My Account section and click the Request Access button.
Title: Re: AoC YG player profile module
Post by: Tsamoonia on October 27, 2010, 01:14:19 pm
ty very much.  i got it now :)
Title: Re: AoC YG player profile module
Post by: Huesos on December 11, 2010, 10:42:43 pm
everything has been working a for over a year now til today, yg has some changes on their site..

Code: [Select]
[11-Dec-2010 22:05:13] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:05:13] PHP Warning:  simplexml_load_string(): Resource temporarily unavailable in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:05:13] PHP Warning:  simplexml_load_string(): ^ in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:10] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:10] PHP Warning:  simplexml_load_string(): Resource temporarily unavailable in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:10] PHP Warning:  simplexml_load_string(): ^ in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:32] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:32] PHP Warning:  simplexml_load_string(): Resource temporarily unavailable in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:09:32] PHP Warning:  simplexml_load_string(): ^ in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:12:40] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:12:40] PHP Warning:  simplexml_load_string(): Resource temporarily unavailable in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:12:40] PHP Warning:  simplexml_load_string(): ^ in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:19:58] PHP Warning:  simplexml_load_string(): Entity: line 1: parser error : Start tag expected, '<' not found in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:19:58] PHP Warning:  simplexml_load_string(): Resource temporarily unavailable in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86
[11-Dec-2010 22:19:58] PHP Warning:  simplexml_load_string(): ^ in /srv/d_WH446-GANDI/home/BeBot/custom/modules/yg.php on line 86

I think they are having issues with their site and profile lookups directly
Title: Re: AoC YG player profile module
Post by: sarakant on February 04, 2011, 03:51:19 pm
how can I configure the module to get the yg data in german?
Title: Re: AoC YG player profile module
Post by: Yite on February 04, 2011, 04:50:25 pm
on Line 84 where it says:
            $ch = curl_init ("http://aoc.yg.com/profilexml?n=$profilename&srv=$servername&pwd=$password");

Change this to
            $ch = curl_init ("http://aoc.yg.com/de/profilexml?n=$profilename&srv=$servername&pwd=$password");

And do the same on line 91

I didn't test this in the module but was able to get a German profile of myself by hitting:
http://aoc.yg.com/de/profilexml?n=Yite&srv=crom&pwd=XXXXXXXX

Quote
<level>80</level>
<server>Crom (PvE) EU</server>
<serverid>9</serverid>
<race>Stygier</race>
<class>Nekromant (Magier)</class>
<gender>Weiblich</gender>
Title: Re: AoC YG player profile module
Post by: sarakant on February 04, 2011, 05:11:06 pm
it works!
many thx
Title: Re: AoC YG player profile module
Post by: maikee on February 05, 2011, 11:36:15 am
Hi

german language works but it is possible to take the german special chars?

lowcase: ä, ö, ü, ß
uppercase: Ä, Ö, Ü

see the pic below
Title: Re: AoC YG player profile module
Post by: dillinger on February 21, 2011, 07:14:00 am
Hi

german language works but it is possible to take the german special chars?

lowcase: ä, ö, ü, ß
uppercase: Ä, Ö, Ü

see the pic below
Any news on this?

Kind regards

dill
Title: Re: AoC YG player profile module
Post by: Yite on February 21, 2011, 09:49:43 am
I wouldn't know how to fix this, the data pulled down from YG definately has the right characters in it (for example Gürtel)but I guess a charset value of some sort is needed to properly format it. Do other modules that support German show the proper characters (for examples if with Getrix' item db you do a !list Gürtel are the results displayed correctly)?
Title: Re: AoC YG player profile module
Post by: dillinger on February 21, 2011, 01:22:16 pm
Yes, Getrix's Itemquery (!items gürtel) works fine with ä ö ü.
Title: Re: AoC YG player profile module
Post by: Yite on February 21, 2011, 02:54:07 pm
Right, I found the cause of the problem which is the simplexml_load_string.

A google search turned up the following:

Quote
This looks SimpleXML is creating a UTF-8 string, which is then rendered in ISO-8859-1 (latin-1) or something close like CP-1252.

When you save the result to a file and serve that file via a web server, the browser will use the encoding declared in the file.

Including in a web page
Since your web page encoding is not UTF-8, you need to convert the string to whatever encoding you are using, eg ISO-8859-1 (latin-1).

This is easily done with iconv():

    $xmlout = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $xmlout);

Saving to database
You database column is not using UTF-8 collation, so you should use iconv to convert the string to the charset that your database uses.

Assuming your database collation is the same as the encoding that you render in, you will not have to do anything when reading from the database.

Explanation
In UTF-8, a 0xc2 prefix byte is used to access the top half of the "Latin-1 Supplement" block which includes characters such as accented letters, currency symbols, fractions, superscript 2 and 3, the copyright and registered trademark symbols, and the non-breaking space.

However in ISO-8859-1, the byte 0xC2 represents an Â. So when your UTF-8 string is misinterpreted as one of those, then you get  followed by some other nonsense character.

Which hopefully will help some of the more experienced coders here to fix your issue :)
Title: Re: AoC YG player profile module
Post by: dillinger on February 21, 2011, 03:59:37 pm
C'mon Getrix! RULE THE CODE!  8)
Title: Re: AoC YG player profile module
Post by: GaRoN on March 15, 2011, 03:35:24 pm
You only have to change line 160/61:

return $result;

To:

return utf8_decode($result);

and save the PHP in utf8
Title: Re: AoC YG player profile module
Post by: Runemy on June 04, 2011, 06:26:43 pm
After the merge our bot wont update the new default server, any ideas?

And yes, we have logged the bot character and spoken in chat to try to "register" it on fury.
Title: Re: AoC YG player profile module
Post by: Sudoka on June 05, 2011, 10:21:51 pm
After the merge our bot wont update the new default server, any ideas?

And yes, we have logged the bot character and spoken in chat to try to "register" it on fury.

Have you changed the $dimension value in the conf/Bot.conf file to Fury?

If you have, you could try to hard-code the servername. Change line 80 in Yg.php to: $servername = 'Fury';
Title: Re: AoC YG player profile module
Post by: Vainamoinen on August 14, 2011, 04:08:09 pm
I am using this KOS list module http://bebot.link/aoc-modules/kos-module-w-guild-kos/30/ (http://bebot.link/aoc-modules/kos-module-w-guild-kos/30/)


Would it be possible to have a modification to YG.php, so that it would show if searched player is or belongs to a guild that is on KOS?

thanks in advance :)
Title: Re: AoC YG player profile module
Post by: Vainamoinen on August 15, 2011, 04:50:11 pm
Guild mate chipped in and quickly stabbed the code from modified KOS-whois module to YG-module, and it works! So nothing anymore :)
Title: Re: AoC YG player profile module
Post by: Oolwe on October 16, 2011, 07:11:59 pm
How can i make the module work with Russian names please ?
Title: Re: AoC YG player profile module
Post by: Oolwe on October 26, 2011, 09:57:34 am
Up ;)

How can i use this module with Russian alphabet ? language is installed on my linux server but Bebot console show and return in chat ?????? ???? instead of russian name.

console:
Code: [Select]
Piwi [2011-10-26 07:53:32]      [TELL]  [INC]   Eelwo: !yg ????
Piwi [2011-10-26 07:53:33]      [TELL]  [OUT]   -> Eelwo: [-YG-] :: Pas de profile pour le joueur ???? sur le serveur Fury.

IG
Code: [Select]
[09:52] To [Piwi]: !yg ????
[09:52] [Piwi]: [-YG-] :: Pas de profile pour le joueur ???? sur le serveur Fury.

profile exist on YG.Com
http://aoc.yg.com/ru/profiles?s=%D0%AF%D0%BD%D1%8B%D1%87

Any idea ? is it a server probleme or something in the code to change ? i have same probleme with Google traduction module.
SimplePortal 2.3.7 © 2008-2024, SimplePortal