Jump to content




Syntax error in strip mine program

turtle lua

  • You cannot reply to this topic
5 replies to this topic

#1 JaydenLoon3y

  • Members
  • 19 posts

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

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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 by TheOriginalBIT, 17 January 2013 - 05:48 PM.


#3 JaydenLoon3y

  • Members
  • 19 posts

Posted 17 January 2013 - 05:50 PM

Thanks so much and i will defiantly do that in future

#4 JaydenLoon3y

  • Members
  • 19 posts

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

#5 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 17 January 2013 - 06:06 PM

What CC version are using?

1.4+ needs fuel

#6 JaydenLoon3y

  • Members
  • 19 posts

Posted 17 January 2013 - 06:08 PM

wow ok i didnt even think about that thanks alot rookie error :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users