Anvil
Allows computers to use anvils as peripherals
Functions | Description |
---|---|
combine(from,fromSlot, resources, resourcesSlot, xpSource) | Combines items from inside of inventories accesible to the computers via the Inventory API, using 8 Bottles o' Enchanting per item. |
rename(from,slot,name) | Renames an item with the name given |
combine(from, fromSlot, resources, resourcesSlot, xpSource)
Description
Combines items from inside of inventories accesible to the computers via the Inventory API, using 8 Bottles o' Enchanting per item.
Parameters
- from : string - The inventory from where the base item is located
- fromSlot : number - The slot where the base item is present
- resources : string - The inventory from where the item that will be combined is located
- resourcesSlot : number - The slot where the combined item is present
- xpSource : string - An inventory from which the xp bottles will be used to combine the items
Returns
- boolean - The state of the operation
- string - error message, If there is a failure on the operation
Usage
Item Combine Example
local anvil = peripheral.find("anvil_interface");
local state, err = anvil.combine("left",1,"right",1,"top");
if(err) -- If there was an error, display the error message
error(err);
print(state); -- Display if could combine items
rename(from, slot, name)
Description
Renames an item with the name given
Parameters
- from : string - The inventory from where the base item is located
- slot : number - The slot where the base item is present
- name : string - The name to be set for the item
Returns
- boolean - The state of the operation
- string - error message, If there is a failure on the operation
Usage