Posted 05 January 2013 - 09:02 PM
I'm trying to make a turtle that will move around via rednet commands and plant tnt mines that can be triggered by a rednet message.
When I attempt to run the program that starts the turtle receiving rednet commands and acting on them I get this error message:
bios:206: [string "mine_turtle"]:33:
'=' expected
I'm assuming that for some reason it is expecting an = sign on line 33 somewhere but I dont see why when the normal syntax for that command doesn't require an = and it has been used almost exactly other times in the code with no problem.
Code:
When I attempt to run the program that starts the turtle receiving rednet commands and acting on them I get this error message:
bios:206: [string "mine_turtle"]:33:
'=' expected
I'm assuming that for some reason it is expecting an = sign on line 33 somewhere but I dont see why when the normal syntax for that command doesn't require an = and it has been used almost exactly other times in the code with no problem.
Code:
Spoiler
while true do
function dig()
turtle.digDown()
turtle.suckDown()
turtle.down()
turtle.digDown()
turtle.suckDown()
turtle.down()
turtle.select(2)
turtle.placeUp()
turtle.digDown()
turtle.select(1)
turtle.placeDown()
end
function fire()
redstone.setOutput("bottom", true)
end
function forward()
turtle.forward()
end
function backward()
turtle.back()
end
function left()
turtle.turnLeft()
end
function right()
turtle.turnRight()
end
function up()
turtle.up()
end
function down()
turtle.down()
end
rednet.open("right")
local event, p1, p2, p3, p4, p5 = os.pullEvent()
if event == "rednet_message: then
if p1 == 0 then
if p2 == "dig" then
dig()
elseif p2 == "forward" then
forward()
elseif p2 == "backward" then
backward()
elseif p2 == "left" then
left()
elseif p2 == "right" then
right()
elseif p2 == "up" then
up()
elseif p2 == "down" then
down()
elseif p2 == "fire" then
fire()
end
else
end
else
end
end