#WA asking party leader to give you leader
60 messages · Page 1 of 1 (latest)
find the event that happens at the start of an arena
-> check UnitIsGroupLeader("player")
if that is not true, use SendChatMessage to send your message
you create a custom trigger and to find the event you either search through the event list or use something like /etrace
/etrace looks nice
@brittle pebble how do i whisper leader of the group with SendChatMessage comman?
if you want to whisper instead of group chat you'll need a way to find the name of the leader first
probably something like
for unit in WA_IterateGroupMembers() do
if UnitIsGroupLeader(unit) then
sendyourmessagehere
break
end
end```
if that's the event you found, yea that would work
yep
@brittle pebble its gives me an error :
if i put this code
for unit in WA_IterateGroupMembers() do
if UnitIsGroupLeader(unit) then
SendChatMessage("Give me leader", "WHISPER", nil, unit)
break
end
end
function(e, ...) at the top
and another end at the end
probably also want to check and not UnitIsUnit("player", unit)
to not whisper yourself
like this?
function()
for unit in WA_IterateGroupMembers() do
if UnitIsGroupLeader(unit) and not UnitIsUnit("player", unit) then
SendChatMessage("Give me leader", "WHISPER", nil, unit)
break
end
end
end
yep
actually one small thing
when you send the chat message, you need to provide a name, not unitid.
unit will be something like: "party1" "party2" etc.
so you need to do UnitName(unit) there
it does not work for some reason
when i enter arena nothing happens
looks like it does not even trigger
I don't think you have a correct event
you could try GROUP_ROSTER_UPDATE that probably fires in arenas too
Okay looks like it works
but i need it to trigger only once
GROUP_ROSTER_UPDATE happens several times
its hard to find the right event
you can add a time check if all you want is it not to send the whisper multiple times
aura_env.last = GetTime() on the same section you send the message in.
Then before iterating through the group you do:
If not aura_env.last or GetTime() > aura_env.last+5 then (meaning it wouldn't send the msg if it has done so in the last 5seconds)
for some rsn waek aura does not work
for when i'm not leader
but i can whisper myself wihtout " not UnitIsUnit("player", unit)"
hmm probably crossrealm issues, can try this:
local name, realm = UnitName(unit)
unit = name.."-"..realm
adding this before you send the msg
I posted it
I saw some stuff about normaliezd realm names you might need for whispers though, because of weird symbols like ´
couldn't find how to get that other than for yourself
not really something I ever had to deal with lol
is .."-".. how you concant strings in lua?
no that's just how the realmname is written
playername-realmname
well the 2 dots is
but yea
the "-" is just to add that between those 2 strings
ye works