Thread Tools Display Modes
08-30-21, 12:10 PM   #1
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
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.
  Reply With Quote
08-30-21, 12:23 PM   #2
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
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;
  Reply With Quote
09-02-21, 02:20 AM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
09-03-21, 03:13 AM   #4
plopek
A Deviate Faerie Dragon
AddOn Compiler - Click to view compilations
Join Date: Aug 2014
Posts: 18
Focus doesn't really work for me in this case, because I use it for interrupts.

Thanks for the input, tho

Last edited by plopek : 09-03-21 at 03:16 AM.
  Reply With Quote
09-03-21, 07:23 AM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Change it to @target then, instead of @focus.
  Reply With Quote
09-03-21, 07:46 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Yeah, why are you not using @target if you just want it to be the name of your target anyway?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
09-03-21, 11:57 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
From what I see, they're using the two macros as an extra pseudo-focus.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 09-03-21 at 11:59 PM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Macro that edit targets name

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off