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?
December 02, 2008, 11:26:12 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 940 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: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
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: 1085


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: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
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: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
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: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
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
Expert
*****
Offline Offline

Gender: Male
Posts: 261


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

Co-Prez of Rising Sun RK1 (1st & only org I will ever belong to)
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
!items database
by Zeephonz
[Today at 08:05:21 PM]

Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11146
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 2
Guests: 18
Total: 20
Elesar1
Vain

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