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

Turtle suggestions

Started by Tahg, 02 September 2012 - 09:14 PM
Tahg #1
Posted 02 September 2012 - 11:14 PM
Allow suck to take an optional slot to filter incoming items against. If specified it would only suck items matching the slot given

A turtle.moveTo(slot, amount) function that moves items from one turtle slot to another assuming the two stacks are combinable

A way to control whether a turtle searches for an available slot or not. If dig or suck can't add items to the current slot, they would fail with false

A turtle.isFuel() method that detects whether the current slot contains fuel, without consuming any.
FuzzyPurp #2
Posted 03 September 2012 - 11:35 AM
I like all of these.
GopherAtl #3
Posted 03 September 2012 - 03:01 PM
1 and 3 are kindof variations of the same thing, and would be fairly nice features to have, though I'm not sure they're really necessary. #2, though, a way to move items between slots, seems very needed to me, particularly since, unless you drop into a chest or controlled pit with blocks on all sides, drop often drops items outside of suck range, so simply dropping and sucking items to move from slot to slot isn't always a straightforward process. #4, I guess I can see cases where that would be useful, but I've not felt particularly bothered working without it. My programs just wait until I have 2 of something before trying refuel(), so I will still have a sample for reference if it is burned. That way you not only know it's fuel, but by checking fuel level before and after, you can identify, roughly, what kind of fuel it is by the increase.

:edit: thinking about 1/3 again, if you had #2, you could simply fill all empty slots with samples of the target item before digging/sucking, effectively filtering your pickups. Not ideal, perhaps, but it would work.
Tahg #4
Posted 03 September 2012 - 10:13 PM
3 basically locks all operations to the current slot. This actually seems more intuitive to me, compared to the "smart" behavior turtles currently exhibit. At the same time, it provides more control over where items land.
Sebra #5
Posted 14 September 2012 - 05:53 PM
Allow suck to take an optional slot to filter incoming items against. If specified it would only suck items matching the slot given
Seems good.
A turtle.moveTo(slot, amount) function that moves items from one turtle slot to another assuming the two stacks are combinable
Not bad. Useful for Crafty mostly.
A way to control whether a turtle searches for an available slot or not. If dig or suck can't add items to the current slot, they would fail with false
Dig/suck result not known beforehand. So if it failed, item is dropped. Not so good as it looks.
A turtle.isFuel() method that detects whether the current slot contains fuel, without consuming any.
I prefer .fuelValue() to select best.
yapposai #6
Posted 20 September 2012 - 04:19 AM
maybe turtle.moveToSlot(target_slot , amount) can return the actual number of items moved or nill if it's not possible to transfer
ex:
slot 1 has 64 cobble
slot 2 has 40 cobble
slot 3 has 64 cobble
slot 4 has 1 wood

selected slot=1
moveToSlot(2,64) = 24 (40 cobble remains in slot 1, 64 in slot 2)
moveToSlot(3,64) = 0 (40 cobble in slot 1, 64 in slot 3)
moveToSlot(3,64) = nil (24 cobble in slot 1, 1 wood in slot 4)

same with suckToSlot(target slot, number) it returns nill if it can't find the the correct item from the inventory or the actual number of items transferred