This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
timecraftor's profile picture

Add slot event

Started by timecraftor, 16 December 2012 - 02:25 AM
timecraftor #1
Posted 16 December 2012 - 03:25 AM
I had an idea to add an event that basically fires on a turtle when an item is modified. That means when you put an item in or out or switch stacks or take half a stack out etc. The event should also have the slot number and the type of modification as arguments. It is a very basic thing to add I think so I hope you like my idea and it gets added.
Sebra #2
Posted 16 December 2012 - 06:39 AM
It is on third page now, but you should be able to find it.
Cloudy #3
Posted 16 December 2012 - 06:40 AM
Not as easy to do as you might think, unfortunately.
immibis #4
Posted 16 December 2012 - 01:02 PM
Already denied. An event for "your inventory might've changed somewhere" would still be useful though - it could be triggered if something calls setInventorySlotContents, or getStackInSlot for a non-empty slot (in the latter case, the inventory might or might not have changed)
Sebra #5
Posted 16 December 2012 - 07:08 PM
Was it denied?
Player inventory change is a lot more possible, since we are in control of the GUI that displays. I'm not going to allow detection of clicks on slots since that would make no sense whatsoever - I'll just look into throwing an event when a player changes the inventory - and probably the slot number.