Kumodatsu

taw_tawtle_api_mov

Jun 30th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. --VERSION: 1
  2. --PASTEBIN: AW9g4CPK
  3.  
  4. --FUNC--
  5.  
  6. fwd = function(dist)
  7.  
  8.     for i = 1, dist, 1 do
  9.         repeat
  10.             turtle.dig()
  11.         until turtle.forward()
  12.     end
  13.  
  14. end
  15.  
  16. rgh = function(rot)
  17.    
  18.     for i = 1, rot, 1 do
  19.         turtle.turnRight()
  20.     end
  21.  
  22. end
  23.  
  24. lft = function(rot)
  25.    
  26.     for i = 1, rot, 1 do
  27.         turtle.turnLeft()
  28.     end
  29.  
  30. end
  31.  
  32. bck = function(dist)
  33.  
  34.     for i = 1, dist, 1 do
  35.         if not turtle.back() then
  36.             rgh(2)
  37.             fwd(1)
  38.             rgh(2)
  39.         end
  40.     end
  41.  
  42. end
  43.  
  44. upw = function(dist)
  45.    
  46.     for i = 1, dist, 1 do
  47.         repeat
  48.             turtle.digUp()
  49.         until turtle.up()
  50.     end
  51.  
  52. end
  53.  
  54. dwn = function(dist)
  55.  
  56.     for i = 1, dist, 1 do
  57.         repeat
  58.             turtle.digDown()
  59.         until turtle.down()
  60.     end
  61.  
  62. end
Add Comment
Please, Sign In to add comment