Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Get the startingposition for the turtle
- local home = vector.new(-93,69,249)
- --Move away from the original position
- --Turn to positive x direction
- --Get direction
- local position = vector.new(gps.locate(5))
- turtle.forward()
- local new_position = vector.new(gps.locate(5))
- local diff = new_position - position
- --Move to positive x
- if (diff.x < 0) then
- turtle.turnRight()
- turtle.turnRight()
- elseif (diff.z > 0) then
- turtle.turnLeft()
- elseif (diff.z < 0) then
- turtle.turnRight()
- end
- -- Move to the correct x posistion
- diff = new_position - home
- print(diff.x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement