Crafter
High-level API
Device name:
crafterProvided by crafters connected to a bus interface. The grid slots are available through the item handler device.
Methods
getResult():tableGets what the crafter would currently craft.
- Returns a table with the item information. Returns nothing if the grid matches no recipe.
isSlotEnabled(slot:number):booleanGets whether a slot of the grid is enabled.
-
slot: the slot index.- Returns
true if the slot is enabled.setSlotEnabled(slot:number, enabled:boolean)Sets whether a grid slot is enabled. Slot must be empty to be disabled.
-
slot: the slot index.-
enabled: whether to enable the slot.Mid-level API
Device name:
CRAFTRItem ids are two bytes, low byte first; [
SYSTEM](system.md) provides name lookup.Methods
1 isSlotEnabledGets whether a slot of the grid is enabled.
- Takes one byte, the slot index.
- Returns one byte,
1 if enabled, else 0.2 setSlotEnabledSets whether a grid slot is enabled. Slot must be empty to be disabled.
- Takes two bytes, the slot index, and
0 to disable or 1 to enable it.3 getResultGets what the crafter would currently craft.
- Returns three bytes: the item as two bytes,
0 if the grid matches no recipe, else the number of items.