Skip to content

SmithingInventory ​

com.jsmacrosce.jsmacros.client.api.classes.inventory.SmithingInventory

Since1.8.4

Wraps an open smithing table screen. Its input slots are 0 (template), 1 (base), and 2 (addition); the result is slot 3. The input accessors map to those first three slots, while getOutput() returns the addition input; read the result with getSlot(3).

js
const inv = Player.openInventory();  
if (inv instanceof Inventories.Smithing) {
  Chat.log(`template ${inv.getLeftInput().getItemId()}`);  
  Chat.log(`base ${inv.getRightInput().getItemId()}`);  
  Chat.log(`addition ${inv.getOutput().getItemId()}`);  
  const result = inv.getSlot(3);  
  if (!result.isEmpty()) {
    Chat.log(`smiths into ${result.getItemId()}`);  
  }
}

Available in scripts as Inventories.Smithing.

Constructors ​

new SmithingInventory ​

new SmithingInventory(SmithingScreen inventory)#
Wraps the supplied smithing screen and captures its menu and the current client player through Inventory's setup. This does not open or create a screen; scripts typically obtain a wrapper for the current screen through FPlayer.openInventory().

Parameters:

  • inventory: the smithing screen to wrap

Methods ​

getLeftInput ​

getLeftInput(): ItemStackHelperSince1.8.4#
Returns the template input in menu slot 0.
Returns: the template item in the first slot.

getOutput ​

getOutput(): ItemStackHelperSince1.8.4#
Returns the addition input in menu slot 2, not the result in slot 3.
Returns: the addition item in the third slot.

getRightInput ​

getRightInput(): ItemStackHelperSince1.8.4#
Returns the base input in menu slot 1.
Returns: the base item in the second slot.

toString ​

toString(): String#
Returns this wrapper's fixed diagnostic label.
Returns: SmithingInventory:{}