Posted 14 August 2016 - 06:33 PM
Hey!
I am currently writing a program for my mining turtle. But the problem is, that when I start the program it gives me the error message "'(' expected" in line 4.
Could you please help me with this problem?
Here's my program:
regards, Natabam
I am currently writing a program for my mining turtle. But the problem is, that when I start the program it gives me the error message "'(' expected" in line 4.
Could you please help me with this problem?
Here's my program:
local searchedBlock = "minecraft:diamond_ore"
function forceForward
while turtle.forward() == false do
turtle.dig()
end
end
function forceUp
while turtle.up() == false do
turtle.digUp()
end
end
function forceDown
while turtle.down() == false do
turtle.digDown()
end
end
function forceBack
while turtle.back == false do
turtle.turnRight()
turtle.turnRight()
searchForBlock()
turtle.turnRight()
turtle.turnRight()
end
end
function inspectAll
searchForBlockUp()
searchForBlockDown()
for i=1, 4 do
searchForBlock()
turtle.turnRight()
end
end
function searchForBlock
success, data = turtle.inspect()
if success and data.name == searchedBlock then
forceForward()
inspectAll()
forceBack()
end
end
function searchForBlockUp
success, data = turtle.inspectUp()
if success and data.name == searchedBlock then
forceUp()
inspectAll()
forceDown()
end
end
function searchForBlockDown
success, data = turtle.inspectDown()
if success and data.name == searchedBlock then
forceDown()
inspectAll()
forceUp()
end
end
for i=1, 100 do
turtle.forward()
inspectAll()
end
regards, Natabam