collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: AoC YG player profile module  (Read 58080 times)

0 Members and 1 Guest are viewing this topic.

Offline Poonjab

  • BeBot User
  • **
  • Posts: 59
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #30 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.

Offline Tomate

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #31 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.

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #32 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);
« Last Edit: November 06, 2009, 07:51:07 am by Getrix »
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #33 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

?>

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #34 on: October 30, 2009, 09:45:31 am »
Updated my last post
« Last Edit: November 06, 2009, 07:51:28 am by Getrix »
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #35 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 ]
« Last Edit: October 30, 2009, 06:06:07 pm by keirou »

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #36 on: November 02, 2009, 01:06:54 am »
any help???

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #37 on: November 02, 2009, 02:19:48 am »
         $result .=  " :: ". $this -> whois_yg($source, $name);
not
         $result .=  " :: ". $this -> whois_yg($source, $who);


;)

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #38 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
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline Margon

  • BeBot Apprentice
  • ***
  • Posts: 80
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #39 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..

Offline squattinbull

  • BeBot User
  • **
  • Posts: 29
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #40 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

:)

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: AoC YG player profile module
« Reply #41 on: January 18, 2010, 11:04:28 am »
register and request your xml password
http://members.yg.com/

Offline IKShadow

  • BeBot User
  • **
  • Posts: 35
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #42 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.

Offline Drizzurdeen

  • BeBot Apprentice
  • ***
  • Posts: 193
  • Karma: +0/-0
    • Obsidian-Cult
Re: AoC YG player profile module
« Reply #43 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;
        }

    }

}
?>

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: AoC YG player profile module
« Reply #44 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
« Last Edit: February 10, 2010, 04:56:22 pm by Getrix »
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 177
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal