register_command('all', 'craft', "ANONYMOUS");
$this -> bot -> core("colors") -> define_scheme("GI", "highlight", "yellow");
$this -> bot -> core("colors") -> define_scheme("GI", "normal", "white");
$this -> bot -> core("colors") -> define_scheme("GI", "info", "lightgreen");
$this -> bot -> core("colors") -> define_scheme("GI", "orange", "orange");
$this -> bot -> core("colors") -> define_scheme("GI", "blue", "blue");
$this -> help['description'] = 'A very basic craft script, converted from a guild recruitment module. Just Click on the links for information. It relies on user input to be kept up to date so if nobody tells the module manager what they can craft, the crafter part of the module is useless. I hope you find this usefull. N.';
}
function command_handler($name, $msg, $origin)
{
if (preg_match('/^craft/i', $msg, $info)) {
$words = trim(substr($msg, strlen('craft')));
if ($words == "members")
{
return $this -> memberslist();
} else if($words == "classes") {
return $this -> memberscount();
} else {
return $this -> info();
}
} else if(preg_match('/^grecruit/i', $msg, $info)) {
//return "Command under development";
$msg = $this -> recruit();
$channel = $this -> bot -> core("chat") -> lookup_group("Playfield");
return "Currently under development: ".$channel;
} else {
$this -> bot -> send_help($name);
}
}
/*
craft Info
*/
function info()
{
$txt.= "Culture Weapon, Armour & Components Lists
|Base Armour Materials | Sub Components Materials|
|Weapon Materials | Base Weapon Materials|
(minor) = Gloves Belt and Feet
(major) = Head Chest and Legs
Conqueror materials
Vanaheim Conquest Adornments Atzel's Fortress, Rorik the Ghost (minor)
Vanaheim Conquest Guardings Atzel's Fortress, Rorik the Ghost (major)
Dark Templar material
Hyperborean Grimsword Adornments Atzel's Fortress, Lord Suth (minor)
Hyperborean Grimsword Corslets Atzel's Fortress, Lord Suth (major)
Guardian material
Acheronian Keeper Adornments Onyx Chambers, Mage Bosses (minor)
Acheronian Keeper Armature Onyx Chambers, Mage Bosses (major)
Assassin material
Bossonian Prowlers Accessories Atzel's Fortress, King Atzel the Nithing (minor)
Bossonian Prowlers Guise Atzel's Fortress, King Atzel the Nithing & Talon the Spymaster (major)
Barbarian material
Kushite Savage Howl Trimmings Oasis of Zaara, Middle Boss (minor)
Kushite Savage Howl Pelts Oasis of Zaara, Middle Boss (major)
Ranger material
Zingaran Doomed Path Trimmings Imirian Ravine, First Boss (minor)
Zingaran Doomed Path Trappings Imirian Ravine, First Boss (major)
Demonologist material
White Hand Valewalker Accoutrements Atzel's Fortress, Osithmes (minor)
White Hand Valewalker Raiment Atzel's Fortress, Osithmes (major)
Herald of Xotli material
Nemedian Cursecaller Accoutrements Onyx Chambers, Mage Bosses (minor)
Nemedian Cursecaller Regalia Onyx Chambers, Mage Bosses (major)
Necromancer material
Pictish Cryptbearer Accoutrements Atzes's Fortress, Tainmic (minor)
Pictish Cryptbearer Skins Atzel's Fortress, Tainmic (major)
Bear Shaman material
Shemite Stormwatcher Trimmings Onyx Chambers, Kesh (minor)
Shemite Stormwatcher Coverings Onyx Chambers, Kesh (major)
Priest of Mitra material
Argossean Sunpalmer Items Onyx Chambers, Nefru (minor)
Argossean Sunpalmer Leathers Onyx Chambers, Nefru (major)
Tempest of Set material
Stygian Deathcoil Garnature Onyx Chambers, Neftummon (minor)
Stygian Deathcoil Vesture Onyx Chambers, Neftummon (major)
";
return $this -> bot -> core("tools") -> make_blob("craft", $txt);
}
/*
Still working on this, for now just some random debugging stuff I was trying
*/
function recruit()
{
$blob = "craft: '";
$blob.= $this -> info();
$blob.= " Playfield ID: ";
return $blob;
}
/*
Need to revize so it just uses core
*/
function memberslist()
{
$blob = "";
$count = 0;
$result = $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " . MEMBER . " ORDER BY nickname ASC");
if (!empty($result))
{
$inside = "##blob_title##:::: 's Member List ::::##end##\n \n";
foreach ($result as $val)
{
$count++;
$inside .= "##blob_text##• " . $val[0];
if ($val[1] > 0)
{
$inside .= ", last seen at " . gmdate($this -> bot -> core("settings") -> get("Time", "FormatString"), $val[1]);
}
else
{
$inside .= ", never seen online";
}
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " . $val[0], "[Whois]")."\n";
}
$blob = " :: " . $this -> bot -> core("tools") -> make_blob("click to view", $inside);
}
return $count . " Guild Members:" . $blob;
}
/*
Need to revize so it just uses core
*/
function memberscount()
{
$blob = "";
$total = 0;
$buddies = count($this -> bot -> aoc -> buddies);
//Get a list of professions
$profession_list = "'".$this->bot->core('professions')->get_professions("', '")."'";
$counts = $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
WHERE user_level = " . MEMBER . " AND t2.class IN ($profession_list) GROUP BY class");
foreach ($this -> bot->core('professions')->get_profession_array() as $prof)
$count[$prof] = 0;
if (!(empty($counts)))
{
foreach ($counts as $profcount)
{
$count[$profcount[0]] += $profcount[1];
$total += $profcount[1];
}
}
$inside = "##blob_title##:::: 's Member Count ::::##end##\n";
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
foreach ($count as $key => $value)
$inside .= "\n• ".$key." = ##blob_title##".$value."##end##";
$blob = " :: " . $this -> bot -> core("tools") -> make_blob("click to view", $inside);
return $total . " Guild Classes:" . $blob;
}
}
?>