From 1e6a381c674ca32108fca309ae7ce9fef99fa32c Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Fri, 15 Feb 2013 14:36:47 +0100 Subject: [PATCH] Some cleaning is required --- Lockpicking.lua | 28 +++++++++++++--------------- Molinari.lua | 4 ++-- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Lockpicking.lua b/Lockpicking.lua index a5d44a7..ca0bb86 100644 --- a/Lockpicking.lua +++ b/Lockpicking.lua @@ -37,25 +37,23 @@ function ns.Openable(link) return openable[link:match('item:(%d+)')] end - --- Blacksmith Lockpicking +-- http://www.wowhead.com/items?filter=na=key;cr=86;crs=2;crv=0 local keys = { - (GetSpellInfo(130100)), -- Ghostly - (GetSpellInfo(94574)), -- Obsidium - (GetSpellInfo(59403)), -- Titanium - (GetSpellInfo(59404)), -- Colbat - (GetSpellInfo(20709)), -- Arcanite - (GetSpellInfo(19651)), -- Truesilver - (GetSpellInfo(19649)), -- Golden - (GetSpellInfo(19646)), -- Silver + [GetItemInfo(82960)] = true, -- Ghostly Skeleton Key + [GetItemInfo(55053)] = true, -- Obsidium Skeleton Key + [GetItemInfo(43853)] = true, -- Titanium Skeleton Key + [GetItemInfo(43854)] = true, -- Cobalt Skeleton Key + [GetItemInfo(15872)] = true, -- Arcanite Skeleton Key + [GetItemInfo(15871)] = true, -- Truesilver Skeleton Key + [GetItemInfo(15870)] = true, -- Golden Skeleton Key + [GetItemInfo(15869)] = true, -- Silver Skeleton Key } --- find the highest level key in your bags -function ns.SkeletonKey(link) - for _,v in ipairs(keys) do - if GetItemCount(v) > 0 then - return v +function ns.SkeletonKey() + for key in pairs(keys) do + if(GetItemCount(key) > 0) then + return key end end end diff --git a/Molinari.lua b/Molinari.lua index c2a20d8..682b281 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -26,7 +26,7 @@ function button:PLAYER_LOGIN() -- I wish Blizzard could treat disenchanting the same way disenchanter = IsSpellKnown(13262) rogue = IsSpellKnown(1804) - smith = GetSpellBookItemInfo((GetSpellInfo(2018))) and true + smith = GetSpellBookItemInfo((GetSpellInfo(2018))) GameTooltip:HookScript('OnTooltipSetItem', function(self) local item, link = self:GetItem() @@ -42,7 +42,7 @@ function button:PLAYER_LOGIN() end if(not spell and smith and ns.Openable(link)) then - spell, r, g, b = ns.SkeletonKey(link), 0, 1, 1 + spell, r, g, b = ns.SkeletonKey(), 0, 1, 1 end if(not spell) then -- 1.7.9.5