comparison Modules/Utils.lua @ 94:4ec8611d9466

Fixed Enchanting. I was not getting the ItemID correctly, so enchants could not be mapped to the scrolls they were to created Changed snatch to only add each item once and to only add a snatch for items you don't have API: Added haveMaterials to the item and need to the reagents that get passed to queue destinations. This is in preparation for building a shopping list module.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Wed, 11 Aug 2010 23:48:23 -0700
parents 26f45b6e8d4d
children 53147a647e28
comparison
equal deleted inserted replaced
93:693f664aad2b 94:4ec8611d9466
74 -- Whether item is a link or a name, both should return the full link 74 -- Whether item is a link or a name, both should return the full link
75 local _, itemLink = GetItemInfo (item); 75 local _, itemLink = GetItemInfo (item);
76 if itemLink ~= nil then 76 if itemLink ~= nil then
77 local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") 77 local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
78 tmp_item_cache[item] = tonumber(itemID) 78 tmp_item_cache[item] = tonumber(itemID)
79 else
80 local _, _, _, _, itemID = string.find(item, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
81 tmp_item_cache[item] = tonumber(itemID)
79 end 82 end
80 end 83 end
81 84
82 if tmp_item_cache[item] == nil then 85 if tmp_item_cache[item] == nil then
83 for link, data in pairs(ItemAuditor.db.factionrealm.items) do 86 for link, data in pairs(ItemAuditor.db.factionrealm.items) do
85 if name == item then 88 if name == item then
86 local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?") 89 local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
87 tmp_item_cache[item] = tonumber(itemID) 90 tmp_item_cache[item] = tonumber(itemID)
88 end 91 end
89 end 92 end
90
91 end 93 end
92
93 return tmp_item_cache[item] 94 return tmp_item_cache[item]
94 end 95 end
95 96
96 97
97 function ItemAuditor:GetLinkFromName(itemName) 98 function ItemAuditor:GetLinkFromName(itemName)