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

Turtle.suck() returning the slot the item was put into.

Started by Creator, 26 May 2016 - 02:03 PM
Creator #1
Posted 26 May 2016 - 04:03 PM
It would make programing management systems that utilize turtles so much easier.

turtle.suck and the like should return true and the the slot number.
Dog #2
Posted 26 May 2016 - 04:09 PM
That would be very useful!
Creator #3
Posted 26 May 2016 - 04:11 PM
However, brainderp! Just realized items are put into the selected slot.

My suggestion then would be to put it into the next empty slot and return the slot number.
Bomb Bloke #4
Posted 27 May 2016 - 01:30 AM
My suggestion then would be to put it into the next empty slot and return the slot number.

That sounds like a massive backwards compatibility issue to me. And what if there is no empty slot, but there are some half-filled ones?

Heck, even if you stick with the current system, there's no guarantee that the items won't be distributed over multiple slots.

I'm also not seeing the benefit here, either. It's already far easier to rig things so you know exactly where the sucked items will go, then it would ever be to try and figure that out after the fact.
Sewbacca #5
Posted 29 May 2016 - 02:37 PM
Whats like this:

turtle.suck(side)

returns string what, table successful{
[slot] = count,

}, number failed (– 1 by sucking 64*16+1 stones)
Edited on 29 May 2016 - 12:40 PM
apemanzilla #6
Posted 29 May 2016 - 04:35 PM
All of this can be emulated with the functions available. You can loop throughout the turtle's inventory before and after sucking up items and check what slots changed. There's no need to alter existing functions in a way that would cause compatibility issues.