WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Clear raid target markers (https://www.wowinterface.com/forums/showthread.php?t=58099)

Naruos 07-15-20 12:31 PM

Clear raid target markers
 
I want to clear the Raid Targets from everyone in the raid.

At the moment,
Lua Code:
  1. for i=8,0,-1 do SetRaidTarget("player", i); end
is the only way I've found, but I figure I've missed something obvious. This way, all eight markers gets spammed as system messages.

I know that I have
Code:

/cwm 0
for the World Markers and thus there should be a better way to clear the target markers as well.

What am I missing?

Fizzlemizz 07-15-20 12:59 PM

Code:

SetRaidTarget("unit", 0)
See: SetRaidTarget

SDPhantom 07-15-20 01:50 PM

Quote:

Originally Posted by Fizzlemizz (Post 336358)
Code:

SetRaidTarget("unit", 0)
See: SetRaidTarget

Not exactly what the OP is asking for. Their posted loop does this in its last pass to clean up the mark on the player.

Unfortunately, there isn't a "clear marker by index" function like there is for world markers.

Kanegasi 07-15-20 04:10 PM

The 0 index is exactly what OP is asking for. What OP wants is an easy way to clear all markers off the group without spamming messages. The 0 index at the end of the loop only clears the last marker off of OP, after spamming all marks on themselves to clear from the group.

Instead of the 0-8 loop, OP needs to loop through all group units using the 0 index. This will clear any marker they have with no message. This is easy with the group, but harder with non-group units, especially if a mark is on something that is still alive but no longer a valid unit.

Naruos 07-15-20 06:52 PM

Quote:

Originally Posted by Kanegasi (Post 336363)
Instead of the 0-8 loop, OP needs to loop through all group units using the 0 index. This will clear any marker they have with no message. This is easy with the group, but harder with non-group units, especially if a mark is on something that is still alive but no longer a valid unit.

You mean something like
Lua Code:
  1. s = IsInRaid() and "raid" or "party" ; for i = 1, GetNumGroupMembers() do u = s..i ; SetRaidTarget(u, 0); end
?

Yeah, that works for the raid I guess. I must admit I didn't realize it when I posted, that I worded my question to be about the raid members specifically. Well, at least I have my answer either way. I either accept the spam, or I clear it off raid members only.

If only IsRaidMarkerActive() hadn't returned the status for world markers instead of raid markers (or at least that's how I understood it), I could have used that to minimize the spam.

Thanks all of you for the help :)

SDPhantom 07-16-20 10:23 AM

I was imagining situations where you have stray markers on mobs that don't have a valid UnitID, which would be a problem too.


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

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