Returns a table with the contents of the requested set.
table -
Use this function if you need to display a list of items in a set or something similar.
PT:GetSetTable("Reagent.Ammo")
Returns the set data that PT3 has for a given set, without uncompressing it into a useable form. Will also autogenerate the correct strings for virtual children (which are implied in "c[]" sets) or virtual parents (which are implied in the data hierarchy).
string - The compressed set string for this set.
A quick and simple function for checking the state of a set. Good for keeping an eye on a dynamic custom set.
PT:GetSetStringCompressed("MyAddon.DataB")
Returns the set data that PT3 has for a given set, uncompressed into a usable form. Will also autogenerate the correct strings for virtual children (which are implied in "c[]" sets) or virtual parents (which are implied in the data hierarchy).
string - The uncompressed set string for this set.
A quick and simple function for checking the state of a set. Good for keeping an eye on a dynamic custom set.
PT:GetSetStringUncompressed("MyAddon.DataE")
Find if an item is contained within a set.
string - the value of this item within the given set.
string - the set that this item was found within.
PT:ItemInSet(24468, "Tradeskill.Crafted")
Add custom data to PeriodicTable-3.0
Add data to PT3. Note that you can use this function to overwrite data that's already present, if, for example, a custom set gets changed.
PT:AddData("MyAddon.SetA", "u,11436:Moose,7521:Sock")
PT:AddData("MyAddon", {["MyAddon.SetA"] = "u,11436:Moose,7521:Sock", ["MyAddon.SetB"] = "5132,25443",})
PT:AddData("MyAddon", "$Rev: 23470 $" ,{["MyAddon.SetA"] = "u,11436:Moose,7521:Sock", ["MyAddon.SetB"] = "5132,25443"})
Search for an item in the PT3 data library.
table - a table of all the sets this item is a member of.
This sucker is slow and heavy. It takes about 0.12 seconds for me at the moment. And it needs to uncompress -all- the set's data. The bad news is that this eats a ton of memory, the good news is that it can be reclaimed by the GC directly afterward. I'd suggest only using this when requested by the user, and then running collectgarbage() right afterward. If you must run this automatically, cache the results.
PT:ItemSearch(14373)
Returns the number of sets currently in the PT3 set library. Note that "c[]" style sets will take up more spots after being requested, so don't be alarmed if this number grows during operation.
number - the number of sets.
Just kinda a 'toy' function for statistical purposes.
PT:GetNumSets()
Returns the number of set tables currently in the PT3 cache.
number - the number of sets.
Just kinda a 'toy' function for statistical purposes.
PT:GetNumCachedSets()
Return which one of the items has the higher value.
number - the itemid of the higher valued item.
PT:GetBetter("Rep.Rewards",13221,32002)
Get the highest valued item in this set.
number - the itemid of the highest valued item
number - the value of the highest valued item
PT:GetBest("Rep.Rewards")
Check to see if a set is a multiset.
boolean - true if set is a multiset, false if set is not, nil if set does not exist.
Most handy for determining how to iterate a set table. See :GetSetTable() for more info
PT:IsSetMulti("InstanceLoot.Tempest Keep")
Iterate all the items in a given set.
number - itemid of the item string or boolean - value of the item string - set origin of the item
for item, value, set in PT:IterateSet("Misc.Minipet") do
self:Print(item,value,set)
end
© 2008-2009 Curse Inc.