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
-
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 :
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
<?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(&$bot, get_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($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_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_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);
/* Check for cURL, and load xml guild data */
if ($this -> curl_check()) {
$ch = curl_init ("$guildid&pwd=$password");
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$xmlgld = curl_exec($ch);
curl_close($ch);
}
else {
$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 = "##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;
}
}
?>
-
You should be able to bypass the issue with $ in password issue entirely by using:
$password = '';
This means php won't try to parse anything between the quotes.
-
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:
<?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(&$bot, get_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_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<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 = "##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;
}
}
}
?>
-
You should be able to bypass the password issue entirely by using:
$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.
-
<-- noob.
whats curl
whats so good about it
why do some use it others not?
-
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
-
<-- 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.
-
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.
-
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)
-
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
-
and thats why it says im a rookie :D hehe
thx guys :) and thanks heaps for the module, working like a charm
-
Lovin this module. Works well after I installed the non-curl version.
-
Not sure why but profiles are not found, and knw mytoon is there on yg
-
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?
-
is it possible to fix some german letters like ä ( ä ) ö( ö ) ü ( ü ) ß ( ß ) in this script? if i use the german xml data i get some letters like "ä" (ä) in the item/charakter names
-
Hi, was under the impression that using this
$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)
-
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...
-
You should be able to bypass the password issue entirely by using:
$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
-
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.
-
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...
$blobname .= "##seagreen##Last updated##end## :: ##seablue##".$xmlobj->aocygplayerprofile->last_updated."##end##\n";
http://forums.yg.com/showthread.php?t=605
-
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
-
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.
-
same here ^^
i sent him a mail and got the password within 2 hours :P
-
!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?
-
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...
-
Thanks Sudoka, worked like a charm and can still search other servers.
-
Tried to request a key via the email method and got the following back:
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
-
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
-
Thanks for letting me know. Updated the first post with the correct procedure.
:)
-
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.
-
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.
-
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.
-
IM NOT GONNA SUPPORT ON THIS HACK. Use on own risk.
Add this to the end of modules/Whois.php (After line 263)
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
$result .= " :: ". $this -> whois_yg($source, $who);
-
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
?>
-
Updated my last post
-
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 ]
-
any help???
-
$result .= " :: ". $this -> whois_yg($source, $name);
not
$result .= " :: ". $this -> whois_yg($source, $who);
;)
-
I gave you only the function, so you need to make sure it gets correct info into the function :p
-
can you post a working whois.php with this fix?
i've modified my whois.php but it doesnt work..
-
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
:)
-
register and request your xml password
http://members.yg.com/
-
Can someone post the complete code how to implement it.
I tried but it does not work .. it does not find any players.
-
<?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(&$bot, get_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_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<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 = "##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;
}
}
}
?>
-
Its probly because aoc.yg.com is down atm...
http://aoc.yg.com/
EDIT: down / up, unstable :P
-
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*
-
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
-
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
-
Register and login on the YG site, once that's done click your name at the top right, then Age of Conan to show:
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:
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.
-
ty very much. i got it now :)
-
everything has been working a for over a year now til today, yg has some changes on their site..
[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
-
how can I configure the module to get the yg data in german?
-
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
<level>80</level>
<server>Crom (PvE) EU</server>
<serverid>9</serverid>
<race>Stygier</race>
<class>Nekromant (Magier)</class>
<gender>Weiblich</gender>
-
it works!
many thx
-
Hi
german language works but it is possible to take the german special chars?
lowcase: ä, ö, ü, ß
uppercase: Ä, Ö, Ü
see the pic below
-
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
-
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)?
-
Yes, Getrix's Itemquery (!items gürtel) works fine with ä ö ü.
-
Right, I found the cause of the problem which is the simplexml_load_string.
A google search turned up the following:
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 :)
-
C'mon Getrix! RULE THE CODE! 8)
-
You only have to change line 160/61:
return $result;
To:
return utf8_decode($result);
and save the PHP in utf8
-
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.
-
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';
-
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 :)
-
Guild mate chipped in and quickly stabbed the code from modified KOS-whois module to YG-module, and it works! So nothing anymore :)
-
How can i make the module work with Russian names please ?
-
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:
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
[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.