DennisWG / Roid-Macros

Vanilla macros on steroids!
MIT License
58 stars 20 forks source link

Would be nice to be able to call SuperMacro macros #50

Closed tyggyr closed 5 years ago

tyggyr commented 5 years ago

I wanted to call SuperMacro's macros using the {macro} syntax. This seems to work; basically it tries to call the system macro, and if that fails, it looks for a SuperMacro macro.

15,34d14
< function Roids.ExecuteMacroBody(body)
<     local lines = Roids.splitString(body, "\n");
<     for k,v in pairs(lines) do
<         ChatFrameEditBox:SetText(v);
<         ChatEdit_SendText(ChatFrameEditBox);
<     end
< end
< 
< -- Attempts to execute a SuperMacro by the given name
< -- name: The name of the macro
< -- returns: Whether the macro was executed or not
< function Roids.ExecuteSuperMacroByName(name)
<     local body = GetSuperMacroInfo(name, "body");
<     if not body then
<       return false;
<     end
< 
<     Roids.ExecuteMacroBody(body);
< end
< 
41c21
<       return Roids.ExecuteSuperMacroByName(name);
---
>         return false;
46c26
<       return Roids.ExecuteSuperMacroByName(name);
---
>         return false;
49c29,33
<     Roids.ExecuteMacroBody(body);
---
>     local lines = Roids.splitString(body, "\n");
>     for k,v in pairs(lines) do
>         ChatFrameEditBox:SetText(v);
>         ChatEdit_SendText(ChatFrameEditBox);
>     end
550c534
< end
---
> end
DennisWG commented 5 years ago

Thank you for the suggestion! I've added this functionality with the latest update, so please make sure to re-download the AddOn!