Go Back   WowAce Forums > Addon Chat > Libraries
Libraries Threads for new libraries and mixins.

Reply
 
Thread Tools
Old 05-02-2008   #1
Azethoth
Amazing Member
 
Join Date: Jan 2006
Posts: 1,627
Default PeriodicTable-3.1

http://www.wowace.com/projects/libperiodictable-3-1/

I take no responsibility for this lib as I would like to completely blame Nymbia who is the actual author.

Last edited by Azethoth; 10-28-2008 at 09:29 PM.
Azethoth is offline   Reply With Quote
Old 05-02-2008   #2
Azethoth
Amazing Member
 
Join Date: Jan 2006
Posts: 1,627
Default Re: PeriodicTable-3.1

So lets kick this off with a discussion of one thing that sucks in 3.1:
It is no longer compressed. For AutoBar this bloats the data by 500k in the 4 major files that are included vs the exact sets needed. Is there a reason its not compressed? Do we want to start compressing again? human readable is nice for debugging of course.

I am open to suggestions:
One thing I want to do is roll a custom file that AutoBar needs with the exact sets required. Especially under current conditions this saves a lot of memory.

Another idea I had is to pre (post?) process PT3.1 and just save off the results and refresh that when the minor rev changes and then not load the lib when not necessary. So basically for a login session, set access is tracked and the result sets saved off. On next login these sets are available already or if an unknown set is queried PT3.1 loads and gets the new set. Not sure how you would dump stuff that stops being used. Maybe track logins with some ascending number & use cache algorithms to dump apparently unused stuff.

This works great for static PT3.1 use like in AutoBar. Browsing mods would have to skip the mechanism and use the current API. I guess that implies doing this as an API layer on top of PT3.1
Azethoth is offline   Reply With Quote
Old 05-02-2008   #3
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Location: United States
Posts: 8,131
Default Re: PeriodicTable-3.1

I'll repost this in this thread (btw I locked the old one for you Toadkiller)... PeriodicTable-3.0 included an ItemSearch function for searching data; this was useful, for example, for finding out which boss dropped a specific item. Here's an adapted version for 3.1 that works from within an addon (I'm using it in my branch version of TooltipExchange):
Code:
local periodic = LibStub:GetLibrary("LibPeriodicTable-3.1")
local function periodic_ItemSearch(item)
	assert(type(item) == "number" or type(item) == "string", "Invalid arg1: item must be a number or item link")
	item = tonumber(item) or tonumber(item:match("item:(%d+)"))
	if item == 0 then
		self:error("Invalid arg1: invalid item.")
	end
	local matches = {}
	for k,v in pairs(periodic.sets) do
		local _, set = periodic:ItemInSet(item, k)
		if set then
			local have
			for _,v in ipairs(matches) do
				if v == set then
					have = true
				end
			end
			if not have then
				table.insert(matches, set)
			end
		end
	end
	if #matches > 0 then
		return matches
	end
end
__________________
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
Phanx is offline   Reply With Quote
Old 05-13-2008   #4
astaldo2
Hero Member
 
Join Date: Sep 2008
Posts: 601
Default Re: PeriodicTable-3.1

Code:
["Reputation.Reward.Shattered Sun Offensive"]="34675:8,34676:8,34677:8,34680:8,34679:8,34678:8,35753:8,35754:8,35752:8,35755:8,35270:8,35265:8,35245:8,35242:8,35258:8,35267:8,35257:8,35247:8,35221:8,29193:7,34674:7,34666:7,34670:7,34673:7,34671:7,34672:7,34665:7,34667:7,35708:7,35698:7,35699:7,35696:7,35695:7,35697:7,35502:7,35505:7,35271:7,35766:7,35241:7,35259:7,35767:7,35768:7,35769:7,35252:7,34872:6,35500:6,35254:6,35269:6,35268:6,35253:6,35240:6,35239:6,35266:6,35251:6,35238:6,34780:5,35261:5,35250:5,35249:5,35264:5,35263:5,35260:5,35248:5,35262:5,35256:5,35246:5,35255:5,35245:5",
Full listing of rewards for Shattered Sun Offensive Rep.

LibPeriodicTable-3.1\LibPeriodicTable-3.1-Reputation\LibPeriodicTable-3.1-Reputation.lua
astaldo2 is offline   Reply With Quote
Old 05-14-2008   #5
adehh
Member
 
Join Date: Mar 2007
Posts: 13
Default Re: PeriodicTable-3.1

I noticed that trash mob drops aren't in LibPeriodicTable-3.1-InstanceLoot.lua, could they be added simply by doing ["InstanceLoot.Hyjal Summit.Trash Mobs"] for instance?
adehh is offline   Reply With Quote
Old 05-14-2008   #6
jerry
Amazing Member
 
Join Date: Jul 2006
Posts: 1,461
Default Re: PeriodicTable-3.1

Quote:
Originally Posted by adehh
I noticed that trash mob drops aren't in LibPeriodicTable-3.1-InstanceLoot.lua, could they be added simply by doing ["InstanceLoot.Hyjal Summit.Trash Mobs"] for instance?
I think that the problem here is generating the data. Get me a good wowhead filter and I'll add them
jerry is offline   Reply With Quote
Old 05-14-2008   #7
adehh
Member
 
Join Date: Mar 2007
Posts: 13
Default Re: PeriodicTable-3.1

Quote:
Originally Posted by Jerry
I think that the problem here is generating the data. Get me a good wowhead filter and I'll add them
Hehe, I was gonna use the AtlasLoot data - bad idea?
adehh is offline   Reply With Quote
Old 05-14-2008   #8
Phanx
Seal Cub Clubbing Club
 
Phanx's Avatar
 
Join Date: May 2005
Location: United States
Posts: 8,131
Default Re: PeriodicTable-3.1

I don't know that you can filter specifically for trash drops on wowhead. You'd have to start with a list of everything that dropped in the instance, and then remove all items that appeared on a boss's drop list.
__________________
Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge
Troubleshoot an addon | Turn any code into an addon | More addon resources
Need help with your code? Attach or paste your whole, real files.
Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead!
Phanx is offline   Reply With Quote
Old 05-15-2008   #9
adehh
Member
 
Join Date: Mar 2007
Posts: 13
Default Re: PeriodicTable-3.1

Wow I was just going through to do this from the Atlas loot data and it appears someone has already done it!!
adehh is offline   Reply With Quote
Old 05-15-2008   #10
adehh
Member
 
Join Date: Mar 2007
Posts: 13
Default Re: PeriodicTable-3.1

Code:
["Reputation.Rings.The Violet Eye"]="29276,29277,29278,29279,29280,29281,29282,29283,29284,29285,29286,29287,29288,29289,29290,29291",
["Reputation.Rings.The Scale of the Sands"]="29294,29295,29296,29297,29298,29299,29300,29301,29302,29303,29304,29305,29306,29307,29308,29309",
These are the rings ya get after certain reputation milestones with Karazhan and Hyjal, would these work in the reputation file? I'm not really sure on where to put them etc..
adehh is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:48 AM.