Thread Tools Display Modes
03-27-12, 07:25 PM   #1
Nervus86
A Defias Bandit
Join Date: Mar 2012
Posts: 3
API CalendarGetDayEvent

Hello everyone,

This is my first addon which I am developing and I have a problem
CalendarGetDayEvent returns

name - Name of the character (string)
level - The character's current level (number)
className - Localized name of the character's class (string)
classFileName - Non-localized token representing what the character's class (string)
inviteStatus - inviteStatus - The character's status Regarding the event (number)


but when I try to get the value inviteStatus I always get a nil value ...

example
.....
CalendarOpenEvent(0, today[3], i) ;
num = CalendarEventGetNumInvites()
for e=1,num,1 do
name, level, className, aSML = CalendarEventGetInvite (e);
players [e] = {name = name, level = level, className = className, inviteStatus = inviteStatus, aSML = aSML };
for k, v in pairs (players) do
output = output .. v.name .. v.level .. v.className .. v.inviteStatus .. "\ n"
end
end


all other value work, but I inviteStatus returns error ...
can you tell me something?

thanks Nervus

Last edited by Nervus86 : 03-27-12 at 07:30 PM.
  Reply With Quote
03-27-12, 07:38 PM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
In your example you're forgetting to actually assign inviteStatus
You should generally also assign them as local variables
Code:
local name, level, className, aSML, inviteStatus = CalendarEventGetInvite(s)

players[and] = {
	name = name,
	level = level,
	className = className,
	aSML = aSML,
	inviteStatus = inviteStatus,
}

for k, v in pairs(players) do
	output = output..v.name..v.level..v.className..v.inviteStatus.."\n"
end
and wtf is with up with the red part?
Anyway, can you please paste/show us the full code (in code tags)?

Edit: Ow you just changed your post with a bit more code, nvm about that then

Last edited by Ketho : 03-27-12 at 08:08 PM.
  Reply With Quote
03-27-12, 08:38 PM   #3
Nervus86
A Defias Bandit
Join Date: Mar 2012
Posts: 3
sorry I had seen the error and edited the post

I had forgotten the first inviteStatus

now it works great thanks for fast answer ...

Code:
...
CalendarOpenEvent(0, today[3], i) ;
	num = CalendarEventGetNumInvites()				
	for e=1,num,1 do						
		local name, level , className , inviteStatus , isML = CalendarEventGetInvite(e);
		players[e] = {
				name = name,
				level  = level,
				className = className,
				inviteStatus = inviteStatus,
				isML = isML
				};					
		for k,v in pairs(players) do
			output = output..v.name..v.level..v.className..v.inviteStatus.."\n"	
		end					
	end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » API CalendarGetDayEvent


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