BillBodkin

clearAreaMaster

Sep 20th, 2021 (edited)
1,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.49 KB | None | 0 0
  1.  
  2. print("Across: ")
  3. local widthAmt = tonumber(read())
  4.  
  5. print("Forward: ")
  6. local forwardAmt = tonumber(read())
  7.  
  8. print("Down: ")
  9. local downAmt = tonumber(read())
  10.  
  11. print("Start Down: ")
  12. local startDownAmt = tonumber(read())
  13.  
  14. if fs.exists("disk/startup.lua") then
  15.     fs.delete("disk/startup.lua")
  16. end
  17. fs.copy("minerProgram.lua", "disk/startup.lua")
  18.  
  19. for i = 1, widthAmt, 2 do
  20.     while turtle.suckDown(1) == false do
  21.         print("Put more mining turtles in chest below, then press enter")
  22.         read()
  23.     end
  24.    
  25.     local minerParams = {
  26.         ["acrossAmt"] = i - 1,
  27.         ["forwardAmt"] = forwardAmt,
  28.         ["downAmt"] = downAmt,
  29.         ["startDownAmt"] = startDownAmt
  30.     }
  31.    
  32.     local file = fs.open("disk/minerParams.lua", "w")
  33.     file.write(textutils.serialise(minerParams))
  34.     file.close()
  35.    
  36.     turtle.place()
  37.    
  38.     local turtleInfront = peripheral.wrap("front")
  39.     turtleInfront.turnOn()
  40.    
  41.     sleep(3)
  42.    
  43.     while turtle.detect() do
  44.         turtle.turnRight()
  45.         while turtle.suck(32) == false do
  46.             turtle.drop(32)
  47.             print("Put more fuel in chest infront, then press enter")
  48.             read()
  49.         end
  50.         turtle.turnLeft()
  51.         if turtle.detect() then
  52.             turtle.drop(32)
  53.         end
  54.         sleep(2)
  55.     end
  56.    
  57.     turtle.turnRight()
  58.     for i = 1, 2 do
  59.         turtle.drop(64)
  60.     end
  61.     turtle.turnLeft()
  62.     turtle.dropUp(64)
  63.    
  64.     fs.delete("disk/minerParams.lua")
  65. end
  66.  
Add Comment
Please, Sign In to add comment