Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetGuildPollData

From RoR Wiki
Revision as of 19:43, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Guild functions
Version: WAR 1.4.8

Returns the active alliance polls (votes) known to the client.

polls = GetGuildPollData()

Arguments

None.

Returns

polls
table – Poll tables keyed by poll id. This is not a 1-based array: iterate with pairs or index by poll id.

Each poll table has these fields:

Key Type Meaning
pollType number Kind of poll. The stock UI compares it with GuildWindow.POLL_TYPE_KICK.
subjectID number Id of the guild the poll is about.
creatorID number –
maxTimer number –
votes table Votes cast so far: keys are voter ids, values are boolean (the vote).
locked number –
timestampCreated number Creation time as a raw time value.
dateCreatedHour24 number Hour of creation, 0–23.
dateCreatedMonth number Month of creation, 1–12.
dateCreatedDay number Day of the month of creation.
dateCreatedYear number Year of creation.

Details

  • The date fields are timestampCreated converted with the computer's local time zone.
  • If the Lua state is not available, the function returns nothing.
  • A new table is built on every call.

Errors

None.

Example

From default/ea_guildwindow/source/guildwindowtaballiance.lua:

local guildPollData = GetGuildPollData()
...
for pollId, pollData in pairs( guildPollData )
do
    if ( ( pollData.subjectID == guild.id ) and ( pollData.pollType == GuildWindow.POLL_TYPE_KICK ) )
    then
    ...

Looking up one poll, from the same file:

local guildPollData = GetGuildPollData()
pollData = guildPollData[pollId]

See also