I'm playing assa rogue in pve and I want to keep rolling rupture on multiple targets. In arena its easy with /arena1,2,3 but theres no such an option in pve which is - of course - understandable. Therefore having just one focus frame isn't enough for me.
First, i want to create a really simple addon that can communicate with macros and can register multiple targets.
My idea is that when I targeting an enemy and typing /starget focus the addon saves the target name into a variable. When I type /starget target the addon send a chat message which will look like a simple targeting macro command with the target's name. (/tar targetname)
I was able to create a working code but it doesn't do as I expected. It sends the chat message /tar targetname, but the full command is visible like when you type a space before a macro when you want to send it to someone. Of course theres no space before the command. Is it possible to target that way? Or is there a completely different method?
Here is the code:
Code:
SLASH_STARGET1, SLASH_STARGET2 = '/star', '/starget';
local function handler(msg, editBox)
if msg == 'focus' then
target1 = UnitName('Target')
print("Target 1 saved: " .. target1)
elseif msg =='target' then
SendChatMessage("/tar " .. target1)
end
end
SlashCmdList["STARGET"] = handler;
I know this way you can only target npcs who have got individual name. How could I store the target if there would be more than 1 npc with the same name in my range?
In the future I'd like to create an ui for the addon where you can set up keybinds so you won't need to create macros. I also want to expand the addon with the option of casting spells on target (like /cast [target=target1] spellname) so I also want to give an ability to choose what spell to use on the starget.
Thanks in advance,
Xíry