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

[1.3]Advanced Turtle Detection

Started by DarkNinja2462, 08 April 2012 - 11:36 AM
DarkNinja2462 #1
Posted 08 April 2012 - 01:36 PM
Turtles need to detect what its inventory is, and it needs to detect what block it is about to break.
Xfel #2
Posted 08 April 2012 - 01:44 PM
Turtles can already test whether the block in front of them is the same as the one in an inventory slot. There might be a way to compare two slots in the future (I hope), but that's all.
DarkNinja2462 #3
Posted 08 April 2012 - 02:06 PM
How?
Cloudy #4
Posted 08 April 2012 - 02:09 PM
You use turtle.compare() which returns true if the block in front is the same as the currently selected slot, and false if not.
EatenAlive3 #5
Posted 08 April 2012 - 03:06 PM
You can already partially compare two slots, although it only works with blocks. Place slot1, switch to slot2, and compare. It will return true if the slots are the same and false if not.
Advert #6
Posted 08 April 2012 - 05:01 PM
Not going to happen.

turtle.compare*() was added reluctantly-ish: the original fucntion would only compare inventory.