Aegis Support Board: PHP Inventory Parser - Aegis Support Board

Jump to content

ASB News! ASB 5.0 Beta V2 has now been released!. See here for more Info.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Inventory Parser

#1 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 12 April 2004 - 01:25 AM

After doing a bit of research I have made an inventory parser. This doesn't go though storage, just whatever you have on your character at the moment. It splits it up in to 3 groups, equippable items, usable, and etc. For equippable items it does not output the correct name if the item is identified, it does output the corrent name if the item is augmented such as being carded, refined, or player made.

Refer to my other post here about the structure of the equipItem field in the item table.

Make sure you use the following files for your server:

cardpostfixnametable.txt
cardprefixnametable.txt
idnum2itemdisplaynametable.txt
num2itemdisplaynametable.txt

I have included ones for a default install of asb 2.0.2, but you need to use your own if you have added any custom items to the database and want them to be correctly displayed.

Oh yeah and edit the top of both pages to reflect your own ip's and passwords for the database.

As always, I'll make a non PEAR version upon serious request. Enjoy!

Update: Whoops! Apparently I didn't include the pseudo items from the 'guest' table. Because of that, the script stopped whenever a character had them. For now a little fix has been done to skip over them, hopefully.

Attached File(s)


This post has been edited by serra: 18 April 2004 - 03:58 AM

0

#2 User is offline   echira 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 129
  • Joined: 25-November 03
  • Location:\\texas\houston\

Posted 14 April 2004 - 04:59 AM

*begs for a storeItem analysis*

heheheheh
good work Serra
0

#3 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 14 April 2004 - 05:01 AM

Yah yah I'm working on it. Probably should come out some time this weekend. Reformatting web server and putton ro server on to a dual proc machine currently.
0

#4 User is offline   azndragon 

  • ROCP Creator & SQL God
  • PipPipPipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 15-July 03
  • Location:Brampton, Ontario, Canada

Posted 15 April 2004 - 11:15 AM

Good job on this, the parsing of the .txt files is nice, but could be a problem for those who don't like to patch their clients..like me! :P

This post has been edited by azndragon: 15 April 2004 - 11:23 AM

0

#5 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 15 April 2004 - 09:45 PM

What I had hoped was that this thing would be transparent to whatever modified, or not, version of RO you played. So as long as the server owner updated their own cardpostfixnametable.txt, cardprefixnametable.txt, idnum2itemdisplaynametable.txt, and num2itemdisplaynametable.txt to reflect what is on their server and then used those in conjunction with my script, all would be dandy.
0

#6 User is offline   echira 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 129
  • Joined: 25-November 03
  • Location:\\texas\houston\

Posted 16 April 2004 - 10:56 PM

how hard would it be to make a nonpear version? somehow mine isn't wanting to work right and always messes up here or there in the update.

i'm using the PEAR that came with Uniform Server. :|
0

#7 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 16 April 2004 - 11:21 PM

echira, on Apr 16 2004, 10:56 PM, said:

how hard would it be to make a nonpear version? somehow mine isn't wanting to work right and always messes up here or there in the update.

i'm using the PEAR that came with Uniform Server. :|

It would take a few hours to do it I think. Mind you I have never used the mssql_* functions so there would be a bit of experimenting. Tell me what errors you are getting though. You can also update your pear installation, linky.
0

#8 User is offline   echira 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 129
  • Joined: 25-November 03
  • Location:\\texas\houston\

Posted 17 April 2004 - 01:36 AM

that could be easily solved by requiring the memory.php that comes with the ACP. it contains all the connectdatabase and mssql_ functions with it,and what it doens't auto do, i could do myself.

you wouldn't mind if i made this into an ACP mod wouldn't you?
0

#9 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 17 April 2004 - 06:35 AM

echira, on Apr 17 2004, 01:36 AM, said:

that could be easily solved by requiring the memory.php that comes with the ACP. it contains all the connectdatabase and mssql_ functions with it,and what it doens't auto do, i could do myself.

you wouldn't mind if i made this into an ACP mod wouldn't you?

As I said, would probably be a couple hours for me to include the stuff in memory.php and then test it all out a few times to make sure everything is kosher. If you want to do it yourself, I have no problems with that. I think the functions that would need a bit of conversion are is_equip, is_usable, is_etc, and num2name or something like that.

is_equip, is_usable, is_etc are all very similar. They just go through their respective table only getting the ID column, tossing that in to an array, and look for a match to the number that is the arguement of the function, returning true if it found something, false if not. num2name is similar, only this time returning the name of the character that matches the id, 'unknown' if no match is found.

I was planning to make some sort of character management thing in the future, but if you beat me to the punch, no harm done. You can use any of my scripts if you want, edit them, call them your own, redistribute them, sell them, I don't really mind.
0

#10 User is offline   echira 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 129
  • Joined: 25-November 03
  • Location:\\texas\houston\

Posted 17 April 2004 - 01:47 PM

lol i wish i had written the ACP, but that credit goes to Nucleo, but i'll see what i can do hehe. :(
0

#11 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 17 April 2004 - 09:04 PM

From the looks of it, storeItem appears to be in the same format as equipItem, except that all 3/5/28 characters share the same storage, meaning its per account ID. I am going to venture a guess and cartItem is going to be exactly the same as equipItem. I don't see why there should be a difference between the three, but I'll look in to it more later.
0

#12 User is offline   Veriad 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 45
  • Joined: 28-January 04

Posted 18 April 2004 - 05:54 PM

item, storeItem, and cartItem all use the same format. I've already checked it.
0

#13 User is offline   echira 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 129
  • Joined: 25-November 03
  • Location:\\texas\houston\

Posted 18 April 2004 - 09:09 PM

i tried to convert it to php using the ACP and got a headache and went off to make a quest NPC. sorry, i'm not that skilled in php to do all that funky *Beep*. :X
0

#14 User is offline   Radamanthys 

  • Advanced Member
  • PipPipPipPipPip
  • Group: Members
  • Posts: 254
  • Joined: 31-December 03

Posted 07 June 2004 - 11:43 AM

can you add items inside inventory or storage via database?
0

#15 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 09 June 2004 - 07:47 PM

Yes. For example the query:

UPDATE item SET equipItem = CAST( 0x0100be04013a000003000000000000000000000000 as varbinary(256)) WHERE GID = '100399'

Will set, NOT APPEND, the carried equipment for the character to whatever that string of hex corresponds to. According to my notes, its an identified dagger of some sort.
0

#16 User is offline   skyiing 

  • Expert Member
  • PipPipPipPipPipPip
  • Group: ASB Staff
  • Posts: 592
  • Joined: 01-May 03
  • Gender:Male

Posted 12 July 2004 - 08:11 PM

Warning: main(DB.php): failed to open stream: No such file or directory in c:\inetpub\wwwroot\item\parse_item.php on line 21

Fatal error: main(): Failed opening required 'DB.php' (include_path='.;c:\php4\pear') in c:\inetpub\wwwroot\item\parse_item.php on line 21

db.php not include at package
0

#17 User is offline   serra 

  • Average Member
  • PipPipPipPip
  • Group: Members
  • Posts: 123
  • Joined: 26-May 03

Posted 13 July 2004 - 09:40 PM

You have to install pear. pear::DB specifically.

This post has been edited by serra: 13 July 2004 - 09:42 PM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users