Thread Tools Display Modes
04-25-13, 05:50 PM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
GetRaidRosterInfo() retuning nil

My problem is GetRaidRosterInfo() role argument is returning nil while name returns correct

Code:
local name,_,_,_,_,_,_,_,_,role = GetRaidRosterInfo(units)
my full code looks like so:


Code:
local currentMembers = GetNumGroupMembers()
print("checked roster for: " .. currentMembers)
for units = 1, currentMembers do
	local name,_,_,_,_,_,_,_,_,role = GetRaidRosterInfo(units)
	print(role)
end
  Reply With Quote
04-25-13, 05:56 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Is a main tank /assist set?

Where you maybe looking to check the 12th return and not the 10th?
  Reply With Quote
04-25-13, 05:58 PM   #3
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
At the moment I'm just trying to get it to print the role of the current raid member in the loop and as such i dont have either set

The 10th argument is listed as role, I don't believe there is a 12th
  Reply With Quote
04-25-13, 06:02 PM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I'm pretty sure the 10th return of GetRaidRosterInfo() refers to maintank and mainassist, not role in the general sense.

Maybe you had UnitGroupRolesAssigned() in mind?

Also according to Wowpedia they've added a 12th return to GetRaidRosterInfo() with combatrole which is what you're probably after.
  Reply With Quote
04-25-13, 06:23 PM   #5
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Ok, You are right, i was looking at older documentation from another site looks like that solved my problems thank you =)

Also the name returns as such: <name> - <server>
Is there anyway to get just the name?

Last edited by Spawnova : 04-25-13 at 10:48 PM.
  Reply With Quote
04-26-13, 09:06 AM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
name:gsub('%-[^|]+', '')
  Reply With Quote
04-26-13, 11:44 AM   #7
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
Works perfectly thank you
  Reply With Quote
04-26-13, 06:43 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
name:match("[^%-]+") would also work, and I think string.match is faster than string.gsub.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
04-26-13, 07:26 PM   #9
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Probably, I was just copypasting my solution for chat.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetRaidRosterInfo() retuning nil


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