Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- shell.run("clear")
- print("Please ensure that I am facing North.")
- print("If I am not facing North, I will not make it to my destination.")
- sleep(5)
- print("Beginning journey in...")
- print("5")
- sleep(1)
- print("4")
- sleep(1)
- print("3")
- sleep(1)
- print("2")
- sleep(1)
- print("1")
- sleep(1)
- print("Beginning journey now.")
- local x, y, z = gps.locate()
- function ymoveup()
- updist = 10
- repeat
- turtle.up()
- updist = updist - 1
- until updist == 0
- updist = 10
- end
- function zmove()
- if z > 1096 then
- zdist = z - 1096
- repeat
- turtle.forward()
- zdist = zdist - 1
- until zdist == 0
- end
- if z < 1096 then
- zdist = z - 1096
- zdist = zdist * -1
- turtle.turnRight()
- turtle.turnRight()
- repeat
- turtle.forward()
- zdist = zdist - 1
- until zdist == 0
- turtle.turnRight()
- turtle.turnRight()
- end
- turtle.turnLeft()
- end
- function xmove()
- if x > 251 then
- xdist = x - 251
- repeat
- turtle.forward()
- xdist = xdist - 1
- until xdist == 0
- end
- if x < 251 then
- xdist = x - 251
- xdist = xdist * -1
- turtle.turnRight()
- turtle.turnRight()
- repeat
- turtle.forward()
- xdist = xdist - 1
- until xdist == 0
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- function ymovedown()
- y = y + updist
- ydist = y - 68
- repeat
- turtle.down()
- ydist = ydist - 1
- until ydist == 0
- turtle.turnRight()
- end
- function finished()
- shell.run("clear")
- print("Destination reached.")
- print("I am a good turtle.")
- print("Please pet me.")
- end
- ymoveup()
- zmove()
- xmove()
- ymovedown()
- finished()
Advertisement
Add Comment
Please, Sign In to add comment