Thread Tools Display Modes
01-30-10, 03:52 PM   #1
knoker
A Murloc Raider
Join Date: Jan 2010
Posts: 4
[Help] getting the raid members

Hi there, im havig some trobles getting the list of names of the players who are with me in raid, the idea was to show the list in a userfriedly interface where between other stuff we could manage DKP.

this is my first time programing in lua.

could you plz lend me a hand?

thank you,
KnoKer
  Reply With Quote
01-30-10, 04:36 PM   #2
Amenity
Guest
Posts: n/a
http://www.wowwiki.com/API_GetRaidRosterInfo

Last edited by Amenity : 01-30-10 at 06:13 PM.
  Reply With Quote
01-30-10, 04:43 PM   #3
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Specifically, to get everyone, take this:

Originally Posted by Amenity View Post
and run it a bunch of times:

Code:
local names = {}
for i = 1, MAX_RAID_MEMBERS do
    names[i] = GetRaidRosterInfo(i)
end
  Reply With Quote
01-30-10, 04:45 PM   #4
knoker
A Murloc Raider
Join Date: Jan 2010
Posts: 4
tyvm, i was just testing
Code:
 local name, rank, subgroup, level, class, fileName, zone, online, isDead, role, isML = GetRaidRosterInfo(1);
print(name);
it works


once again tyvm
  Reply With Quote
01-30-10, 04:57 PM   #5
knoker
A Murloc Raider
Join Date: Jan 2010
Posts: 4
btw another noob question, is there any way to create and array of objects who have 2 vars as atributes?
  Reply With Quote
01-30-10, 05:17 PM   #6
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Originally Posted by knoker View Post
btw another noob question, is there any way to create and array of objects who have 2 vars as atributes?
You can do a matrix:

Code:
local x = {}
x[1] = {1, "cat"}
print(x[1][2]) --results in "cat"
Alternatively, if you're looking to store some attribute of raid members, a better way may be to use string-keyed tables:

Code:
local names = {}
for i = 1, 40 do
    local name, rank = GetRaidRosterInfo(i)
    names[name] = rank
end

print(names[UnitName("player")]) --results in your own rank in the raid
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » [Help] getting the raid members


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off