Gotta nip this one in the bud right now. Do *NOT* get in the habit of using tables like this, it is very wasteful and only creates needless garbage to be collected. Use the and/or chaining instead, or if you have a very large set of possible values...
Yeah. I should have thrown a disclaimer in my code. My only goal was to get the syntax as I could to his and what I wrote ends up being much closer than properly defining the tables as locals. There are too many things wrong with my proposed code snippet to count.
If you really want a shorter syntax (at least different, anyway) you can use Lua's metatable functionality to do a comparison like:
if [a, b, c] == [1, 2, 3] then return end
But this would be a bad idea.
Edit: Against my better judgment, I have implemented it for you here:
Usage
if Set.new({"Rogue"}) == Set.new({"Rogue", "Shaman", "Warrior"}) then
print("true")
else
print("false")
end
The Code
Set = {}
Set.mt = {}
function Set.new(t)
local set = {}
setmetatable(set, Set.mt)
for i,v in ipairs(t) do set[i] = v end
return set
end
Set.mt.__eq = function(a, b)
local l = (table.maxn(a) >= table.maxn(b)) and a or b
for _,v in ipairs(l) do
if a[1] == v then return true end
end
return false
end
I sure hope no one takes me out back and shoots me.
I highly recommend TourGuide by tekkub. It can be thought of as an alternative to Quest Helper or as a complement (some people use it with Quest Helper on at the same time).
Wrath content is partially completed. Classic and TBC content are complete as far as I know.
I don't know first-hand either. The way it works is is perfect for me but my friend that Jewelcrafts complains of having too many Designs for the Tradeskill UI to be useful.
After taking a look for myself I'm not entirely sure what his problem was. Gems can be used as the sole reagent for, usually, 8-10 different Designs which isn't very high at all.
So please disregard my suggestion. Simplicity outweighs the benefit of any AH-data linking.
This is a very useful AddOn -- thanks for making it.
While this is useful for a number of professions, I don't think it's so useful for Jewelcrafters. Jewelcrafters often have way too many Designs to scan through. I'm not a JC myself but the basic path my friend takes in choosing which jewels to make is asking himself what will sell the best on the AH at the given moment.
What would make this a great AddOn for Jewelcrafters would be to integrate the 'What can I make with this item?' list with Auctioneer or other AH data to sort the list by value-on-the-AH. This could be helpful for players with other professions as well.
I'd be willing to lend a hand once I'm off vacation if needed.
0
Yeah. I should have thrown a disclaimer in my code. My only goal was to get the syntax as I could to his and what I wrote ends up being much closer than properly defining the tables as locals. There are too many things wrong with my proposed code snippet to count.
0
But this would be a bad idea.
Edit: Against my better judgment, I have implemented it for you here:
Usage
The Code
I sure hope no one takes me out back and shoots me.
0
0
Wrath content is partially completed. Classic and TBC content are complete as far as I know.
0
Nope. And I think once he does he'll find it is the improvement he was looking for.
0
After taking a look for myself I'm not entirely sure what his problem was. Gems can be used as the sole reagent for, usually, 8-10 different Designs which isn't very high at all.
So please disregard my suggestion. Simplicity outweighs the benefit of any AH-data linking.
And thanks again for the AddOn.
0
While this is useful for a number of professions, I don't think it's so useful for Jewelcrafters. Jewelcrafters often have way too many Designs to scan through. I'm not a JC myself but the basic path my friend takes in choosing which jewels to make is asking himself what will sell the best on the AH at the given moment.
What would make this a great AddOn for Jewelcrafters would be to integrate the 'What can I make with this item?' list with Auctioneer or other AH data to sort the list by value-on-the-AH. This could be helpful for players with other professions as well.
I'd be willing to lend a hand once I'm off vacation if needed.
0
I like your UI. Any chance you could help me recreate it for a friend?