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

Turtle API for selecting slot in a chest and detecting chest size?

Started by Sceppie, 19 November 2012 - 10:06 PM
Sceppie #1
Posted 19 November 2012 - 11:06 PM
Hi!

I have an improvement suggestion. I'd like to see some of the folling API's added to the turtle next to the turtle.suck() thingy. Something in the lines of:

turtle.GetChestSize()
turtle.ChestSelect()

At the moment it's only possible to have the turtle pick out an entire chest up till the turtle is full. So a maximum of only 16 slots.

Wouldn't this be a good addition to the API? :(/>/>

Edit:

Also perhaps turtle.IsChest() boolean to detect if there's a chest in front, or perhaps turtle.DetectValidInventory() ?

Regards, Sceppie.
Edited on 19 November 2012 - 10:13 PM
Sebra #2
Posted 20 November 2012 - 03:16 AM
Let's think…
1. to check for inventory you need something like getSlotsNum();
2. next you need function to select slot in another inventory;
3. you need functions to compare it's content, current quantity and space remaining;
And do not forget inventories from 3 sides at least.
Were was ARP peripherals/upgrade for that, but it still not updated :(/>/>
fred4106 #3
Posted 23 November 2012 - 03:23 PM
Im almost done writing a computer peripheral that does almost this. Is allows you to scan an inventory, check names and amounts in each slot, and pull an amount from a slot into a ajacent buildcraft pipe.

Ill send you a message when its done.