Advertisement
Wassaa

Sieve turtle

Dec 2nd, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.43 KB | None | 0 0
  1. p = peripheral.wrap("top")
  2.  
  3. function getOrientation()
  4. loc1 = vector.new(gps.locate(2, false))
  5. if not turtle.forward() then
  6.     for j=1,6 do
  7.             if not turtle.forward() then
  8.                     turtle.dig()
  9.          else break end
  10.     end
  11. end
  12. loc2 = vector.new(gps.locate(2, false))
  13. heading = loc2 - loc1
  14. return ((heading.x + math.abs(heading.x) * 2) + (heading.z + math.abs(heading.z) * 3))
  15. end
  16.  
  17. print(getOrientation())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement