This is just a quick and dirty function i wrote to cleanup the roster on a raidbot. It can be improved as you currently have to depend on the echo from the whois function in the bot output to catch some deleted characters (this can be automated now of course, but i just needed a quick way)
It also populates the Whoiscache with all members as a side effect
<?php
function update_whois($name)
{
$result = $this -> bot -> db -> select("SELECT id, nickname FROM members");
for ($i = 0; $i < count($result); $i++)
{
$oldid = $result[$i][0];
$oldname = $result[$i][1];
$tempid = $this -> bot -> aoc -> get_uid ($oldname);
if ($tempid != $oldid )
{
$this -> bot -> send_tell($name, "$oldname ($oldid) seems to have been rerolled to $tempid");
}
else
{
$this -> bot -> whois($oldname);
}
}
}
?>