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

Turtle Mining Variable Problem

Started by aidanthefirst, 23 September 2012 - 05:55 PM
aidanthefirst #1
Posted 23 September 2012 - 07:55 PM
It's Not reading my variable or something right and it assumes its 1 block what's wrong?
x = 50
if x > 0 then
turtle.dig()
turtle.forward()
end
sjele #2
Posted 23 September 2012 - 07:57 PM
Could you explain what the problems is? The info you gave dosent realy make sense :P/>/>

The code you wrote would only repeat once/do something once
aidanthefirst #3
Posted 23 September 2012 - 07:58 PM
It's supposed to mine forward 50 times and go forward each time after it has mined forward. That's the code I put in it.
sjele #4
Posted 23 September 2012 - 08:00 PM
Then you should do it like this:

for i = 1, 50 do --Repeat loop, that repeats 50 times
turtle.dig()
turtle.forward()
end
aidanthefirst #5
Posted 23 September 2012 - 08:03 PM
Thank you it's been a while since I've coded my turtles.