How to extract items.txt from itemInfo.lub

Discussion about everything RO and OpenKore related. This place is NOT for ANY kind of support questions.

Moderator: Moderators

Dark Airnel
Been there done that!
Been there done that!
Posts: 133
Joined: 09 Oct 2009, 01:43
Noob?: No

How to extract items.txt from itemInfo.lub

#1 Post by Dark Airnel »

I just came across a server that does not update the files needed in the tables folder such as idnum2itemdisplaynametable.txt and mapnametable.txt etc. I noticed that those information are now contained in a different file with .lub extension. Is there a way we can automatically extract items.txt, itemsdescriptions.txt, itemslotcounttable.txt, itemslots.txt and the other required files from those .lub files:

Here is an example of how the entries on the files look like:

Code: Select all

tbl = {

--Yggdrasil Custom Vending
	[30000] = {
		unidentifiedDisplayName = "Zeny ",
		unidentifiedResourceName = "¹Ì½º¸±È­",
		unidentifiedDescriptionName = {
		"Used for Vending",
		"^ffffff_^000000",
		"Weight :^777777 7^000000",
		},
		identifiedDisplayName = "Zeny ",
		identifiedResourceName = "¹Ì½º¸±È­",
		identifiedDescriptionName = {
		"Used for Vending",
		"^ffffff_^000000",
		"Weight :^777777 7^000000",
		},
		slotCount = 0,
		ClassNum = 0,
	},
	[30001] = {
		unidentifiedDisplayName = "Cash",
		unidentifiedResourceName = "¹Ì½º¸±È­",
		unidentifiedDescriptionName = {
		"Used for Vending",
		"^ffffff_^000000",
		"Weight :^777777 7^000000",
		},
		identifiedDisplayName = "Cash",
		identifiedResourceName = "¹Ì½º¸±È­",
		"A potion made from ground Red Herbs that restores ^000088about 45 HP^000000.",
		identifiedDescriptionName = {
		"^ffffff_^000000",
		"Weight :^777777 7^000000",
		},
		slotCount = 0,
		ClassNum = 0,
	},
	[4402] = {
		unidentifiedDisplayName = "Aliot Card",
		unidentifiedResourceName = "À̸§¾ø´ÂÄ«µå",
		unidentifiedDescriptionName = {
			"When equipped by",
			"Swordman, Merchant,",
			"and Thief class",
			"characters, this card",
			"adds STR +2 and",
			"Max HP +5%. When",
			"equipped by Archer",
			"class characters, this",
			"card adds INT +2",
			"and Max SP +5%.",
			"Item Class: ^777777Card^000000",
			"Compound on: ^777777Garment^000000",
			"Weight: ^7777771^000000",
		},
	[32710] = {
		unidentifiedDisplayName = "",
		unidentifiedResourceName = "µðÁöÅÐÀÎÈ­±Ç",
		unidentifiedDescriptionName = {
		},
		identifiedDisplayName = "Ticket Smokie",
		identifiedResourceName = "µðÁöÅÐÀÎÈ­±Ç",
		identifiedDescriptionName = {
		},
		slotCount = 0,
		ClassNum = 0
	},

}


main = function()
		for ItemID,DESC in pairs(tbl) do
				result, msg = AddItem(ItemID, DESC.unidentifiedDisplayName, DESC.unidentifiedResourceName, DESC.identifiedDisplayName, DESC.identifiedResourceName, DESC.slotCount, DESC.ClassNum)
				if not result then
						return false, msg
				end
				for k,v in pairs(DESC.unidentifiedDescriptionName) do
						result, msg = AddItemUnidentifiedDesc(ItemID, v)
						if not result then
	return false, msg
						end
				end
				for k,v in pairs(DESC.identifiedDescriptionName) do
						result, msg = AddItemIdentifiedDesc(ItemID, v)
						if not result then
	return false, msg
						end
				end
		end
		return true, "good"
 end
This is just part of it. The file size is ranging from 5MB - 6MB and contains all the items implemented in the server.
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: How to extract items.txt from itemInfo.lub

#2 Post by iMikeLance »

Can you provide the original file?
Dark Airnel
Been there done that!
Been there done that!
Posts: 133
Joined: 09 Oct 2009, 01:43
Noob?: No

Re: How to extract items.txt from itemInfo.lub

#3 Post by Dark Airnel »

The upload option of this site does not allow me to attach the file. I will upload it to one hosting website and paste the link here.
Dark Airnel
Been there done that!
Been there done that!
Posts: 133
Joined: 09 Oct 2009, 01:43
Noob?: No

Re: How to extract items.txt from itemInfo.lub

#4 Post by Dark Airnel »

Please check the file on the link below:

Here it is!
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: How to extract items.txt from itemInfo.lub

#5 Post by iMikeLance »

There's your items.txt http://pastebin.com/2Wix2C3H
If I have more time I can work with the other tables files.
Dark Airnel
Been there done that!
Been there done that!
Posts: 133
Joined: 09 Oct 2009, 01:43
Noob?: No

Re: How to extract items.txt from itemInfo.lub

#6 Post by Dark Airnel »

Thanks! How did you do it? Can it be done just like how you extract monster's information from mon_db.txt for the plugin mobDB?
iMikeLance
Moderators
Moderators
Posts: 208
Joined: 01 Feb 2010, 17:37
Noob?: No
Location: Brazil - MG

Re: How to extract items.txt from itemInfo.lub

#7 Post by iMikeLance »

Dark Airnel wrote:Thanks! How did you do it? Can it be done just like how you extract monster's information from mon_db.txt for the plugin mobDB?
Exactly, but a little more complex since you need to work with blocks. I'll finish this script and post it here.