Thread Tools Display Modes
01-15-24, 01:57 PM   #1
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
There are two basic types of protections: hardware and full.

If it's a hardware protection, the function can only be called with a mouse click or a key press.

If it's a full protection, no custom code can use it at all.

If you're trying to get your code to autocraft it and it's giving you a protected error, try making a secure button and either click it or assign it to a key to continue the craft.
  Reply With Quote
01-15-24, 02:45 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,954
As I suspected, the protected side of the DoCraft function might not be allowed by addons at all.

Debugging:
I don't think there will be much you can do if it isn't erroring out noisily. I suspect because it is being called in a secure environment it is just silently failing because it isn't a Blizzard addon calling it. However, if you don't have Bugsack or Buggrabber installed, you might want to, and see if they see something.


Protected functions with no accessible code:
There is no DoCraft function in the accessible Blizzard code that I can see which could explain why there is no info on it in the wow api code. It's probably one of their behind the scenes code that is just called by valid callers.

It is only used directly in the xml file on the Crafting Button that you click in their UI.
https://github.com/Gethe/wow-ui-sour...rd_CraftUI.xml

Looking for that button control in the lua file to see if they do anything else with it and apart from enabling and disabling I also noticed this line of code. However, like DoCraft(), this GetCraftButtonToken() function doesn't exist anywhere else.

Lua Code:
  1. -- Set the action button text
  2.     CraftCreateButton:SetText(getglobal(GetCraftButtonToken()));
https://github.com/Gethe/wow-ui-sour...raftUI.lua#L99


Did you try making sure the Blizzard addon is loaded to see if it is needed to have access to these functions? :
If you haven't already, you could try making sure that the Blizzard_CraftUI addon is loaded before using it's functionality.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote

WoWInterface » Classic - AddOns, Compliations, Macros » Classic - AddOn Help/Support » Protected function help


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off