diff 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
line wrap: on
line diff
--- a/Modules/Utils.lua	Wed Aug 11 22:16:59 2010 -0700
+++ b/Modules/Utils.lua	Wed Aug 11 23:48:23 2010 -0700
@@ -76,6 +76,9 @@
 		if itemLink ~= nil then
 			local _, _, _, _, itemID = string.find(itemLink, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
 			tmp_item_cache[item] = tonumber(itemID)
+		else
+			local _, _, _, _, itemID = string.find(item, "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?")
+			tmp_item_cache[item] = tonumber(itemID)
 		end
 	end
 	
@@ -87,9 +90,7 @@
 				tmp_item_cache[item] = tonumber(itemID)
 			end
 		end
-		
 	end
-	
 	return tmp_item_cache[item]
 end