Advertisement
CelticCoder

smartManualQuarry

Jan 23rd, 2024 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("predictSimpleQuarry.lua")
  2. os.loadAPI("userInput.lua")
  3. os.loadAPI("getTurtleFuel.lua")
  4. os.loadAPI("simpleQuarry.lua")
  5. os.loadAPI("turtleForward.lua")
  6.  
  7. choice = 0
  8. while choice ~= 1 do
  9.     width = tonumber(userInput.getUserInput("Enter Length: "))
  10.     length = tonumber(userInput.getUserInput("Enter Width: "))
  11.     depth = tonumber(userInput.getUserInput("Enter Depth"))
  12.     tw = width
  13.     tl = length
  14.     td = depth
  15.     if tw == 0 then
  16.         tw = 1
  17.     end
  18.     if tl == 0 then
  19.         tl = 1
  20.     end
  21.     if td == 0 then
  22.         td = 1
  23.     end
  24.     volume = tw * tl * td
  25.     width = width - 1
  26.  
  27.     print("Use a Preset?")
  28.     choice = tonumber(userInput.getUserInput("Yes = 1, No = 2"))
  29.     if choice == 1 then
  30.         choice = tonumber(userInput.getUserInput("1 for sand, 2 for gravel"))
  31.         if choice == 1 then
  32.             blockname = "minecraft:sand"
  33.         else
  34.             blockname = "minecraft:gravel"
  35.         end
  36.     else
  37.         blockname = userInput.getUserInput("Please Input Block ID")
  38.     end
  39.  
  40.     print("Volume: " .. volume .. " blocks")
  41.  
  42.     if volume > 800 then
  43.         print("WARNING! Volume over 800")
  44.         print("Max is 1024 with Empty Inventory")
  45.         print("With Stacks of 64.")
  46.     end
  47.     print("Proceed?")
  48.     choice = tonumber(userInput.getUserInput("Yes = 1, No = 2"))
  49. end
  50.  
  51.  
  52. predictSimpleQuarry.predict(width, length, depth)
  53. fuelcost = predictSimpleQuarry.getFuelCost()
  54. if fuelcost > turtle.getFuelLevel() then
  55.     getTurtleFuel.displayFuelInfo()
  56.     print("Fuel too Low to Start, Please Insert Buckets")
  57.     userInput.getUserInput("Type Anything to Refuel")
  58.     shell.run("turtleRefuel.lua")
  59. end
  60. if fuelcost > turtle.getFuelLevel() then
  61.     print("Fuel Still too Low to Start, Terminating Program")
  62. else
  63.     simpleQuarry.smartQuarry(width, length, depth, blockname)
  64. end
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement