View Single Post
04-04-13, 09:01 AM   #3
kittykatmax
A Fallenroot Satyr
 
kittykatmax's Avatar
Join Date: Apr 2007
Posts: 21
Originally Posted by Clamsoda View Post
1] There is a way to add macro conditionals to a bit of Lua, and that is through the SecureCmdOptionParse function. I've only used it once, so I don't know that I could provide much insight, but here is the WoWWiki link.

2] You can check for the existence of a unit in two ways: through the UnitExists() function, or by checking that your variable exists. For example,

UnitName("focus") doesn't return anything if the unit doesn't exist, and as such can be used as a sort of conditional.

Lua Code:
  1. if UnitName("focus") then
  2.     -- Unit exists, do stuff.
  3. end

Edit: Here is what I came up. I've got to be off soon, so I didn't have time to login to WoW to test it, but all I did was add a check for the existence of "n" to merit continuing, and I added your realm check logic to later in the macro. Should be sub 255. Let me know if it works!

Lua Code:
  1. /run local n, r = UnitName("focus") if n then SendChatMessage("followme", "WHISPER", nil, n..(r and "-"..r or "")) end

Edit 2: Just kidding, guys get ready in 40 seconds. I tested without a focus, with me as the focus, and with someone cross-realm as the focus, and it worked every time. Enjoy!


Thanks so much! Haven't had a chance to play much but it seems to work.

And, it's so unfair that men can get ready so quickly. /grrrrrrr
  Reply With Quote