turtle inventory (event)
From ComputerCraft Wiki
Event turtle_inventory | |
Fired when the inventory of the turtle is altered in any slot. | |
Returned Object 1 | Nothing |
Examples
Example | |
Returns the slot number when the inventory in slot 1 is changed. | |
Code |
while true do local event, p1 = os.pullEvent("turtle_inventory") print("Inventory has changed") end |
Output | If the inventory in any slot has changed, or the player has clicked inside the turtle, the output is: "Inventory has changed". |
Note: This event can fire even if the inventory has not changed, such as if the player has clicked on an empty slot.