Posted 28 July 2013 - 04:15 PM
I've been staring at this simple peice of code with a simple error message for too long now not being able to work out whats up (bare in mind im very new to lua and this is my first real attempt at a script :)/> )
I'm getting bios:338: [string "test"]:1: '=' expected on this code below
would anyone be able to point me in the right direction please? :)/>
thanks in advance.
I'm getting bios:338: [string "test"]:1: '=' expected on this code below
-- function for harvesting
local function harvest()
turtle.dig()
turtle.forward()
end
-- detecting left and right functions
local function detectLeft()
turtle.turnLeft()
turtle.detect()
end
local function detectRight()
turtle.turnRight()
turtle.turnRight()
turtle.detect()
end
-- quick check for position in rows
local function check()
if detectLeft() and detectRight() then
print("RAG")
elseif detectLeft() and not detectRight() then
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.up()
else
turtle.turnLeft()
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnLeft()
turtle.up()
end
end
end
--main loop
while true do
harvest()
if turtle.down() then
check()
else
harvest()
end
end
end
would anyone be able to point me in the right direction please? :)/>
thanks in advance.