Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local position = vector.new(gps.locate(0))
- local orientation
- function getPosition()
- position = vector.new(gps.locate(0))
- position.x = position.x -1
- end
- function getPositionOffset()
- getPosition()
- position.x = position.x%16
- position.y = position.y%16
- end
- function addOrientation(i)
- orientation = orientation + i
- if orientation == 4 then
- orientation = 0
- end
- if orientation == -1 then
- orientation = 3
- end
- end
- function turnRight()
- turtle.turnRight()
- addOrientation(1)
- end
- function setOrientationX()
- while orientation ~= 1 do
- turnRight()
- end
- end
- function move()
- while(turtle.forward() == false) do
- turtle.dig()
- turtle.suck()
- end
- end
- function goTo00()
- getPositionOffset()
- setOrientationX()
- for i = 0, position.x do
- move()
- end
- end
- goTo00()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement