WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   nUI: Developer Chat (https://www.wowinterface.com/forums/forumdisplay.php?f=96)
-   -   macro in Addon syntax (https://www.wowinterface.com/forums/showthread.php?t=25171)

Rhamses 07-03-09 09:13 AM

macro in Addon syntax
 
I have nearly completed the revisions I like. But, I am still perplexed by

summonButton:SetAttribute('macrotext', '/cast '..(Locale.Spells.FastCast or "").."\n/cast "..summon)

This will try to cast "fast cast" (Fel Domination)
Then it summons the pet.

But, if FD is on CD, then it gives error sound and error text, but it still completes the pet summon. I would like to remove the error. In a macro, I use


/console Sound_EnableSFX 0

/cast
/cast

/script UIErrorsFrame:Clear()
/console Sound_EnableSFX 1

Could someone help me combine the two?


Rhamses

Vrul 07-03-09 09:42 AM

summonButton:SetAttribute('macrotext', ([[
/console Sound_EnableSFX 0
/cast %s
/cast %s
/script UIErrorsFrame:Clear()
/console Sound_EnableSFX 1
]]):format(Locale.Spells.FastCast or "", summon))

Rhamses 07-03-09 11:05 AM

Awesome! thank you so much!

I do not know if anyone is interested, but I have an addon that creates a "spell book". When clicked, the button flowers to equally spaced children around the original button. These buttons are loaded with the demon spells the lock knows. If one is clicked, it tries to cast fel domination and then the summon the pet. And, just for kicks, (clicks?) an alt click of the pet frame casts health funnel.

N ot very complicated, but it is a step above what I taught myself last which is just changing the events.


All times are GMT -6. The time now is 02:38 PM.

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