2427 posts
Location
UK
Posted 15 August 2016 - 11:26 PM
The current methods which turtles have to manipulate inventories are more than a bit lacking when the inventory has multiple slots accessible from the current side (chests are a good example in contrast to furnaces).
It would be very useful for turtles to be able to take and place items into chests and decide the slot to interact with rather than being limited to the first slot which can fulfil the requested command.
Proposed added functionality (keeping the default suck and drop functions for compatibility and if the programmer doesn't need the new functionality).
turtle.precisionSuck(slotNum, [item count]) --#with up and down variants like turtle.suck
turtle.precisionDrop(slotNum, [item count]) --#with up and down variants like turtle.drop
Edited on 15 August 2016 - 09:26 PM
3057 posts
Location
United States of America
Posted 16 August 2016 - 12:06 AM
What would be the behavior if the number of items requested does not fit in the slot. For example, say slot 1 has 63 dirt. If you attempt to suck 2 dirt items into slot 1, would it overflow as turtle.suck already does?
If this is the case, since turtle.suck attempts to add the items to the currently selected slot, turtle.precisionSuck is already codable:
function turtle.precisionSuck( slotNum, itemCount )
local oldSlot = turtle.getSelectedSlot()
turtle.select( slotNum )
return turtle.suck( itemCount ), turtle.select( oldSlot )
end
2427 posts
Location
UK
Posted 16 August 2016 - 12:20 AM
You have this the wrong way round, perhaps my explanation was poor, I want to be able to suck the chest's second/fifth/Nth slot into whichever slot I have selected in the turtle (and vice versa for drop)
I also realise that some useful functions to compliment this may be functions which allow the turtle to tell how many slots there are and to inspect the slots. As well as other functions which turtles already have with their built in inventories.
Think OpenPeripherals chest peripheral.
Edited on 15 August 2016 - 10:38 PM
3057 posts
Location
United States of America
Posted 16 August 2016 - 12:30 AM
Oh, yeah that would be very helpful indeed. You can workaround but it's a pain.
327 posts
Location
Julfander Squad Studio
Posted 11 May 2017 - 07:47 AM
i thought this is the case… So my next projekt, the storage room with CC, has failed before it started…
2427 posts
Location
UK
Posted 11 May 2017 - 08:57 AM
i thought this is the case… So my next projekt, the storage room with CC, has failed before it started…
CC is opensource now, so the functionality may get added. (I do plan on learning java and having a go at implementing this and other suggestions once I'm done with my university stuff)
327 posts
Location
Julfander Squad Studio
Posted 14 May 2017 - 11:56 AM
Cool! I cant wait to see the new cheap storage solutions! :D/>