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

[RESOLVED] turtle.detectTurtle()

Started by Ulthean, 15 December 2012 - 11:57 PM
Ulthean #1
Posted 16 December 2012 - 12:57 AM
I know the plan is NEVER to add the ability to detect blockId's etc, but I would love to be able to detect other turtles without sacrificing inventory slots for turtle.compare(). So perhaps an acceptable alternative would be a function that just returns true if there is a turtle in that direction.

Acceptable? Or heresy?


Edit: Another interesting idea might be to allow turtles to detect certain block TYPES (not specific blocks)
  • Example:
    • turtle.detect("turtle")
    • turtle.detect("container")
Cruor #2
Posted 16 December 2012 - 01:54 AM
This can be done with:
peripheral.getType(side)
returning the name of the peripheral(turtle, computer, modem, etc)
Ulthean #3
Posted 16 December 2012 - 02:02 AM
This can be done with: peripheral.getType(side)

Thanks a bunch for this solution! I wasn't aware of this.

PS: I did ask around on the 'ask a pro' forum before posting here (in my defence)