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?
November 22, 2008, 12:30: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 > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Research plugin
Pages: [1] 2   Go Down
« previous next »
Print
Author Topic: Research plugin  (Read 935 times)
0 Members and 1 Guest are viewing this topic.
pksiazek
Freshman
*
Offline Offline

Posts: 2


Research plugin
« on: January 24, 2007, 05:02:27 PM »

Couldn't find anything similar, so wrote my own  Smiley.

This plugin show extendend information about research. Example output is:

"Research level 9 needs 740,000 SK. Max SK located into research from single kill is 37,000 SK. You must be at least level 190 to get this research level."

Any comments are welcome.
Logged
pusikas
Experienced
****
Offline Offline

Posts: 161


Re: Research plugin
« Reply #1 on: January 24, 2007, 06:12:05 PM »

http://bebot.shadow-realm.org/index.php/topic,580.0.html

Smiley

Your module is a tad more verbose, tho.
Logged

Luuv  Bot-Keeper of Vengeance ^^*
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: Research plugin
« Reply #2 on: January 25, 2007, 08:23:36 AM »

I'll look into this script after work and if it looks good, I'll remove research from my module because, well.. I never really finished that part or made sure the numbers were correct.
Logged

220 Doctor | 220 Adventurer | 220 Shade
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Research plugin
« Reply #3 on: January 25, 2007, 08:58:30 AM »

Level already includes req levels after I modified it and I also added in caps awhile ago as well. Files attached.

Any bugs or incorrect information let me know!
« Last Edit: January 25, 2007, 09:08:59 AM by Malosar » Logged

Eternalist
General of The Syndicate
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: Research plugin
« Reply #4 on: January 25, 2007, 10:00:12 AM »

You should have a seperate table for your ai/rp stuff, Malosar.. instead of adding a bunch of extra cells that has very little to do with the other cells. It's just a very bad structure as it is now.
Logged

220 Doctor | 220 Adventurer | 220 Shade
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Research plugin
« Reply #5 on: January 25, 2007, 10:25:43 AM »

um I just expanded on your own structure where you added in rp values for level 1-10 and had the axp in there for 1-30, so it just needed the real level equivalents for those as well. Probably could have been done in an array instead but your existing structure was there for assigning xp to the level value based on each different type so I went with that.

I didn't really see a need to separate the tables when the data was all there already in 1 table with at least some reference to each other. If you want to separate all the reference data into multiple tables go for it but I didn't think level needs like 4 different lookup tables.
Logged

Eternalist
General of The Syndicate
nebhyper
Rookie
**
Offline Offline

Gender: Male
Posts: 62


Re: Research plugin
« Reply #6 on: January 25, 2007, 10:27:54 AM »

I did the same and just expanded on Wolfbiter code and structure.  However, since at lower levels you don't get SK I added XP.

Code:
function rp($from,$to) {
if ($from > $to && !empty($to)) {
$temp = $from;
$from = $to;
$to = $temp;
}
if ($from < 1 || (($to>10 && !empty($to)) || $from>10))
$ret = "Enter a number between 1 and 10.";
elseif (empty($to)) {
$qry = "select rp from level where level=$from";
$res = $this->bot->db->select($qry);
$qry2 = "select rp2 from level where level=$from";
$res2 = $this->bot->db->select($qry2);
$qry3 = "select capxp from level where level=$from";
$res3 = $this->bot->db->select($qry3);
$qry4 = "select capsk from level where level=$from";
$res4 = $this->bot->db->select($qry4);
$ret = $this->bot->colors->colorize("text","At research level ".$this->bot->colors->colorize("num",$from)." you need ".$this->bot->colors->colorize("num",number_format($res[0][0])." XP")." with a cap of ".$this->bot->colors->colorize("num",number_format($res3[0][0])." XP") ." or ".$this->bot->colors->colorize("num",number_format($res2[0][0])." SK")." with a cap of ".$this->bot->colors->colorize("num",number_format($res4[0][0])." SK").", to get the next research level.");
}
else {
$qry = "select sum(rp) as rp from level where level>$from AND level<=$to";
$res = $this->bot->db->select($qry);
$qry2 = "select sum(rp2) as rp2 from level where level>$from AND level<=$to";
$res2 = $this->bot->db->select($qry2);
$ret = $this->bot->colors->colorize("text","From the beginning of research level ".$this->bot->colors->colorize("num",$from)." to the end of research level ".$this->bot->colors->colorize("num",$to)." you need ".$this->bot->colors->colorize("num", number_format($res[0][0])." XP")." or ".$this->bot->colors->colorize("num", number_format($res2[0][0])." SK"));
}
return $ret;
}
Logged

Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Research plugin
« Reply #7 on: January 25, 2007, 10:44:52 AM »

I guess the cool way to do it would be to get the level of the person requesting the info and refine the values returned to either xp or sk  Smiley Might actually do that....
Logged

Eternalist
General of The Syndicate
pksiazek
Freshman
*
Offline Offline

Posts: 2


Re: Research plugin
« Reply #8 on: January 25, 2007, 11:54:08 AM »

I was thinking about that, but not sure if it'll be good idea.
Probably I'll just do two versions like 'researchxp' and 'researchsk'.
Values can be easily converted between them.
Logged
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: Research plugin
« Reply #9 on: January 25, 2007, 04:56:04 PM »

Quote from: Malosar on January 25, 2007, 10:25:43 AM
um I just expanded on your own structure where you added in rp values for level 1-10 and had the axp in there for 1-30, so it just needed the real level equivalents for those as well. Probably could have been done in an array instead but your existing structure was there for assigning xp to the level value based on each different type so I went with that.

I didn't really see a need to separate the tables when the data was all there already in 1 table with at least some reference to each other. If you want to separate all the reference data into multiple tables go for it but I didn't think level needs like 4 different lookup tables.

I used the "level" cell as a common thing, while you added alvl and rlvl as its own cells. Since it no longer uses a common cell with other level stuff.

Since ao-universe has info on caps etc now, I'll tidy up my script with research (been meaning to a while, just been lazy), but it's a good starting script, pksiazek.

Nebhyper: "select rp, rp2, capxp, capsk from level where level=$from"
Logged

220 Doctor | 220 Adventurer | 220 Shade
nebhyper
Rookie
**
Offline Offline

Gender: Male
Posts: 62


Re: Research plugin
« Reply #10 on: January 25, 2007, 04:58:53 PM »

I was just being lazy.  Would be nicer and cleaner to have seperate tables and use whois cache to get the person lvl that just did the !rp command and make it display cap in XP or SK based on thier level.


Logged

Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Research plugin
« Reply #11 on: January 25, 2007, 07:04:21 PM »

Quote from: Wolfbiter on January 25, 2007, 04:56:04 PM
I used the "level" cell as a common thing, while you added alvl and rlvl as its own cells. Since it no longer uses a common cell with other level stuff.

I don't get it sorry. alvl and rlvl are common with "level" just as axp and rp are common with "level". Your original script got the axp as associated with level and I just added another lookup directly aligned with axp to get the required level as well.

I guess I just don't understand and probably never will if I don't already. You seem to say that the alvl and rlvl are completely unrelated to any other column whereas thats simply untrue.
Logged

Eternalist
General of The Syndicate
Wolfbiter
BeBot Contributor
Apprentice
*******
Offline Offline

Posts: 141



WWW
Re: Research plugin
« Reply #12 on: January 25, 2007, 07:41:56 PM »

Ah, you use alvl and rlvl for the cap, well nevermind me then, I just didn't doublecheck your script.. guess I can always blame on all that extra spacing Wink
Logged

220 Doctor | 220 Adventurer | 220 Shade
Malosar
Expert
*****
Offline Offline

Posts: 259


WWW
Re: Research plugin
« Reply #13 on: January 25, 2007, 09:06:07 PM »

Quote from: Wolfbiter on January 25, 2007, 07:41:56 PM
Ah, you use alvl and rlvl for the cap, well nevermind me then, I just didn't doublecheck your script.. guess I can always blame on all that extra spacing Wink

damn thing, I even tried to take out double lines today and checked it in vi. oh well.
Logged

Eternalist
General of The Syndicate
jjones666
BeBot Contributor
Champion
*******
Offline Offline

Posts: 353


Re: Research plugin
« Reply #14 on: January 26, 2007, 07:46:51 AM »

Quote from: Wolfbiter on January 25, 2007, 07:41:56 PM
I just didn't doublecheck your script.. guess I can always blame on all that extra spacing Wink

ROFL.  This is no excuse ;-P

-jj-
Logged
Pages: [1] 2   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Modules > Modules for older versions > 0.2.x Custom/Unofficial Modules > Topic: Research plugin
« previous next »
 
Jump to:  

Recent
Change text in remember "...
by gerborg
[November 21, 2008, 05:14:57 PM]

Log playtime from buddys ...
by Temar
[November 20, 2008, 10:33:57 AM]

Vote Core module and Simp...
by Temar
[November 19, 2008, 09:26:52 AM]

Restrict access for one m...
by Organizer
[November 19, 2008, 03:21:19 AM]

Custom / Revised Modules ...
by Elesar1
[November 17, 2008, 03:51:46 PM]

TWC
by Temar
[November 16, 2008, 11:39:12 AM]

Are there any FUN modules...
by Elesar1
[November 15, 2008, 07:39:15 PM]

Call to a member function...
by exxie
[November 15, 2008, 09:29:31 AM]

Ported Modules
by Alreadythere
[November 14, 2008, 06:10:07 PM]

cURL and other non-defaul...
by Temar
[November 14, 2008, 04:11:44 PM]
Stats
Members
Total Members: 1235
Latest: DDDepressionnn
Stats
Total Posts: 11037
Total Topics: 1496
Online Today: 18
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 19
Total: 23
xlDanek
Temar
Stealth
gerborg

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.553 seconds with 29 queries. (Pretty URLs adds 0.04s, 4q)
Loading...