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

How do you make a turtle detect a certain block?

Started by mrminer8888, 29 June 2012 - 06:57 PM
mrminer8888 #1
Posted 29 June 2012 - 08:57 PM
I have a a few questions.
1st: how do you make a turtle detect a certain block?
2nd: there are commands like: repeat "bla bla bla" until turtle.detect() but I want to make it so that when the turtle doesn't detect something. how do I do that?
3rd: whats does pullEvent mean?
4th: is it possible to share programs files, and run turtles across the rednet?

im pretty new to this stuff, but this mod is fun :P/>/>
MysticT #2
Posted 29 June 2012 - 09:02 PM
1) The only way is to compare with blocks in the turtle inventory.

2) Not sure of what you mean. You can the turtle to do something until it finds an empty block? That would be something like:

while turtle.detect() do
  -- do something
end

3) os.pullEvent gets the next event on the event queue. There's a tutorial on the tutorials forum that explains this.

4) Yes, you need to have a program in a computer that sends the file and another one in the other computer to receive it.
mrminer8888 #3
Posted 29 June 2012 - 09:23 PM
okay thanks so much :P/>/> btw how long has this mod been around?
MysticT #4
Posted 29 June 2012 - 10:21 PM
Well, the post on mc forum was made in december of 2011. Not sure if that was the first release.
Mendax #5
Posted 30 June 2012 - 03:07 AM
okay thanks so much :P/>/> btw how long has this mod been around?
Since Minecraft 1.0… I used to play CC in the Aether… ;D good times…