view CraftingAddons/Skillet.lua @ 61:d903b0a151d3

Command handler function is now private, no need to keep it global when you can use the global SlashCmdList["INVENTORIUM"](msg) instead. Added database updating mechanism. All database vars are now stored in profiles rather than global. Now refreshing options when a different profile is selected. Fixed an issue with minimum local and global stock values not being inherited from the defaults.
author Zerotorescue
date Wed, 22 Dec 2010 15:04:09 +0100
parents 5006cb0e97c6
children
line wrap: on
line source
do
	
	local function Queue(tradeSkillIndex, amount)
		local link = GetTradeSkillRecipeLink(tradeSkillIndex);
		local recipeId = tonumber(link:match("|Henchant:([-0-9]+)|h"));
		
		local newCommand = Skillet:QueueCommandIterate(recipeId, amount);
		return Skillet:AddToQueue(newCommand);
	end
	
	local function IsEnabled()
		return (Skillet and Skillet.QueueCommandIterate and Skillet.AddToQueue);
	end
	
	IMRegisterCraftingAddon("Skillet", Queue, IsEnabled);
	
end