<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASendGuildVaultCommand</id>
	<title>API:SendGuildVaultCommand - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ASendGuildVaultCommand"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SendGuildVaultCommand&amp;action=history"/>
	<updated>2026-10-19T21:42:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:SendGuildVaultCommand&amp;diff=30697&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:SendGuildVaultCommand&amp;diff=30697&amp;oldid=prev"/>
		<updated>2026-10-16T19:48:40Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Guild}}&lt;br /&gt;
Sends a guild vault command to the server: move an item, deposit or withdraw money, lock or unlock a slot, close the vault, or buy a vault expansion.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendGuildVaultCommand(command, arg1, arg2, arg3, arg4, flag)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;command : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – A &amp;lt;code&amp;gt;SystemData.GuildVaultCommands&amp;lt;/code&amp;gt; value: &amp;lt;code&amp;gt;MOVE_ITEM&amp;lt;/code&amp;gt; (1), &amp;lt;code&amp;gt;GIVE_COIN&amp;lt;/code&amp;gt; (2), &amp;lt;code&amp;gt;TAKE_COIN&amp;lt;/code&amp;gt; (3), &amp;lt;code&amp;gt;SLOT_LOCK&amp;lt;/code&amp;gt; (4), &amp;lt;code&amp;gt;SLOT_UNLOCK&amp;lt;/code&amp;gt; (5), &amp;lt;code&amp;gt;CLOSE&amp;lt;/code&amp;gt; (6), &amp;lt;code&amp;gt;PURCHASE_EXPANSION&amp;lt;/code&amp;gt; (7).&lt;br /&gt;
;arg1, arg2, arg3, arg4 : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Command arguments, see the table below. Unused ones must still be numbers (the stock UI passes 0).&lt;br /&gt;
;flag : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – Only used by &amp;lt;code&amp;gt;MOVE_ITEM&amp;lt;/code&amp;gt;, see below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Command !! arg1 !! arg2 !! arg3 !! arg4&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MOVE_ITEM&amp;lt;/code&amp;gt; || source || source slot || destination || destination slot&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;GIVE_COIN&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TAKE_COIN&amp;lt;/code&amp;gt; || amount of money (in brass) || – || – || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SLOT_LOCK&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;SLOT_UNLOCK&amp;lt;/code&amp;gt; || vault number || slot || – || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CLOSE&amp;lt;/code&amp;gt; || – || – || – || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PURCHASE_EXPANSION&amp;lt;/code&amp;gt; || vault number || expansion cost || – || –&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Every command also sends the guild NPC id that the client reads from the Lua variable &amp;lt;code&amp;gt;InteractionWindowGuildCreateForm.GuildNPC_ID&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Slots are passed 1-based, as the stock UI uses them; the client converts them before sending. For &amp;lt;code&amp;gt;PURCHASE_EXPANSION&amp;lt;/code&amp;gt; the second value is sent unchanged.&lt;br /&gt;
* &amp;lt;code&amp;gt;MOVE_ITEM&amp;lt;/code&amp;gt; sources and destinations 1–5 are vault numbers. Other values refer to the player&amp;#039;s backpacks: the stock UI passes 0 for the main backpack, or the backpack type plus &amp;lt;code&amp;gt;GuildVaultWindow.MAX_VAULTS&amp;lt;/code&amp;gt; (5). The client turns these into inventory slot numbers.&lt;br /&gt;
* For &amp;lt;code&amp;gt;MOVE_ITEM&amp;lt;/code&amp;gt; into a vault (destination 1–5), &amp;lt;code&amp;gt;flag = true&amp;lt;/code&amp;gt; sends the destination slot without the 1-based conversion. For other destinations &amp;lt;code&amp;gt;flag&amp;lt;/code&amp;gt; is ignored.&lt;br /&gt;
* Any other &amp;lt;code&amp;gt;command&amp;lt;/code&amp;gt; value sends nothing.&lt;br /&gt;
* If there is no player object, or the Lua state is not available, nothing is sent.&lt;br /&gt;
* The function needs at least six arguments and only reads the last six. &amp;lt;code&amp;gt;flag&amp;lt;/code&amp;gt; must be a real boolean.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument has the wrong type.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_guildvaultwindow/source/guildvaultwindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function GuildVaultWindow.OnClose()    -- Registered Event Trigger    (User closed the window)&lt;br /&gt;
    SendGuildVaultCommand(SystemData.GuildVaultCommands.CLOSE, 0, 0, 0, 0, false)&lt;br /&gt;
    GuildVaultWindow.Hide()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depositing money and locking a slot, from the same file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SendGuildVaultCommand(SystemData.GuildVaultCommands.GIVE_COIN, money, 0, 0, 0, false)&lt;br /&gt;
...&lt;br /&gt;
SendGuildVaultCommand(SystemData.GuildVaultCommands.SLOT_LOCK, GuildVaultWindow.SelectedVault, buttonIndex, 0, 0, false)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SendMailboxCommand|SendMailboxCommand]]&lt;br /&gt;
* [[API:SendGuildAllianceCommand|SendGuildAllianceCommand]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>