Mass guild whisp for X rang.
Hello everybody!
This is ma script: /run for i = 1, select(2, GetNumGuildMembers()) do SendChatMessage("TEXT MESSAGE", "WHISPER", nil, GetGuildRosterInfo(i)) end So.. how to change the script so that will not whisp all the people who are online, but whisp only to a XXX rank in the guild? Like.. *Member* - nothing whisp! *Veteran* - nothing whisp! *Newbie* - Hello, this is.. blahblahblah! Thx you! |
try this
/run for i = 1, select(2, GetNumGuildMembers()) do SendChatMessage("TEXT MESSAGE", "WHISPER", nil, GetGuildRosterInfo(i), GuildControlGetRankName("rank name")) end It might work, I'm not playing WoW atm so I can't test it. |
Quote:
I think need put rang level. http://www.wowwiki.com/API_GuildControlGetRankName |
tinyu: that's not how SendChatMessage() works, nor is it what GuildControlGetRankName() is for. ;)
makaka: This is untested, but really should work. ;) Code:
/run for i=1,select(2,GetNumGuildMembers()) do local n,r=GetGuildRosterInfo(i) if r="Newbie" then SendChatMessage("TEXT MESSAGE","WHISPER",nil,n) end end |
cheers Seerah I was just making a stab in the dark I was almost certain what I posted was wrong lol.
|
Quote:
|
No, the second return of GetGuildRosterInfo() is a string - the actual name of the rank. http://wowprogramming.com/docs/api/GetGuildRosterInfo
Is Newbie the actual name of the rank you want to check for? I noted that you need to replace that with whatever you're looking for. |
Also, to test for equality, you need two equals-signs, not one.
This sets the value of r to "Newbie", and the check fails because setting a variable doesn't return anything: if r = "Newbie" then This compares the value of r to "Newbie" and returns true (passing the check) if it is: if r == "Newbie" then |
There we go! I don't know how I missed that twice. :o
|
All times are GMT -6. The time now is 05:04 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI