API:SendGuildAppointmentData
From RoR Wiki
UI Lua API · Guild functions
Version: WAR 1.4.8
Sends a guild calendar command to the server: create, edit or delete an appointment, sign up or leave, or manage sign-ups.
SendGuildAppointmentData(action, appointmentID, guildID, memberID,
startMonth, startDay, startYear, startHour, startMinute, startAMPM,
endMonth, endDay, endYear, endHour, endMinute, endAMPM,
title, description, shared, locked)
Arguments
- action
number– What to do. The stock UI uses the constants inGuildWindowTabCalendar: 1APPOINTMENT_ADD, 2APPOINTMENT_EDIT, 3APPOINTMENT_DELETE, 4APPOINTMENT_SIGNUP, 5APPOINTMENT_LEAVE, 6APPOINTMENT_KICK, 7APPOINTMENT_FLAG_ATTENDANCE.- appointmentID
number– Appointment id (8-bit). 0 when adding.- guildID
number– Guild id of the appointment. 0 when adding.- memberID
number– Character id of the member, for actions 6 and 7. 0 otherwise.- startMonth, startDay, startYear, startHour, startMinute
number– Start date and time in local time;startHouris 0–23.- startAMPM
number– Not used by the client.- endMonth, endDay, endYear, endHour, endMinute
number– End date and time in local time.- endAMPM
number– Not used by the client.- title
wstring– Event name.- description
wstring– Event description.- shared
boolean–trueto share the event with the alliance.- locked
boolean–trueto lock sign-ups.
Returns
Nothing.
Details
- All 20 arguments must always be passed with the right types, even for actions that do not use them. The stock UI passes 0,
L""andfalseas fillers. - Actions 1 and 2 send the appointment with its start and end times, title, description and the two flags. The dates are converted to raw times using the computer's local time zone.
- Action 3 deletes the appointment. Actions 4 and 5 sign the player up or remove the player. Actions 6 and 7 act on the member given by
memberID. - Any other
actionvalue, such as the stock UI'sAPPOINTMENT_VIEW(8), sends nothing. - The client copies the title into a 30-character buffer and the description into a 100-character buffer.
- If there is no player object, or the Lua state is not available, nothing happens.
- The function needs at least 20 arguments and only reads the last 20.
sharedandlockedmust be real booleans.
Errors
None besides the generic Invalid Parameters message when an argument has the wrong type.
Example
Signing up for the selected appointment, from default/ea_guildwindow/source/guildwindowtabcalendar.lua (the remaining arguments are fillers):
SendGuildAppointmentData(
GuildWindowTabCalendar.APPOINTMENT_SIGNUP, -- Param 0
GuildWindowTabCalendar.appointmentListData[index].appointmentID, -- Param 1
GuildWindowTabCalendar.appointmentListData[index].guildID, -- Param 2
0, -- Param 3
0, -- Param 4
...
Creating or editing an appointment, from the same file:
SendGuildAppointmentData(
GuildWindowTabCalendar.Appointment_Mode, -- Param 0
appointmentID, -- Param 1 AppointmentID
guildID, -- Param 2 GuildID
0, -- Param 3 MemberID
ComboBoxGetSelectedMenuItem("GWCalendarNewAppointmentStartTimeMonthComboBox"), -- Param 4 Start Month
...
GWCalendarNewAppointmentEventNameEditBox.Text, -- Param 16 The name of the event
GWCalendarNewAppointmentDescriptionEditBox.Text, -- Param 17 Event Description
ButtonGetPressedFlag("GWCalendarNewAppointmentShareCheckBox"), -- Param 18 True if event is shared with alliances
ButtonGetPressedFlag("GWCalendarNewAppointmentLockSignupCheckBox") -- Param 19 True if signups are locked
)
