Page 1 of 2

WoW Classic: Game Helper Macro Error

PostPosted: Wed Sep 25, 2019 6:41 am
by TonyO
My Classic game helper macros work fine, except for something like this: "/script CastSpellByName("Lightning Shield");"
CastSpellByName() is protected, so WoW Classic client throws a warning when this is executed ("A macro script has been blocked from an action only available to the Blizzard UI.").

What should I check? Or, should I even be able to execute protected functions from ISBoxer in classic?

Re: WoW Classic: Game Helper Macro Error

PostPosted: Wed Sep 25, 2019 9:48 am
by MiRai
Macros, like the above, that worked on patch 1.12 fifteen years ago, do not work in Classic.

Re: WoW Classic: Game Helper Macro Error

PostPosted: Thu Sep 26, 2019 12:25 am
by TonyO
It's true. I still write my alogrithm on a rock tablet before I start scripting.
How would you translate this ancient scripture from vanilla:
Code:
local bBuffed = false;
for i=1,40 do
  local name, icon, _, _, _, _ = UnitBuff("player",i)
  if name=="Lightning Shield" then
    bBuffed = true;
  end
end
if not bBuffed then
  CastSpellByName('player', "Lightning Shield");
end

Re: WoW Classic: Game Helper Macro Error

PostPosted: Thu Sep 26, 2019 8:19 am
by MiRai
I honestly couldn't tell you, but making a macro in both Retail and Classic are the same:

https://wow.gamepedia.com/Making_a_macro

Re: WoW Classic: Game Helper Macro Error

PostPosted: Thu Sep 26, 2019 12:48 pm
by TonyO
Thanks, that will help when I do macros.

Re: WoW Classic: Game Helper Macro Error

PostPosted: Fri Oct 04, 2019 5:58 am
by TonyO
I figured out how to do the above with 2 Game Helper macros.
The first WoW macro is assigned a button named LSBuff:
Code:
/cast Lightning Shield


The second WoW macro (LSCheck) checks for Lightning Shield on the player, and disables LSBuff if it's up:
Code:
/run LSBuff:SetEnabled(true);for iI=1,40 do local sN,_,_,_,_,_ = UnitBuff('player',iI); if string.sub(sN,1,16)=='Lightning Shield' then LSBuff:SetEnabled(false);end end


So one of my hotkey keeps Lightning Shield up at all times without excessive casting.

Re: WoW Classic: Game Helper Macro Error

PostPosted: Mon Oct 07, 2019 4:15 am
by Wizeowel
That is a pretty clever loophole. Does it work in combat? Or only good for out-of-combat things like buffs?

Re: WoW Classic: Game Helper Macro Error

PostPosted: Mon Oct 07, 2019 10:08 am
by TonyO
It works all the time so far, 2 days. I made a mapped key with both macros in a single step, LSCheck first.

Re: WoW Classic: Game Helper Macro Error

PostPosted: Tue Oct 08, 2019 4:10 am
by Wizeowel
Awesome, great for thorns and pally buffs and such.

Re: WoW Classic: Game Helper Macro Error

PostPosted: Tue Oct 29, 2019 6:16 am
by TonyO
Wizeowel wrote:That is a pretty clever loophole. Does it work in combat? Or only good for out-of-combat things like buffs?

In combat mode, Button:SetEnabled() is now protected. My interface becomes tainted even if "ISBoxer" addon created the button, and ISBoxer is clicking.
Your first thought was correct, or it is now. This no longer works for me in combat, and it shouldn't.