OK, I've modified your function, v6o, to avoid using CalendarGetNumDayEvents, and it's working fine when I run it after I've opened the calendar or called OpenCalendar.
lua Code:
function CheckNextSevenDays()
print("Welcome Screen Guild Page getting calendar information:")
local day = select(3, CalendarGetDate())
local month = 0 -- calendar use offset by default so 0 is current, -1 previous, +1 is next
local numDays = select(3, CalendarGetMonth(month))
for d=1,7 do
if day > numDays then
month = month + 1
day = 1
numDays = select(3, CalendarGetMonth(month))
end
local safety = 100
local i = 1
while true do
local title, hour, minute, calendarType, sequenceType, eventType, texture, modStatus, inviteStatus,
invitedBy, difficulty, inviteType, sequenceIndex, numSequenceDayss = CalendarGetDayEvent(month, day, i)
if title then
if eventType ~= 0 then -- Ignore holidays, call to arms, fishing contests etc.
print(inviteStatus.." : "..title.." (type "..eventType..")")
end
i = i + 1
else -- no more events
break
end
if safety == 0 then
print("SAFETY!")
break
else
safety = safety - 1
end
day = day + 1
end
end
end
I've worked out that CALENDAR_UPDATE_EVENT_LIST fires once its ready, but I'm not sure when to call OpenCalendar, as I want my frame to appear when the player logs in. I've tried PLAYER_ENTERING_WORLD and PLAYER_LOGIN.
Sorry, but I can't work out what your screenshots mean, Xrystal. The second one (with PLAYER_ENTERING_WORLD on relog) seems to be working, but when are you calling OpenCalendar?
Thanks for your help guys,