Posted 20 June 2014 - 06:50 PM
I've read through this program several times and I can't seem to find the miss-spelled function.
setFacing:6: attempt to call nil
setFacing:6: attempt to call nil
local tArgs = ...
rednet.open("right")
local x,y,z = gps.locate(5)
setFacing(tArgs)
function getFacing()
turtle.dig()
turtle.forward()
x2,y2,z2 = gps.locate(5)
if x2 > x then
facing = 3
end
if x > x2 then
facing = 1
end
turtle.back()
turtle.turnRight()
turtle.dig()
turtle.forward()
x2,y2,z2 = gps.locate(5)
if z2 > z then
facing = 0
end
if z > z2 then
facing = 2
end
turtle.back()
turtle.turnLeft()
end
function setFacing(face)
getFacing()
while not facing == face do
turtle.turnRight()
getFacing()
end
end