Updated Signals (markdown)

Florian Nücke 2013-12-13 03:06:33 -08:00
parent 49ccb3db0f
commit 2924874ed2

@ -74,4 +74,9 @@ Robots
------ ------
- `inventory_changed(slot: number)` - `inventory_changed(slot: number)`
This signal is queued by robots when their inventory changes. Note that this only includes changes to the kind of item stored in a slot. For example, increasing or decreasing the size of an already present stack does not trigger this signal. However, swapping one item with another (say, torches with sticks) by hand will actually trigger *two* signals: one for the removal of the torches, one for putting the sticks into the temporarily empty slot. Swapping items using `[[robot.transferTo()|API/Robot]]` will even trigger *four* signals - the same thing, but for the two slots involved in the swap. This signal is queued by robots when their inventory changes. Note that this only includes changes to the kind of item stored in a slot. For example, increasing or decreasing the size of an already present stack does not trigger this signal. However, swapping one item with another (say, torches with sticks) by hand will actually trigger *two* signals: one for the removal of the torches, one for putting the sticks into the temporarily empty slot. Swapping items using `[[robot.transferTo()|API/Robot]]` will even trigger *four* signals - the same thing, but for the two slots involved in the swap.
Also, this only fires for the actually addressable inventory of the robot, i.e. it does not trigger for changes in equipment (tool, card, upgrade). Also, this only fires for the actually addressable inventory of the robot, i.e. it does not trigger for changes in equipment (tool, card, upgrade).
Carriage
--------
- `carriage_moved(success: boolean[, reason:string[, x:number, y: number, z: number]])`
This signal is queued by the [[carriage component|Component/RedstoneInMotion]] after a move or simulate command was issued. The `success` parameter indicates whether the move or simulation was successful, i.e. whether the carriage could be moved. If the move failed, `reason` is the error message. Depending on the error message, (`x`, `y`, `z`) is the world coordinate of the block that caused the move to fail.