BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: Diablo on September 06, 2007, 08:12:17 am

Title: Aigen module help
Post by: Diablo on September 06, 2007, 08:12:17 am
Im trying to convert aigen module to work with bebot it give link back but only displays array maybe someone can help see where problem is thanks.
Code: [Select]
$aigen = new Aigen($bot);

$commands["tell"]["aigen"] = &$aigen;
$commands["pgmsg"]["aigen"] = &$aigen;
$commands["gc"]["aigen"] = &$aigen;

/*
The Class itself...
*/
class Aigen
{
var $bot;



/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function Aigen (&$bot)
{
$this -> bot = &$bot;

$this -> bot -> accesscontrol -> create('all', 'aigen', 'GUEST');


$this -> help['description'] = "Gives information on general drops";
$this -> help['command']['aigen <expression>'] = "Shows the result of the general <expression>";
}

/*
This gets called on a tell with the command
*/
function tell($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "aigen (Ankari|Ilari|Rimah|Jaax|Xoch|Cha)/i", $msg, $info))
$this -> bot -> send_tell($name, $this -> make_aigen($info[2]));
else
$this -> bot -> send_help($name);
}



/*
This gets called on a msg in the privgroup with the command
*/
function pgmsg($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "aigen (Ankari|Ilari|Rimah|Jaax|Xoch|Cha)/i", $msg, $info))
$this -> bot -> send_pgroup($this -> make_aigen($info[2]));
}



/*
This gets called on a msg in the guildchat with the command
*/
function gc($name, $msg)
{
if (preg_match("/^" . $this -> bot -> commpre . "aigen (Ankari|Ilari|Rimah|Jaax|Xoch|Cha)/i", $msg, $info))
$this -> bot -> send_gc($this -> make_aigen($info[2]));
}


/*
This calculates the implant quality level
*/
function make_aigen($gen)
{
$ai[Ankari] = "<red>Low Evade/Dodge,low AR, casting Viral/Virral nukes.<blue> \nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247145/247145/300'>Arithmetic Lead Viralbots</a>.\n<orange>(Nanoskill / Tradeskill)<blue>\n<img src=rdb://255705></img>\n<a href='itemref://247684/247684/300'>Kyr'Ozch Bio-Material - Type 1</a></br><br><img src=rdb://255705></img>\n<a href='itemref://247685/247685/300'>Kyr'Ozch Bio-Material - Type 2</a>";
$ai[Ilari]="<red>Low Evade/Dodge.<blue>\nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247146/247146/300'>Spiritual Lead Viralbots</a>.<orange>\n(Nanocost / Nanopool / Max Nano)<blue>\n<img src=rdb://255705></img>\n<a href='itemref://247681/247681/300'>Kyr'Ozch Bio-Material - Type 992</a>\n<img src=rdb://255705></img>\n<a href='itemref://247679/247679/300'>Kyr'Ozch Bio-Material - Type 880</a>";
$ai[Rimah]="<red>Low Evade/Dodge.<blue>\nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247143/247143/300'>Observant Lead Viralbots</a>.<orange>\n(Init / Evades)<blue>\n<img src=rdb://255705></img>\n<a href='itemref://247675/247675/300'>Kyr'Ozch Bio-Material - Type 112</a>\n<img src=rdb://255705></img>\n<a href='itemref://247678/247678/300'>Kyr'Ozch Bio-Material - Type 240</a>";
$ai[Jaax]="<red>High Evade, Low Dodge.<blue>\nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247139/247139/300'>Strong Lead Viralbots</a>.<orange>\n(Melee / Spec Melee / Add All Def / Add Damage)\n<blue><img src=rdb://255705></img>\n<a href='itemref://247694/247694/300'>Kyr'Ozch Bio-Material - Type 3</a>\n<img src=rdb://255705></img>\n<a href='itemref://247688/247688/300'>Kyr'Ozch Bio-Material - Type 4</a>";
$ai[Xoch]="<red>High Evade/Dodge, casting Ilari Biorejuvenation heals.<blue>\nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247137/247137/300'>Enduring Lead Viralbots</a>.<orange>\n(Max Health / Body Dev)<blue></br><br><img src=rdb://255705></img>\n<a href='itemref://247690/247690/300'>Kyr'Ozch Bio-Material - Type 5</a>\n<img src=rdb://255705></img>\n<a href='itemref://247692/247692/300'>Kyr'Ozch Bio-Material - Type 12</a>";
$ai[Cha]="<red>High Evade/NR, Low Dodge.<blue>\nBoss of this type drops:\n\n<img src=rdb://100337></img>\n<a href='itemref://247141/247141/300'>Supple Lead Viralbots</a>.<orange>\n(Ranged / Spec Ranged / Add All Off)\n<img src=rdb://255705></img>\n<a href='itemref://247696/247696/300'>Kyr'Ozch Bio-Material - Type 13</a>\n<img src=rdb://255705></img>\n<a href='itemref://247674/247674/300'>Kyr'Ozch Bio-Material - Type 76</a>";


return "General :: " . $this -> bot -> make_blob("click to view", $ai);



}

}
?>
Title: Re: Aigen module help
Post by: Temar on September 06, 2007, 03:37:33 pm
Code: [Select]
return "General :: " . $this -> bot -> make_blob("click to view", $ai);
should be
Code: [Select]
return "General :: " . $this -> bot -> make_blob("click to view", $ai[$gen]);
Title: Re: Aigen module help
Post by: Diablo on September 06, 2007, 05:02:21 pm
Ok changed that now just blank info window. Doesnt seem to be reading the info. Should the general names be in "s or anything?
Title: Re: Aigen module help
Post by: Diablo on September 06, 2007, 05:26:43 pm
Added "s around gen names and now they read correctly. Now just gotta get them to read upper and lower case. Thxs

$ai["ankari"]
Title: Re: Aigen module help
Post by: Alreadythere on September 06, 2007, 05:30:13 pm
strtolower($gen) is your friend, just leave the index names in all lower case then.
Title: Re: Aigen module help
Post by: Temar on September 06, 2007, 05:32:01 pm
add at beginning of function make_aigen

Code: [Select]
$gen = ucfirst(strtolower($gen));
will change to same format as u have
Title: Re: Aigen module help
Post by: Diablo on September 06, 2007, 08:12:30 pm
Cool thxs
Title: Re: Aigen module help
Post by: boogyman on April 25, 2008, 11:59:31 am
is there a completed version of this mod posted somewhere?

~boogy
Title: Re: Aigen module help
Post by: Temar on April 25, 2008, 01:08:11 pm
http://bebot.link/0-2-x-customunofficial-modules/general-drop-module/msg3451/#msg3451 (http://bebot.link/0-2-x-customunofficial-modules/general-drop-module/msg3451/#msg3451)
Title: Re: Aigen module help
Post by: boogyman on April 25, 2008, 11:28:21 pm
Tried to get module....but JJ site timed out

I am running 0.4.3 of the bot, has JJ's been modified to work with that version of the bot?


~boogy
Title: Re: Aigen module help
Post by: boogyman on April 28, 2008, 11:20:30 pm
thanks anyway for the link, but I finally got this working.  the strtolower function did not seem to work, so I just did things the old fashioned way

~boogy
Title: Re: Aigen module help
Post by: Temar on April 29, 2008, 03:02:58 am
i posted 1 yesterday

http://bebot.link/0-5-x-customunofficial-modules/aiboss-or-aigen/ (http://bebot.link/0-5-x-customunofficial-modules/aiboss-or-aigen/)
Title: Re: Aigen module help
Post by: boogyman on April 29, 2008, 11:12:53 pm
My bad.....was just trying to help

~boogy
Title: Re: Aigen module help
Post by: Nytridr on May 06, 2008, 05:00:34 am
just fyi for the svn version you need to change line 153 to the following and then I beleive it will work with out crashing the bot.. I have not tested it yet though

Code: [Select]
return "AI drops :: " . ($this -> bot -> core("tools") -> make_blob("click to view", $list));

SimplePortal 2.3.7 © 2008-2024, SimplePortal