• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

Spammable channel macro

dms

Authorized
Joined
Apr 11, 2016
Hi!

Im trying to make a macro for arcane missiles that's spammable, meaning that it wont cancel and recast the spell while spamming the button. I've tried using supermacro function /smchan which gives me the error:

Error: Invalid spell slot in GetSpellCooldown
File: Interface\AddOns\SuperMacro\SM_Slash.lua
Line: 547
Count: 1

Anyone able to help, or create a similar macro using other scripting?

thanks.
 
Try this
Code:
/script if not IsCurrentAction(1) then UseAction(1) end
2w3oyfm.jpg
 
/smchan passes spell index to GetSpellCooldown function and forgets about the second parameter, book type. When only one param is passed, GetSpellCooldown interprets it as spell id instead of spell index. To fix this find the next lines for function SM_Channel in SM_Slash.lua (lines 545-547 in my v3.15b1):
Code:
    local sp = SM_FindSpell(spell);
    if ( not sp ) then return; end
    local cd = GetSpellCooldown(sp);
and replace with:
Code:
    local sp, book = SM_FindSpell(spell);
    if ( not sp ) then return; end
    local cd = GetSpellCooldown(sp, book);
Although it seems that /smchan macro is equialent to a simple macro like
Code:
/run if not CastingBarFrame.channeling then CastSpellByName("Arcane Missiles") end
The problem is that everything above mentioned is dependent on the default casting bar and might not work if you use an addon that replaces it. For example it does not work with eCastingBar. A more generic code is needed in this case which won't depend on the default casting bar:
Code:
/run local f=CnlSpam if not f then f=CreateFrame("Frame")local s,r="SPELLCAST_CHANNEL_ST",f.RegisterEvent r(f,s.."ART")r(f,s.."OP")f:SetScript("OnEvent",function()this.c=event~=s.."OP"end)CnlSpam=f end if not f.c then CastSpellByName("Arcane Missiles")end
If you happen to have an addon or a macro creating a variable with exactly the same name (CnlSpam) and causing conflicts then just rename both occurrences of CnlSpam to something else. Also managed to make it into 255 symbols and no SM functions used, so should work without super macro as well.
 
Top Bottom