View Single Post
01-05-13, 08:02 PM   #15
laukond
A Black Drake
Join Date: Dec 2011
Posts: 87
Originally Posted by semlar View Post
Alright, try this one, it should actually work this time.
Lua Code:
  1. local oSetAttribute = getmetatable(ActionButton1).__index.SetAttribute
  2. hooksecurefunc(getmetatable(ActionButton1).__index, 'SetAttribute', function(self, attribute)
  3.     if attribute ~= 'showgrid' then return end
  4.     oSetAttribute(self, 'showgrid', CursorHasSpell() or 0)
  5.     if not HasAction(self.action) then
  6.         self:Hide()
  7.     end
  8. end)

Plus I'm pretty sure my last example had an infinite loop in it, I'm surprised it worked at all.
EDIT4: I got it working with the stuff I use 99% of the time, but I cannot get it working when moving:
  • Companion
  • EquipmentSet

I tried with CursorHasCompanion / EquipmentSet, but it seems they do not exist.


Is there a way to make it work when anything is being dragged?

Edit: I added CursorHasItem() to it, but how do I make it work with macros?
Edit2: HAHA! I just randomly tried CursorHasMacro, and of course it worked!
Edit3: Edited #1 to contain the working code.

You have been a big help really, thank you so much!

Last edited by laukond : 01-05-13 at 08:16 PM.
  Reply With Quote