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

Simple Program Not Working, But Not Giving An Error

Started by sebtitan, 21 February 2014 - 07:05 PM
sebtitan #1
Posted 21 February 2014 - 08:05 PM
Here's the program I'm trying to make, it's only defining and testing a function. It's eventually going to be part of my own mining program. The sad thing is that it's one of five functions I've theoretically written for this mining program and it's the first one I'm testing. The turtle runs the program, doesn't return an error, but doesn't move or break blocks, whether blocks are in front of it or not. Any and all help would be appreciated by this noob.

edit:
Here's my code.

function forward()
turtle.detect()
if turtle.detect()==true
then turtle.dig()
forward()
if turtle.detect()==false
then turtle.forward()
end
end

for i=1,3 do
forward()
end

end
Edited on 21 February 2014 - 10:58 PM
Lyqyd #2
Posted 21 February 2014 - 08:28 PM
Please post your full code.
sebtitan #3
Posted 22 February 2014 - 12:02 AM
Nevermind… I needed an end after the first turtle.detect(). I apologize for my noobness.