Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y,z = 0,0,0
- isMoving = false
- function moveDelay()
- sleep(.4)
- return true
- end
- function moving()
- if isMoving == true then
- isMoving = false
- else
- isMoving = true
- end
- local h = fs.open("moving","w")
- h.write("moving = "..tostring(isMoving))
- h.close()
- end
- function forward()
- --update("forward")
- parallel.waitForAll(moveDelay,turtle.forward,record)
- end
- function record()
- z = z + 1
- local h = fs.open("record","w")
- h.write( "z = " ..textutils.serialize(z) )
- h.close()
- end
- for i = 1,15 do
- forward()
- end
- shell.run("record")
- shell.run("go rt 2")
- for i = 1,z do
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement