1 posts
Location
Ukraine
Posted 04 April 2014 - 07:27 AM
Hello!
Tell me, please, how I can to detect exactly the chest (or any another storage) in front of/above/below turtle?
Thanks.
1281 posts
Posted 04 April 2014 - 04:15 PM
use peripheral.getType(side) and compare it to whatever peripheral you're looking for. Keep in mind however that a chest is not considered a peripheral, unless you have openP installed. If you don't you'll have to have a chest in the turtle's inventory, then use turtle.compare(slotNum).
8543 posts
Posted 04 April 2014 - 05:36 PM
turtle.compare uses the currently selected slot. You're thinking of turtle.compareTo, which is used to compare two inventory slots.
7083 posts
Location
Tasmania (AU)
Posted 04 April 2014 - 07:25 PM
Or rather, he's thinking of turtle.compare() but has the usage wrong - but that's indeed the function Rameron would be using in that instance.