AdiButtonAuras

AdiButtonAuras

404k Downloads

GetRuneCount and GetRuneType issue

kjhinds opened this issue ยท 3 comments

commented

Setting up a custom rule for Festering Strike to show a hint when there is either 2 blood or 2 frost runes available.

However, after setting up the code and reloading ui I get a error that states "Using 'GetRuneCount' is forbidden." I added this function and the GetRuneType function to the list of allowed functions RuleDSL.lua in my personal addon files and the rule works as expected with no errors. Is there any problem with this? I admit I'm not nearly as knowledgeable of programming as most so I'm not sure what the purpose of those limited allowed functions really are (preventing users from calling blizzard protected API functions perhaps?)

commented

You don't have to use GetRuneType if you are only interested in blood and frost runes since those have fixed positions (1 and 2 are blood, 3 and 4 are frost). If you however need to account for death runes then you have to use it. I can add GetRuneType to the safe environment as a short term solution though. Maybe we shouldn't test for globals in user rules in the long term, but I'll have to check this with Adirelle first.

commented

This is a protection against too much globals in the code. You can use GetRuneCooldown instead of GetRuneCount without any further modification to the code of ABA.

commented

Thanks for the reply. I did switch to GetRuneCooldown first, but then I'm left with the same error for GetRuneType instead. You can't, as far as I'm aware of, tell whether a rune is blood/death or frost/death without it.