Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:SendGuildAllianceCommand

From RoR Wiki

UI Lua API · Guild functions
Version: WAR 1.4.8

Sends an alliance poll command to the server: start a vote to kick a guild from the alliance, cancel a vote, or cast a vote.

SendGuildAllianceCommand(command, guildId, pollId, vote)

Arguments

command
number – 1 to create a kick poll, 2 to cancel a poll, 3 to vote. The stock UI names these GuildWindowTabAlliance.COMMAND_POLL_CREATE, COMMAND_POLL_CANCEL and COMMAND_POLL_VOTE.
guildId
number – Id of the guild the poll is about. Used by command 1 only.
pollId
number – Poll id (8-bit), the key in GetGuildPollData. Used by commands 2 and 3.
vote
number – 1 for yes, 0 for no (8-bit). Used by command 3 only.

Returns

Nothing.

Details

  • Any other command value sends nothing.
  • All four arguments must be numbers even when unused; the stock UI passes 0.
  • If there is no player object, or the Lua state is not available, nothing is sent.
  • The function needs at least four arguments and only reads the last four.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

From default/ea_guildwindow/source/guildwindowtaballiance.lua:

-- These are used to determine what the subtype of message is. These must match the switch statement in war_interface::LuaSendGuildAllianceCommand
GuildWindowTabAlliance.COMMAND_POLL_CREATE  = 1
GuildWindowTabAlliance.COMMAND_POLL_CANCEL  = 2
GuildWindowTabAlliance.COMMAND_POLL_VOTE    = 3
...
SendGuildAllianceCommand(GuildWindowTabAlliance.COMMAND_POLL_CREATE, guild.id, 0, 0)
...
SendGuildAllianceCommand(GuildWindowTabAlliance.COMMAND_POLL_VOTE, 0, pollId, 1)

See also