The_Lux

mining_room ComputerCraft

Nov 21st, 2020
682
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("modules.lua")
  2.  
  3. print("How long should I dig?")
  4. local length = read()
  5. print("How wide should I dig?")
  6. local width = read()
  7. print("How high should I dig?")
  8. local height = read()
  9.  
  10. local front = true
  11. for i = 1, width do
  12.   for j = 1, height-1 do
  13.     for k = 1, length do
  14.       modules.check_fuel()
  15.       turtle.dig()
  16.       turtle.forward()
  17.     end
  18.     modules.check_fuel()
  19.     turtle.digUp()
  20.     turtle.up()
  21.     turtle.turnLeft()
  22.     turtle.turnLeft()
  23.     front = not front
  24.   end
  25.   for tdown = 1, height-1 do
  26.     modules.check_fuel()
  27.     turtle.down()
  28.   end
  29.   turtle.turnLeft()
  30.   turtle.turnLeft()
  31.   if not front then
  32.     for tfront = 1, length do
  33.       modules.check_fuel()
  34.       turtle.forward()
  35.     end
  36.   end
  37.   turtle.turnRight()
  38.   for twidth = 1, width -1 do
  39.     turtle.forward()
  40.   end
  41.   turtle.turnLeft()
  42.   modules.puke()
  43.   turtle.turnLeft()
  44.   for twidth = 1, width do
  45.     turtle.forward()
  46.   end
  47.   turtle.turnLeft()
  48. end
RAW Paste Data