#WA asking party leader to give you leader

60 messages · Page 1 of 1 (latest)

vale aurora
#

So when i enter solo shuffle i need the WA to ask the current leader if its not me to give it to me

#

or any arena

#

not only solo shuffle

brittle pebble
#

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

vale aurora
#

@brittle pebble where do i put this code?

#

and how do i check when arena start

brittle pebble
#

you create a custom trigger and to find the event you either search through the event list or use something like /etrace

vale aurora
#

/etrace looks nice

#

@brittle pebble how do i whisper leader of the group with SendChatMessage comman?

brittle pebble
#

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```
vale aurora
#

do i do trigger like this?

#

and load on arena

brittle pebble
#

if that's the event you found, yea that would work

vale aurora
#

so i custom trigger do i need to put my code?

#

or where do i put it

brittle pebble
#

yep

vale aurora
#

@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
brittle pebble
#

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

vale aurora
#

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
brittle pebble
#

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

vale aurora
#

it does not work for some reason

#

when i enter arena nothing happens

#

looks like it does not even trigger

brittle pebble
#

I don't think you have a correct event

#

you could try GROUP_ROSTER_UPDATE that probably fires in arenas too

vale aurora
#

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

brittle pebble
#

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)

vale aurora
#

for some rsn waek aura does not work

#

for when i'm not leader

#

but i can whisper myself wihtout " not UnitIsUnit("player", unit)"

brittle pebble
#

hmm probably crossrealm issues, can try this:
local name, realm = UnitName(unit)
unit = name.."-"..realm

#

adding this before you send the msg

vale aurora
#

how do i obtain realm @brittle pebble

#

ah i see

brittle pebble
#

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

vale aurora
#

is .."-".. how you concant strings in lua?

brittle pebble
#

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

vale aurora
#

ye works