L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 07, 2008, 11:18:54 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Aigen module help
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Aigen module help  (Read 772 times)
0 Members and 1 Guest are viewing this topic.
Diablo
Rookie
**
Offline Offline

Posts: 67


Aigen module help
« on: September 06, 2007, 01: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:
$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);



}

}
?>
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 702



WWW
Re: Aigen module help
« Reply #1 on: September 06, 2007, 08:37:33 AM »

Code:
return "General :: " . $this -> bot -> make_blob("click to view", $ai);
should be
Code:
return "General :: " . $this -> bot -> make_blob("click to view", $ai[$gen]);
Logged
Diablo
Rookie
**
Offline Offline

Posts: 67


Re: Aigen module help
« Reply #2 on: September 06, 2007, 10:02:21 AM »

Ok changed that now just blank info window. Doesnt seem to be reading the info. Should the general names be in "s or anything?
Logged
Diablo
Rookie
**
Offline Offline

Posts: 67


Re: Aigen module help
« Reply #3 on: September 06, 2007, 10:26:43 AM »

Added "s around gen names and now they read correctly. Now just gotta get them to read upper and lower case. Thxs

$ai["ankari"]
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1023


Re: Aigen module help
« Reply #4 on: September 06, 2007, 10:30:13 AM »

strtolower($gen) is your friend, just leave the index names in all lower case then.
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 702



WWW
Re: Aigen module help
« Reply #5 on: September 06, 2007, 10:32:01 AM »

add at beginning of function make_aigen

Code:
$gen = ucfirst(strtolower($gen));
will change to same format as u have
Logged
Diablo
Rookie
**
Offline Offline

Posts: 67


Re: Aigen module help
« Reply #6 on: September 06, 2007, 01:12:30 PM »

Cool thxs
Logged
boogyman
Freshman
*
Offline Offline

Posts: 10


Re: Aigen module help
« Reply #7 on: April 25, 2008, 04:59:31 AM »

is there a completed version of this mod posted somewhere?

~boogy
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 702



WWW
Re: Aigen module help
« Reply #8 on: April 25, 2008, 06:08:11 AM »

http://bebot.shadow-realm.org/0-2-x-customunofficial-modules/general-drop-module/msg3451/#msg3451
Logged
boogyman
Freshman
*
Offline Offline

Posts: 10


Re: Aigen module help
« Reply #9 on: April 25, 2008, 04: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
Logged
boogyman
Freshman
*
Offline Offline

Posts: 10


Re: Aigen module help
« Reply #10 on: April 28, 2008, 04: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
Logged
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 702



WWW
Re: Aigen module help
« Reply #11 on: April 28, 2008, 08:02:58 PM »

i posted 1 yesterday

http://bebot.shadow-realm.org/0-5-x-customunofficial-modules/aiboss-or-aigen/
Logged
boogyman
Freshman
*
Offline Offline

Posts: 10


Re: Aigen module help
« Reply #12 on: April 29, 2008, 04:12:53 PM »

My bad.....was just trying to help

~boogy
Logged
Nytridr
Experienced
****
Offline Offline

Posts: 241


WWW
Re: Aigen module help
« Reply #13 on: May 05, 2008, 10:00:34 PM »

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:
return "AI drops :: " . ($this -> bot -> core("tools") -> make_blob("click to view", $list));

« Last Edit: May 05, 2008, 11:11:46 PM by Nytridr » Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Aigen module help
« previous next »
 
Jump to:  

Recent
Help with online info in ...
by Barlyman
[Today at 07:56:24 PM]

BeBot v0.5.3 released (de...
by Temar
[Today at 07:51:18 PM]

Security
by Alreadythere
[September 06, 2008, 10:02:42 AM]

Probs with relay from gue...
by Temar
[September 06, 2008, 09:03:06 AM]

Raid spam in guild chat
by Temar
[September 06, 2008, 09:01:18 AM]

Org Relaying
by Nytridr
[September 06, 2008, 01:34:35 AM]

Link 2 Guilds via 2 Bots?
by Temar
[September 05, 2008, 04:22:40 PM]

SVN download
by clashbot
[September 05, 2008, 05:12:59 AM]

TWC
by Temar
[September 05, 2008, 12:27:23 AM]

How to find the guild ID?...
by Irinir
[September 03, 2008, 02:58:54 PM]
Stats
Members
Total Members: 965
Latest: morisey
Stats
Total Posts: 10414
Total Topics: 1413
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 20
Total: 22
egrath
blackspell

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.496 seconds with 28 queries. (Pretty URLs adds 0.062s, 4q)
Loading...