BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: clashbot on January 25, 2010, 05:00:14 am

Title: help with org name from player id
Post by: clashbot on January 25, 2010, 05:00:14 am
working on coding a module to relay alliance members online to a webserver, and have a slight issue with dealing with members that are in the pg. sample of the code is as follows:
Code: [Select]
if ($this -> bot -> core("notify") -> check($name))
{
$botname = $this -> bot -> botname;
$online = $this -> bot -> db -> select("SELECT t1.nickname, t2.level, org_rank, org_name, profession FROM "
. "#___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc=1 "
. "AND botname='".$botname."' ORDER BY profession ASC, t1.nickname ASC");

foreach ($online as $player)
{
$alname .= "|" . $player[0];
$allevel .= "|" . $player[1];
$alprof .= "|" . $player[4];
$alorg .= "|" . $this -> bot -> guildname;
$alrank .= "|" . $player[2];
}

my problem is if the player is in the pg, it is reading their rank and applying it to the guildname of the bot. Of course this doesn't work if the bot in question is a raid bot, as there is no guildid. Is there a way of getting the guild information out of the player itself and what would that be?
Title: Re: help with org name from player id
Post by: Alreadythere on January 26, 2010, 11:43:21 pm
Isn't there the guildname/org_name in the whois table too?
Title: Re: help with org name from player id
Post by: clashbot on January 27, 2010, 01:06:53 am
yes there is alreadythere, unfortunately, I can only mess up code. I am not sure how I would go about implimenting it into my example above. I thought there might be something attached to the $player
Title: Re: help with org name from player id
Post by: Alreadythere on January 27, 2010, 11:45:10 pm
It should be [3] according to your query, yes. If it's empty then it's most likely empty on the table too.
Title: Re: help with org name from player id
Post by: clashbot on January 28, 2010, 01:57:01 am
still have one org that isn't showing up and not sure why on that...will work it out later, for the most part it should be working now
SimplePortal 2.3.7 © 2008-2024, SimplePortal