API:GetFortressStatuses
From RoR Wiki
UI Lua API · RvR functions
Version: WAR 1.4.8
Returns the owner of each fortress and of its sub-areas.
fortresses = GetFortressStatuses()
Arguments
None.
Returns
- fortresses
table– Array of fortress tables, indexed from 1, or nothing if the client has no fortress data.
Each fortress table has these fields:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Fortress (keep) id. |
currentOwningRealm |
number |
Realm that owns the fortress. |
currentOwningGuild |
wstring |
Name of the owning guild. Empty if no guild owns it; the stock UI then shows "unclaimed". |
[1] … [n] |
table |
The fortress's sub-areas, see below. |
Each sub-area table:
| Key | Type | Meaning |
|---|---|---|
id |
number |
Sub-area id. |
currentOwningGuild |
wstring |
Name of the guild owning the sub-area, or empty. |
Details
- The fortress table mixes named fields and an array part.
ipairs(fortress)walks only the sub-areas. - The entries are ordered by fortress id, and the sub-areas by sub-area id.
- A new table is built on every call.
Errors
None.
Example
From default/ea_advancedwarwindow/source/advancedwarwindow.lua (shortened):
EA_Window_AdvancedWar.fortressData = GetFortressStatuses()
for index, data in ipairs( EA_Window_AdvancedWar.fortressData )
do
local keepId = EA_Window_AdvancedWar.fortressData[index].id
...
for subareaIndex, subareaData in ipairs( EA_Window_AdvancedWar.fortressData[index] )
do
local subareaId = subareaData.id
...
LabelSetText(labelSubareaOwner, subareaData.currentOwningGuild)
