Susceptance

turtle rotate

Apr 24th, 2022 (edited)
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. dirTable = {{0, 1, 2, -1}, {-1, 0, 1, 2}, {2, -1, 0, 1}, {1, 2, -1, 0}}
  2.  
  3. function faceDir(dir, from)
  4.     turn = dirTable[from][dir]
  5.     print(turn)
  6.     if turn == 0 then
  7.         return
  8.     end
  9.    
  10.     if turn > 0 then
  11.         for i=1,turn do turtle.turnRight() end
  12.     else
  13.         for i=1,turn do turtle.turnLeft() end
  14.     end
  15. end
  16.  
  17. faceDir(3, 0)
Add Comment
Please, Sign In to add comment