Posted 13 April 2012 - 10:00 AM
I can't see the problem with the code here. There isnt an error, but the code is skipping from 0 to 2, skipping the 3 between. It is supposed to count 0,3,2,1, then back and in that order. rotval is the rotation value of the turtle, like the f in minecraft coords. I will have a very similar one for turtle.turnRight(). Solved the problem, the only one remaining is how to work monitors, and how to send information from my turtle to my computer.
if button == 30 and rotval == 0 then
turtle.turnLeft()
rotval = 3
end
if button == 30 and rotval == 1 then
turtle.turnLeft()
rotval = 0
end
if button == 30 and rotval == 2 then
turtle.turnLeft()
rotval = 1
end
if button == 30 and rotval == 3 then
turtle.turnLeft()
rotval = 2
end
–Detects turning left
if button == 30 and rotval == 0 then
turtle.turnLeft()
rotval = 3
end
if button == 30 and rotval == 1 then
turtle.turnLeft()
rotval = 0
end
if button == 30 and rotval == 2 then
turtle.turnLeft()
rotval = 1
end
if button == 30 and rotval == 3 then
turtle.turnLeft()
rotval = 2
end
–Detects turning left