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: Research plugin  (Read 5216 times)

0 Members and 1 Guest are viewing this topic.

Offline pksiazek

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Research plugin
« on: January 24, 2007, 11:02:27 pm »
Couldn't find anything similar, so wrote my own  :).

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.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: Research plugin
« Reply #1 on: January 25, 2007, 12:12:05 am »
http://bebot.link/index.php/topic,580.0.html

:)

Your module is a tad more verbose, tho.
Luuv  Bot-Keeper of Vengeance ^^*

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: Research plugin
« Reply #2 on: January 25, 2007, 02:23:36 pm »
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.
Too many toons.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Research plugin
« Reply #3 on: January 25, 2007, 02:58:30 pm »
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, 03:08:59 pm by Malosar »
Eternalist
General of The Syndicate

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: Research plugin
« Reply #4 on: January 25, 2007, 04:00:12 pm »
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.
Too many toons.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Research plugin
« Reply #5 on: January 25, 2007, 04:25:43 pm »
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.
Eternalist
General of The Syndicate

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: Research plugin
« Reply #6 on: January 25, 2007, 04:27:54 pm »
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: [Select]
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;
}
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Research plugin
« Reply #7 on: January 25, 2007, 04:44:52 pm »
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  :) Might actually do that....
Eternalist
General of The Syndicate

Offline pksiazek

  • BeBot Rookie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: Research plugin
« Reply #8 on: January 25, 2007, 05:54:08 pm »
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.

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: Research plugin
« Reply #9 on: January 25, 2007, 10:56:04 pm »
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"
Too many toons.

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: Research plugin
« Reply #10 on: January 25, 2007, 10: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.


Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Research plugin
« Reply #11 on: January 26, 2007, 01:04:21 am »
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.
Eternalist
General of The Syndicate

Offline Wolfbiter

  • Contributor
  • *******
  • Posts: 149
  • Karma: +0/-0
    • KAZE
Re: Research plugin
« Reply #12 on: January 26, 2007, 01:41:56 am »
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 ;)
Too many toons.

Offline Malosar

  • BeBot Expert
  • ****
  • Posts: 259
  • Karma: +0/-0
    • http://www.lowerdimension.com
Re: Research plugin
« Reply #13 on: January 26, 2007, 03:06:07 am »
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 ;)

damn thing, I even tried to take out double lines today and checked it in vi. oh well.
Eternalist
General of The Syndicate

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Research plugin
« Reply #14 on: January 26, 2007, 01:46:51 pm »
I just didn't doublecheck your script.. guess I can always blame on all that extra spacing ;)

ROFL.  This is no excuse ;-P

-jj-

 

* 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: 418
  • 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