CmdDebugs

trainForwardQuarryV2

Apr 17th, 2021 (edited)
881
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dist = read()
  2.  
  3. function dig_forward()
  4.     local success, data
  5.     while turtle.detect() do
  6.         success, data = turtle.inspect()
  7.         if success then
  8.             if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
  9.                 turtle.dig()
  10.             else
  11.                 break
  12.             end
  13.         else
  14.             turtle.dig()
  15.         end
  16.         sleep(0.5)
  17.     end
  18. end
  19.  
  20. function dig_up()
  21.     local success, data
  22.     while turtle.detectUp() do
  23.         success, data = turtle.inspectUp()
  24.         if success then
  25.             if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
  26.                 turtle.digUp()
  27.             else
  28.                 break
  29.             end
  30.         else
  31.             turtle.digUp()
  32.         end
  33.     sleep(0.5)
  34.     end
  35. end
  36.  
  37. function dig_down()
  38.     local success, data
  39.     while turtle.detectDown() do
  40.         success, data = turtle.inspectDown()
  41.         if success then
  42.             if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
  43.                 turtle.digDown()
  44.             else
  45.                 break
  46.             end
  47.         else
  48.             turtle.digDown()
  49.         end
  50.     sleep(0.5)
  51.     end
  52. end
  53.  
  54. for i = 1, dist do
  55.     dig_forward()
  56.     turtle.forward()
  57.     dig_down()
  58.     dig_up()
  59. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×