Advertisement
Guest User

tur

a guest
Jul 24th, 2017
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.36 KB | None | 0 0
  1.  
  2. forwardForce = function (...)
  3.         len = 1
  4.         if ... ~= nil then len = ... end
  5.         for i=1, len do
  6.             while not turtle.forward() do
  7.                 turtle.dig()
  8.             end
  9.         end
  10. end
  11.  
  12. upForce = function (...)
  13.         len = 1
  14.         if ... ~= nil then len = ... end
  15.         for i=1, len do
  16.             while not turtle.up() do
  17.                 turtle.digUp()
  18.             end
  19.         end
  20. end
  21.  
  22. downForce = function (...)
  23.         len = 1
  24.         if ... ~= nil then len = ... end
  25.         for i=1, len do
  26.             while not turtle.down() do
  27.                 turtle.digDown()
  28.             end
  29.         end
  30. end
  31.  
  32. strafeLeftForce = function (...)
  33.         turtle.turnLeft()
  34.         len = 1
  35.         if ... ~= nil then len = ... end
  36.         for i=1, len do
  37.             while not turtle.forward() do
  38.                 turtle.dig()
  39.             end
  40.         end
  41.         turtle.turnRight()
  42. end
  43.  
  44. strafeRightForce = function (...)
  45.         turtle.turnRight()
  46.         len = 1
  47.         if ... ~= nil then len = ... end
  48.         for i=1, len do
  49.             while not turtle.forward() do
  50.                 turtle.dig()
  51.             end
  52.         end
  53.         turtle.turnLeft()
  54. end
  55.  
  56. backForce = function (...)
  57.         turtle.turnRight()
  58.         turtle.turnRight()
  59.         len = 1
  60.         if ... ~= nil then len = ... end
  61.         for i=1, len do
  62.             while not turtle.forward() do
  63.                 turtle.dig()
  64.             end
  65.         end
  66.         turtle.turnRight()
  67.         turtle.turnRight()
  68. end
  69.  
  70. back = function (...)
  71.         len = 1
  72.         if ... ~= nil then len = ... end
  73.         for i=1, len do
  74.             turtle.back()
  75.         end
  76. end
  77.  
  78. forward = function (...)
  79.         len = 1
  80.         if ... ~= nil then len = ... end
  81.         for i=1, len do
  82.             turtle.forward()
  83.         end
  84. end
  85.  
  86. up = function (...)
  87.         len = 1
  88.         if ... ~= nil then len = ... end
  89.         for i=1, len do
  90.             turtle.up()
  91.         end
  92. end
  93.  
  94. down = function (...)
  95.         len = 1
  96.         if ... ~= nil then len = ... end
  97.         for i=1, len do
  98.             turtle.down()
  99.         end
  100. end
  101.  
  102. strafeLeft = function (...)
  103.         turtle.turnLeft()
  104.         len = 1
  105.         if ... ~= nil then len = ... end
  106.         for i=1, len do
  107.             turtle.forward()
  108.         end
  109.         turtle.turnRight()
  110. end
  111.  
  112. strafeRight = function (...)
  113.         turtle.turnRight()
  114.         len = 1
  115.         if ... ~= nil then len = ... end
  116.         for i=1, len do
  117.             turtle.forward()
  118.         end
  119.         turtle.turnLeft()
  120. end
  121.  
  122. reverse = function ()
  123.     turtle.turnRight()
  124.     turtle.turnRight()
  125. end
  126.  
  127. digSafe = function()
  128.         while turtle.detect() do
  129.             turtle.dig()
  130.             os.sleep(0.5)
  131.         end
  132. end
  133.  
  134. digUpSafe = function()
  135.         while turtle.detectUp() do
  136.             turtle.digUp()
  137.             os.sleep(0.5)
  138.         end
  139. end
  140.  
  141. digDownSafe = function()
  142.         while turtle.detectDown() do
  143.             turtle.digDown()
  144.             os.sleep(0.5)
  145.         end
  146. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement