Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:RequestSalvageItem

From RoR Wiki
Revision as of 19:48, 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 · Crafting functions
Version: WAR 1.4.8

Asks the server to salvage an item from one of the player's backpacks.

sent = RequestSalvageItem(slot, backpackType, salvagingType, stat)

Arguments

slot
number – Slot of the item inside the backpack, starting at 1.
backpackType
number – Which backpack the item is in, as an EA_Window_Backpack.TYPE_* value: 2 (TYPE_INVENTORY), 3 (TYPE_CURRENCY) or 4 (TYPE_CRAFTING).
salvagingType
number – A GameData.SalvagingTypes value (MAGICAL or MUNDANE in the stock UI).
stat
number – Which stat to salvage. The stock UI passes the window id of the selected stat button, or 0.

Returns

sent
number – 1 if the request was sent. Nothing is returned otherwise.

Details

  • The request is only sent if the item in that slot has the GameData.Item.EITEMFLAG_MAGICAL_SALVAGABLE or EITEMFLAG_MUNDANE_SALVAGABLE flag. Otherwise nothing is sent and nothing is returned, so if RequestSalvageItem(...) then works as a success test.
  • For backpackType 2, 3 and 4 the client converts slot to an absolute inventory slot. For any other value, slot is used as it is.
  • salvagingType and stat are sent as single bytes.
  • The client does not check the player's salvaging skill. The server decides whether the salvage succeeds.
  • 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_craftingwindow/source/salvagingwindow.lua:

-- Set the action bar text if the salvaing was sent
if( RequestSalvageItem( SalvagingWindow.selectedSlot, SalvagingWindow.selectedBackpack, SalvagingWindow.salvagingType, SalvagingWindow.selectedStat ) )
then
    LayerTimerWindow.SetActionName( GetString( StringTables.Default.LABEL_SKILL_SALVAGING ), true )
end

See also