WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   WoWI's Pick(s) of the Week (https://www.wowinterface.com/forums/forumdisplay.php?f=79)
-   -   Pick for 2/22: CompressMacro (updated) (https://www.wowinterface.com/forums/showthread.php?t=51956)

Seerah 02-22-15 08:49 PM

Pick for 2/22: CompressMacro (updated)
 
CompressMacro:



Having trouble fitting your macro into the 255 character limit? There are many aliases for slash commands that you may not be aware of, that can help you squeeze in that last spell or the final word of your trade message. Simply enter your macro text into the top window of the CompressMacro frame and a compressed version (if possible) will be shown to you underneath. It also provides a list of in-game slash commands, including those registered by addons, for your reference.

Get the most out of your macros, and check this out here.



For previous Picks of the Week, visit our PotW archive forum.

Are you the author of a mod that you think belongs in this spotlight? Just upload/update it to WoWInterface, and it will automatically be considered for that week's Pick. :)

Banknorris 02-22-15 09:46 PM

This script eliminate the use of #showtooltip:
Lua Code:
  1. hooksecurefunc(GameTooltip,"SetAction",function(self,action)
  2.     local action_type,macro_id = GetActionInfo(action)
  3.     if action_type=="macro" then
  4.         local _,_,spell_id = GetMacroSpell(macro_id)
  5.         if spell_id then
  6.             GameTooltip:SetSpellByID(spell_id)
  7.         else
  8.             local _,link = GetMacroItem(macro_id)
  9.             if link then
  10.                 local item_id = tonumber(link:match("item:(%d+)"))
  11.                 GameTooltip:SetItemByID(item_id)
  12.             end
  13.         end
  14.         GameTooltip:Show()
  15.     end
  16. end)
So a macro like:
Code:

#showtooltip
/cast [@focus,harm][]Wind Shear

becomes

Code:

/cast [@focus,harm][]Wind Shear
but if you have something like this

Code:

#showtooltip Hex
/cast Nature's Swiftness
/cast Hex

you will not get benefit from it, you will still need to use the whole line.

SDPhantom 02-23-15 12:03 PM

Quote:

Originally Posted by Banknorris (Post 306743)
This script eliminate the use of #showtooltip:
Lua Code:
  1. hooksecurefunc(GameTooltip,"SetAction",function(self,action)
  2.     local action_type,macro_id = GetActionInfo(action)
  3.     if action_type=="macro" then
  4.         local _,_,spell_id = GetMacroSpell(macro_id)
  5.         if spell_id then
  6.             GameTooltip:SetSpellByID(spell_id)
  7.         else
  8.             local _,link = GetMacroItem(macro_id)
  9.             if link then
  10.                 local item_id = tonumber(link:match("item:(%d+)"))
  11.                 GameTooltip:SetItemByID(item_id)
  12.             end
  13.         end
  14.         GameTooltip:Show()
  15.     end
  16. end)

You should use GameTooltip:SetHyperlink(Link) instead of GameTooltip:SetItemByID(ID). This will include suffixes and the associated stats for items that have them.

Banknorris 02-23-15 12:19 PM

Awesome! Thank you very much!


All times are GMT -6. The time now is 01:07 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI