Advertisement
lachiu

Untitled

Aug 24th, 2020 (edited)
2,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. print("How wide do I mine, boss?")
  2. local Width = tonumber(read())
  3. print("How deep do I mine, boss?")
  4. local Depth = tonumber(read())
  5. print("How high do I mine, boss?")
  6. local Height = tonumber(read())
  7.  
  8. function Mine(Width,Depth,Height)
  9.     for calcDepth = 1,Depth,1
  10.         do
  11.        
  12.             file = io.open("log.txt", "a")
  13.             file:write("Current depth: " .. calcDepth .. ". Expected depth: " .. Depth .. "\n")
  14.             file:write("What gives? (d) " .. tostring(calcDepth < Depth) .. "\n")
  15.             file:close()
  16.  
  17.             for calcHeight = 1,Height,1
  18.                 do
  19.                     file = io.open("log.txt", "a")
  20.                     file:write("Current height: " .. calcHeight .. ". Expected height: " .. Height .. "\n")
  21.                     file:write("What gives? (h) " .. tostring(calcHeight < Height))
  22.                     file:write("\n")
  23.                     file:close()
  24.                     turtle.dig()
  25.                     turtle.up()
  26.        
  27.                 end
  28.         end
  29.  
  30.     for i = 1,Height,1
  31.         do
  32.             turtle.down()
  33.         end
  34.  
  35.     for i = 1,Depth,1
  36.         do
  37.             turtle.back()
  38.         end
  39. end
  40. Mine(Width, Depth, Height)
  41. print("Job completed, boss.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement