Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local vec1 = vector.new(gps.locate(2, false))
- turtle.forward()
- local vec2 = vector.new(gps.locate(2, false))
- turtle.back()
- local heading
- if vec1 and vec2 then
- local resultVec = vec2 - vec1
- heading = ((resultVec.x + math.abs(resultVec.x) * 2) + (resultVec.z + math.abs(resultVec.z) * 3)) % 4
- --heading now contains a number 0-3 corresponding directly to the minecraft direction codes.
- end
Advertisement
Add Comment
Please, Sign In to add comment