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

Syntax error in strip mine program

Started by JaydenLoon3y, 17 January 2013 - 04:42 PM
JaydenLoon3y #1
Posted 17 January 2013 - 05:42 PM
I get a syntax error in a strip mine program

The error is on line 68

and here is my code

term.clear()
term.setCursorPos(1,1)
write("Strip Miner Initialised")
term.setCursorPos(1,2)
write("Mine Distance: ")
local mineDistance = read()
term.setCursorPos(1,3)
write("Strip Length: ")
local stripLength = read()
term.setCursorPos(1,4)
write("Space Between Strips: ")
local space = read()
term.setCursorPos(1,5)
write("Stripmine Starting")
local function dig()
  if turtle.detect() == true then
    turtle.dig()
  end
end
local function digUp()
  if turtle.detectUp() == true then
    turtle.digUp()
  end
end
local function digDown()
  if turtle.detectDown() == true then
    turtle.digDown()
  end
end
local function digCycle()
digUp()
digDown()
dig()
turtle.forward()
end
local function spaces()
for s=1,space do
  digCycle()
end
end
local function turnAround()
turtle.turnLeft()
turtle.turnLeft()
end
local function mineReturn()
for sl=1,stripLength do
  digCycle()
end
for gn=1,stripLength do
  turtle.back()
end
end
local function stripCycle()
  spaces()
  turtle.turnRight()
  mineReturn()
  turnAround()
  mineReturn()
  turtle,turnRight()
end --this is the line with the error
stripCycle()
all help is appreciated
theoriginalbit #2
Posted 17 January 2013 - 05:46 PM
Line 67… you have a , instead of a . in the turtle function call…


for future reference posting the whole error code is really helpful for us to help your quicker :)/>
Edited on 17 January 2013 - 04:48 PM
JaydenLoon3y #3
Posted 17 January 2013 - 05:50 PM
Thanks so much and i will defiantly do that in future
JaydenLoon3y #4
Posted 17 January 2013 - 06:02 PM
I have another problem with the same code the turtle doesn't move forward when it is instructed to
remiX #5
Posted 17 January 2013 - 06:06 PM
What CC version are using?

1.4+ needs fuel
JaydenLoon3y #6
Posted 17 January 2013 - 06:08 PM
wow ok i didnt even think about that thanks alot rookie error :P/>