Archive > 0.5.x Custom/Unofficial Modules

New apf

<< < (2/3) > >>

Zacix:

--- Code: ---<?php
class ItemInfo {
public static function Lookup(Bot $bot,$item) {
$highestid = $item->getHighid() < $item->getLowid() ? $item->getLowid() : $item->getHighid();
$lowid = $item->getHighid() < $item->getLowid() ? $item->getHighid() : $item->getLowid();
$highid = $highestid;
switch($highid) {
case 247103:
$highid = 247107;
$lowid = 247106;
$name = "Pristine Kyr'Ozch Bio-Material";
break;
case 247105:
$highid = 247109;
$lowid = 247108;
$name = "Mutated Kyr'Ozch Bio-Material";
break;
case 247698:
$highid = 247674;
$lowid = 247673;
$name = "Kyr'Ozch Bio-Material - Type 76";
break;
case 247700:
$highid = 247676;
$lowid = 247675;
$name = "Kyr'Ozch Bio-Material - Type 112";
break;
case 247702:
$highid = 247678;
$lowid = 247677;
$name = "Kyr'Ozch Bio-Material - Type 240";
break;
case 247704:
$highid = 247680;
$lowid = 247679;
$name = "Kyr'Ozch Bio-Material - Type 880";
break;
case 247706:
$highid = 247682;
$lowid = 247681;
$name = "Kyr'Ozch Bio-Material - Type 992";
break;
case 247708:
$highid = 247684;
$lowid = 247683;
$name = "Kyr'Ozch Bio-Material - Type 1";
break;
case 247710:
$highid = 247686;
$lowid = 247685;
$name = "Kyr'Ozch Bio-Material - Type 2";
break;
case 247712:
$highid = 247688;
$lowid = 247687;
$name = "Kyr'Ozch Bio-Material - Type 4";
break;
case 247714:
$highid = 247690;
$lowid = 247689;
$name = "Kyr'Ozch Bio-Material - Type 5";
break;
case 247716:
$highid = 247692;
$lowid = 247691;
$name = "Kyr'Ozch Bio-Material - Type 12 ";
break;
case 247718:
$highid = 247694;
$lowid = 247693;
$name = "Kyr'Ozch Bio-Material - Type 3 ";
break;
case 247720:
$highid = 247696;
$lowid = 247695;
$name = "Kyr'Ozch Bio-Material - Type 13";
break;
case 254804:
$highid = 254805;
$lowid = 247765;
$name = "Kyr'Ozch Viral Serum";
break;
default:
$highid = $item->getHighid();
$lowid = $item->getLowid();
$name = $item->getName();
break;
}
$result = $bot->db->select("SELECT icon FROM aodb WHERE aoid = '" . $highid . "'");
if(empty($result)) {
$result = 259166;
}
else {
$result = $result[0][0];
}
$item->setHighid($highid);
$item->setLowid($lowid);
$item->setIconid($result);
$item->setName($name);
}
}
?>
--- End code ---

--- Code: ---<?php
require_once("./includes/Item.php");
require_once("./includes/ItemInfo.php");
class RaidLoot extends ModuleBase {
private static $instance;
protected $values;

protected function __construct(Bot $bot) {
$this->values = array(
"bot"   => $bot
);
}

public static function Create(Bot $bot) {

if(!isset(self::$instance)) {
$o = __CLASS__;
self::$instance = new $o($bot);
}
return self::$instance;
}

public function pgmsg($name, $msg) {
$pre = $this->bot->commpre;
$msg = explode(" ",$msg);

switch(ltrim(strtolower($msg[0]),$pre)) {
case "raidloot":
$this->CreateLootList($name,$msg[1]);
break;
}
}

public function tell($name,$msg) {
$this->pgmsg($name,$msg);
}

public function CreateLootList($name, $type) {
$msg = $this->bot->commpre."loot ";
switch(strtolower($type)) {
case "13":
$msg .= "3 <a href=\"itemref://275916/275916/1\">Biotech Matrix</a> ";
$msg .= "3 <a href=\"itemref://275909/275909/1\">Gelatinous Lump</a> ";
$msg .= "1 <a href=\"itemref://257960/257960/1\">Action Probability Estimator</a> ";
$msg .= "1 <a href=\"itemref://257962/257962/1\">Dynamic Gas Redistribution Valves</a> ";
$msg .= "1 <a href=\"itemref://257968/257968/1\">Hacker ICE-Breaker Source</a> ";
$msg .= "5 <a href=\"itemref://258296/258296/1\">Kyr'Ozch Data Core</a> ";
$msg .= "1 <a href=\"itemref://1/1/1\">Bounty Items</a> ";
$msg .= "1 <a href=\"itemref://257706/257706/1\">Kyr'Ozch Helmet</a>";
break;
case "28":
$msg .= "3 <a href=\"itemref://275914/275914/1\">Kyr'Ozch Circuitry</a> ";
$msg .= "3 <a href=\"itemref://275912/275912/1\">Crystalline Matrix</a> ";
$msg .= "1 <a href=\"itemref://257959/257959/1\">Inertial Adjustment Processing Unit</a> ";
$msg .= "1 <a href=\"itemref://257963/257963/1\">Notum Amplification Coil</a> ";
$msg .= "1 <a href=\"itemref://257968/257968/1\">Hacker ICE-Breaker Source</a> ";
$msg .= "4 <a href=\"itemref://258295/258295/1\">Kyr'Ozch Data Core</a> ";
$msg .= "1 <a href=\"itemref://1/1/1\">Bounty Items</a> ";
$msg .= "1 <a href=\"itemref://257706/257706/1\">Kyr'Ozch Helmet</a>";
break;
case "35":
$msg .= "3 <a href=\"itemref://275906/275906/1\">Odd Kyr'Ozch Nanobots</a> ";
$msg .= "3 <a href=\"itemref://275907/275907/1\">Kyr'Ozch Processing Unit</a> ";
$msg .= "3 <a href=\"itemref://275918/275918/1\">Alpha Program Chip</a> ";
$msg .= "3 <a href=\"itemref://275919/275919/1\">Beta Program Chip</a> ";
$msg .= "1 <a href=\"itemref://257961/257961/1\">Energy Redistribution Unit</a> ";
$msg .= "1 <a href=\"itemref://257964/257964/1\">Visible Light Remodulation Device</a> ";
$msg .= "1 <a href=\"itemref://257968/257968/1\">Hacker ICE-Breaker Source</a> ";
$msg .= "3 <a href=\"itemref://258292/258292/1\">Kyr'Ozch Data Core</a> ";
$msg .= "1 <a href=\"itemref://1/1/1\">Bounty Items</a> ";
$msg .= "1 <a href=\"itemref://257706/257706/1\">Kyr'Ozch Helmet</a>";
break;
}
$this->bot->commands["tell"]["loot"]->pgmsg($name,$msg);
}
}

$raidloot = RaidLoot::Create($bot);

$bot->commands["tell"]["raidloot"] = $raidloot;
$bot->commands["pgmsg"]["raidloot"] = $raidloot;
?>
--- End code ---

Zacix:
Some of the lootlists may be a bit inaccurate when it comes to how many cores that drops and stuff. It should work pretty flawlessly (at least it seems to do in my bot :P).

plugz:
Zacix, is your above post the ported verison of this for bebot?

Zacix:
no....it's the version I use on my bot.

plugz:
Nice layout Zacix, now, how to we add it into our bot :P

I normally dev on Budabot for my orgbot, but I'm using bebot for our org raidbot, so my knowledge is limited

I have all 4 saved as php and ready to import into the modules folder, any particulars needed to get them going from there?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version