collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Aigen module help  (Read 4268 times)

0 Members and 1 Guest are viewing this topic.

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
Aigen module help
« 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);



}

}
?>

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Aigen module help
« Reply #1 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]);

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
Re: Aigen module help
« Reply #2 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?

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
Re: Aigen module help
« Reply #3 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"]

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Aigen module help
« Reply #4 on: September 06, 2007, 05:30:13 pm »
strtolower($gen) is your friend, just leave the index names in all lower case then.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Aigen module help
« Reply #5 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

Offline Diablo

  • BeBot User
  • **
  • Posts: 67
  • Karma: +0/-0
Re: Aigen module help
« Reply #6 on: September 06, 2007, 08:12:30 pm »
Cool thxs

Offline boogyman

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Aigen module help
« Reply #7 on: April 25, 2008, 11:59:31 am »
is there a completed version of this mod posted somewhere?

~boogy

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles

Offline boogyman

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Aigen module help
« Reply #9 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

Offline boogyman

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Aigen module help
« Reply #10 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

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Aigen module help
« Reply #11 on: April 29, 2008, 03:02:58 am »

Offline boogyman

  • BeBot Rookie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Aigen module help
« Reply #12 on: April 29, 2008, 11:12:53 pm »
My bad.....was just trying to help

~boogy

Offline Nytridr

  • BeBot Expert
  • ****
  • Posts: 262
  • Karma: +0/-0
    • Rising Sun
Re: Aigen module help
« Reply #13 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));

« Last Edit: May 06, 2008, 06:11:46 am by Nytridr »
Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 636
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal