BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Wolfbiter on October 23, 2006, 12:20:21 am

Title: Orgrank level - Alts.php function
Post by: Wolfbiter on October 23, 2006, 12:20:21 am
Ever wanted to code a command based on someone rank in org?
This will return someones lowest numeric rank value (0 for president, 1 general/advisor, etc etc...) for any alt of $name

You will have to modify the query ($qry) to fit your whoiscache info!

Code: [Select]
function highest_rank($name) {
$main = $this->main($name);
$alts = $this->get_alts($main);
$alts[] = $main;
$ret = 99;
foreach ($alts as $alt) {
$qry = "select org_rank_id, org_name from whois where name='$alt'";
$whois = $this -> bot -> db -> select($qry);
if ($whois[0][1] == $this->bot->guildname && $whois[0][0] < $ret)
$ret = $whois[0][0];
}
return $ret;
}
Title: Re: Orgrank level - Alts.php function
Post by: Khalem on October 29, 2006, 11:48:57 pm
Nice one :)
SimplePortal 2.3.7 © 2008-2025, SimplePortal