LUA API question for tradeskill UI

So I have a skeleton project where I can type a slash command and do “something”. I’ve been searching through the API, specifically the functions listed under C_TradeSkillUI, but I haven’t found what I am looking for so that I can add that code to my slash command skeleton

I’m trying to find a function that tells me what the currently selected recipe is (the one being displayed by the tradeskill UI when open). Most every function I’ve seen requires a recipeID, but I’d already have to know which recipe is currently selected to get that. I naively thought it would get something like “GetCurrentRecipe” or “GetSelectedRecipe” but searches for “current” and “selected” turn up empty.

There is something that looks like it could be an event payload, OPEN_RECIPE_RESPONSE, but there aren’t any details on it so I’m not sure what to do with it and honestly I was just hoping to type the slash command, get the data, do a quick calc and display something in my chat, so I’m hoping I don’t need to dive into events.

Anyone know what I can use to get the currently selected recipe?

The reason you can’t find a function for it in C_TradeSkillUI is that all the display logic is done in Lua. It basically retrieves information for every recipe, stores it in a data provider, and uses that as data source for the scroll list. Whenever you select a recipe it uses internal event messaging (not to be confused with frame events) to store the currently selected recipeInfo on the SchematicsForm frame.

Try this. (untested, haven’t logged in for a while)

ProfessionsFrame.CraftingPage.SchematicForm:GetRecipeInfo()
1 Like

I think that works. I did a /dump of that and it gave a lot of info, so I think I can work with that. Ty