a demo.

Other topics not directly related to Budabot (Budabot Items Extractor, AOChatProxy, etc.)
Lucier
The Team
Posts: 58
Joined: Tue Nov 17, 2009 11:27 pm

a demo.

Postby Lucier » Thu Dec 01, 2016 4:58 am

AORDBRipperExtractorDemoThingy.tar.gz
(11.94 KiB) Downloaded 22 times
Someone asked me for my RDB Ripper. That would be a bad idea since the code is a big mess and needs a rewrite. So after some thinking, I'd figure I'd write this RDB Demo Project.

WARNING: This program is only for people who wanna try making their own SQL files with the client RDB data. I coded/ran/tested this in Linux, PHP 5 and on the old AO Client (EP1.) If you have something else, then you might need to do some edits to get it to work. Also this is just a demo. It makes an .SQL file, but I'm not going to say which kind. Why? Because if you try to use this SQL file in your bot it will not work.

All this does, is reads an item from clientRDB and organizes it into an array. Then you can check if you need that item, and copy the parts you want. Then continue to the next item, etc. Here's an example:

Code: Select all

array(4) {
  ["id"]=>
  int(21601)
  [15]=>
  array(14) {
    [54]=>
    int(1)
    [74]=>
    int(80)
    [79]=>
    int(32168)
    [76]=>
    int(0)
    [30]=>
    int(517)
    [0]=>
    int(2151678979)
    [298]=>
    int(0)
    [88]=>
    int(10)
    [2]=>
    int(40)
    [12]=>
    int(26160)
    [211]=>
    int(150)
    [212]=>
    int(100)
    [420]=>
    int(3)
    [688]=>
    int(2)
  }
  [33]=>
  array(2) {
    ["name"]=>
    string(23) "Flamethrower Ammunition"
    ["desc"]=>
    string(41) "This is Ammunition for the flamethrowers."
  }
  [4]=>
  array(2) {
    [13]=>
    array(1) {
      [153]=>
      int(100)
    }
    [12]=>
    array(1) {
      [116]=>
      int(100)
    }
  }
}


Basicly, excluding the 'id' at the top, there are 3 sections for this item. [15] is the Attributes section (QL, Price, Icon, etc.) [33] is the Name/Description part. Finally [4] is ATK/DEF. (Not sure why that's there for ammo though. lol) There are also other groups, and hopefully I put in enough comments everywhere to understand the basics. This is why I'm not really calling this a ripper. There aren't thousands of line of code in here to translate all the numbers into pretty text.

To get this to run, you'll have to edit the php file in the ./PHP directory. Change the $dir at the top to the directory your root AO directory is at. Save, and run the bash file at the root directory. If all goes well you'll see a new .sql file.

When writing your own SQL files, if you're having trouble reading what the numbers are in specific items, in game you can do:

Code: Select all

/tell ttst idblob 21601
This will show the item with some hints of what the numbers mean. Guess you can also use aoitems.com, and use debug mode to see numbers there also.


G'luck!

- Lucier
equi
Member
Posts: 45
Joined: Sun May 24, 2015 9:39 am
antispam: rimor

Re: a demo.

Postby equi » Thu Dec 08, 2016 10:47 pm

i also wrote a parser in pascal^^ was also little bit messy :lol:
but nice work with ttst bot, like the new items function.
if i got time i gonna have a look ;)
Lucier
The Team
Posts: 58
Joined: Tue Nov 17, 2009 11:27 pm

Re: a demo.

Postby Lucier » Sat Dec 10, 2016 9:43 am

equi wrote:i also wrote a parser in pascal^^ was also little bit messy :lol:
I bet. It's a huge pain trying to translate everything. (Especially when modifiers/requirements are missing on the item/nano info) :p
equi wrote:but nice work with ttst bot, like the new items function.
if i got time i gonna have a look ;)
Thanks! It's been a huge help on testserver and makes it pretty easy to find some simple errors (like missing icons, or incomplete criteria.) to report.

- Lucier

Return to “Misc/Tools”

Who is online

Users browsing this forum: No registered users and 1 guest