WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Macro that edit targets name (https://www.wowinterface.com/forums/showthread.php?t=58913)

plopek 08-30-21 12:10 PM

Macro that edit targets name
 
So I have a macro/script that ads a name of the target in another macro specified in the code to cast Tricks of the Trade on that target.

1).
Lua Code:
  1. /run T = UnitName("target")
  2. /run if not InCombatLockdown() then EditMacro('Tricks', nil, nil, '/cast [@'.. T ..',exists]Tricks of the Trade', nil); print('Tricks_Setup: ' .. T); end;
2).
Lua Code:
  1. /cast [@Plopek,exists]Tricks of the Trade
I would like to be able to add another "/cast Shadowstrike" line like you would normally do by pressing enter - so it would look like that after pressing first macro:

Lua Code:
  1. /cast [@Plopek,exists]Tricks of the Trade
  2. /cast Shadowstrike

Does anyone know if that possible?
Thank you in advance.

plopek 08-30-21 12:23 PM

I've been able to figure it out myself after quick search on StackOverflow - \n acts as enter.
Lua Code:
  1. /run T = UnitName("target")
  2. /run if not InCombatLockdown() then EditMacro('Tricks', nil, nil, '/cast [@'.. T ..',exists]Tricks of the Trade\n/cast Shadowstrike', nil); print('Tricks_Setup: ' .. T); end;

SDPhantom 09-02-21 02:20 AM

Can you not use focus for this? You set focus using a keybind then write a macro to target it.
Code:

/cast [@focus,help,nodead] Tricks of the Trade
/cast Shadowstrike

This is similar to what I do for hunter Misdirection.
I have the intended tank set as focus at all times and use the macro as posted.

plopek 09-03-21 03:13 AM

Focus doesn't really work for me in this case, because I use it for interrupts.

Thanks for the input, tho :)

myrroddin 09-03-21 07:23 AM

Change it to @target then, instead of @focus.

Seerah 09-03-21 07:46 PM

Yeah, why are you not using @target if you just want it to be the name of your target anyway?

SDPhantom 09-03-21 11:57 PM

From what I see, they're using the two macros as an extra pseudo-focus.


All times are GMT -6. The time now is 07:02 AM.

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