CraftSim

CraftSim

2M Downloads

Lua error: attempt to index local 'enchantItemTarget' (a number value)

b-morgan opened this issue ยท 5 comments

commented

While using the addon Skillet to craft the Engineering item Bronze Fireflight I get the following CraftSim error. The Skillet crafting completes successfully.

9x ...ceCraftSim/Modules/CraftQueue/CraftQueue.lua:317: attempt to index local 'enchantItemTarget' (a number value)
[string "@CraftSim/Modules/CraftQueue/CraftQueue.lua"]:317: in function `OnCraftRecipe'
[string "@CraftSim/Init/Init.lua"]:226: in function <CraftSim/Init/Init.lua:183>
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "=[C]"]: in function `CraftRecipe'
[string "@Skillet/SkilletQueue.lua"]:698: in function `ProcessQueue'
[string "@Skillet/SkilletQueue.lua"]:825: in function `CreateItems'
[string "*MainFrame.xml:2930_OnClick"]:2: in function <[string "*MainFrame.xml:2930_OnClick"]:1>

Locals:
self = Frame {
 craftQueue = <table> {
 }
 frame = <table> {
 }
 UI = <table> {
 }
 CraftSimCalledCraftRecipe = false
 currentlyCraftedRecipeData = <table> {
 }
}
recipeData = <table> {
 supportsQualities = true
 reagentData = <table> {
 }
 specializationDataCached = false
 recipeIcon = 4485408
 relativeProfitCached = 1936
 supportsCraftingStats = true
 specializationData = <table> {
 }
 supportsCraftingspeed = true
 isBaseRecraftRecipe = false
 learned = true
 priceData = <table> {
 }
 recipeInfoCached = false
 maxQuality = 5
 concentrationCurveData = <table> {
 }
 recipeInfo = <table> {
 }
 concentrationCost = 0
 baseOperationInfo = <table> {
 }
 isAlchemicalExperimentation = false
 maxItemAmount = 1
 professionStatModifiers = <table> {
 }
 supportsMulticraft = false
 expansionID = 9
 cooldownData = <table> {
 }
 subRecipeDepth = 0
 isOldWorldRecipe = false
 parentRecipeInfo = <table> {
 }
 professionStats = <table> {
 }
 supportsSpecializations = true
 baseProfessionStats = <table> {
 }
 concentrating = false
 isEnchantingRecipe = false
 crafterData = <table> {
 }
 isCrafterInfoCached = true
 isCooking = false
 isSoulbound = false
 recipeID = 376547
 averageProfitCached = 904062.003900
 buffData = <table> {
 }
 minItemAmount = 1
 categoryID = 1606
 baseItemAmount = 1
 isRecraft = false
 resultData = <table> {
 }
 hasQualityReagents = true
 isQuestRecipe = false
 recipeName = "Wildercloth Chef's Hat"
 optimizedSubRecipes = <table> {
 }
 supportsIngenuity = true
 isSimulationModeData = false
 subRecipeCostsEnabled = false
 professionGearCached = false
 hasReagents = true
 concentrationData = <table> {
 }
 isGear = true
 isSalvageRecipe = false
 professionGearSet = <table> {
 }
 supportsResourcefulness = true
 professionData = <table> {
 }
 operationInfoCached = false
 numSkillUps = 1
}
amount = 1
enchantItemTarget = 0
(*temporary) = nil
(*temporary) = 0
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'enchantItemTarget' (a number value)"
CraftSim = <table> {
 COOLDOWNS = <table> {
 }
 STATISTICS = <table> {
 }
 OPTIONAL_REAGENT_DATA = <table> {
 }
 NEWS = <table> {
 }
 CraftRecipeData = <table> {
 }
 DEBUG = <table> {
 }
 PRICE_DETAILS = <table> {
 }
 ProfessionGear = <table> {
 }
 CRAFT_BUFFS = Frame {
 }
 NodeData = <table> {
 }
 PRICE_OVERRIDE = <table> {
 }
 ConcentrationData = <table> {
 }
 LOCAL_MX = <table> {
 }
 ENCHANT_RECIPE_DATA = <table> {
 }
 REAGENT_DATA = <table> {
 }
 COST_OPTIMIZATION = <table> {
 }
 EXPLANATIONS = <table> {
 }
 LibCompress = <table> {
 }
 TopGearResult = <table> {
 }
 ReagentData = <table> {
 }
 LOCAL_DE = <table> {
 }
 CONCENTRATION_TRACKER = <table> {
 }
 SUPPORTERS = <table> {
 }
 LibGraph = <table> {
 }
 OptionalReagentSlot = <table> {
 }
 Reagent = <table> {
 }
 PRICE_APIS = <table> {
 }
 LOCAL_FR = <table> {
 }
 SPECIALIZATION_DATA = <table> {
 }
 LOCAL = <table> {
 }
 UTIL = <table> {
 }
 LOCAL_ES = <table> {
 }
 CraftSimObject = <table> {
 }
 PerkData = <table> {
 }
 ITEM_COUNT = Frame {
 }
 TOPGEAR = <table> {
 }
 PriceData = <table> {
 }
 OptionalReagent = <table> {
 }
 CONCENTRATION_CURVE_DATA = <table> {
 }
 LOCAL_IT = <table> {
 }
 CONTROL_PANEL = <table> {
 }
 ResultData = <table> {
 }
 CraftQueueItem = <table> {
 }
 RECIPE_SCAN = <table> {
 }
 AVERAGEPROFIT = <table> {
 }
 CraftQueue = <table> {
 }
 Buff = <table> {
 }
 BuffData = <table> {
 }
 SIMULATION_MODE = <table> {
 }
 JSONBuilder = <table> {
 }
 OPTIONS = <table> {
 }
 CraftSessionData = <table> {
 }
 INIT = Frame {
 }
 CALC = <table> {
 }
 ProfessionGearSet = <table> {
 }
 SpecializationData = <table> {
 }
 ProfessionData = <table> {
 }
 LOCAL_RU = <table> {
 }
 CraftResultSavedReagent = <table> {
 }
 CraftResultItem = <table> {
 }
 PRICEDATA = <table> {
 }
 LOCAL_CN = <table> {
 }
 CraftResult = <table> {
 }
 LOCAL_EN = <table> {
 }
 ReagentOptimizationResult = <table> {
 }
 ProfessionStat = <table> {
 }
 Statweights = <table> {
 }
 SalvageReagentSlot = <table> {
 }
 ProfessionStats = <table> {
 }
 GUTIL = <table> {
 }
 CUSTOMER_HISTORY = Frame {
 }
 ReagentListItem = <table> {
 }
commented

Can I ask how Skillet is calling CraftRecipe or CraftEnchant? Since craftsim hooks onto it

commented

I'm not sure I understand the question. The relevant code is here lines 694-699:

	if self.db.profile.queue_one_at_a_time then
		C_TradeSkillUI.CraftRecipe(command.recipeID, command.count, command.optionalReagentsArray, recipeLevel)
	else
		local reagentInfoTbl = self.recipeTransaction:CreateCraftingReagentInfoTbl()
		C_TradeSkillUI.CraftRecipe(command.recipeID, command.count, reagentInfoTbl, recipeLevel)
	end

Because the parameters can be quite complicated, I have a debugging option that uses hooksecurefunc on those functions the sole purpose of which is to capture the parameters sent to those functions in my debug log. If necessary, I can use the Blizzard UI and capture what they generate for some complicated crafts if Skillet doesn't get it right.

I have not added the new applyConcentration argument yet. Can't find any documentation on it.

commented

I think I might have found the error.

For my hook I am always expecting itemTarget (LocationMixin) as 4th argument (in case its CraftEnchant)
but for CraftRecipe the fourth argument might be recipeLevel which is a number

you can check out api documentation ingame actually

/api C_TradeSkillUI list

Thats how I found the changes

commented

Glad you found the error on your end because I was worried that Skillet was doing something (another thing!) wrong. I assume a fix will be forthcomming.

commented

I think it should be fixed now