Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. function mod:GetActionName(button)
  2.     local action;
  3.     if ( type(button) == "number" ) then
  4.         action = button;
  5.     else
  6.         action = button.action;
  7.     end
  8.    
  9.     if ( not action ) then
  10.         return false;
  11.     end
  12.    
  13.     local type, id = GetActionInfo(action);
  14.     if ( (type == "spell" or type == "macro") and id ~= 0 ) then
  15.         local spellName;
  16.         if ( type == "spell" ) then
  17.             spellName = GetSpellInfo(id);
  18.         elseif ( type == "macro" ) then
  19.             spellName = GetMacroSpell(id);
  20.         end
  21.         if ( spellName ) then
  22.             return spellName;
  23.         end
  24.     end
  25.     return false;
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement