Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("predictSimpleQuarry.lua")
- os.loadAPI("userInput.lua")
- os.loadAPI("getTurtleFuel.lua")
- os.loadAPI("simpleQuarry.lua")
- os.loadAPI("turtleChest.lua")
- os.loadAPI("turtleForward.lua")
- local function clearScreen()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function volumeCheck(width, length, depth)
- tw = width
- tl = length
- td = depth
- if tw == 0 then
- tw = 1
- end
- if tl == 0 then
- tl = 1
- end
- if td == 0 then
- td = 1
- end
- volume = tw * tl * td
- width = width - 1
- print("Volume: " .. volume .. " blocks")
- if volume > 800 then
- print("WARNING! Volume over 800")
- print("Max is 1024 with Empty Inventory")
- print("With Stacks of 64.")
- end
- choice = tonumber(userInput.getUserInput("Proceed? 1 for yes, 2 for no"))
- if choice == 1 then
- return false
- else
- return true
- end
- end
- function fuelCheck(width, length, depth, loop)
- x = 0
- while x < loop do
- predictSimpleQuarry.predict(width, length, depth)
- x = x + 1
- end
- fuelcost = predictSimpleQuarry.getFuelCost()
- if fuelcost > turtle.getFuelLevel() then
- getTurtleFuel.displayFuelInfo()
- print("Quarry Fuel Cost = " .. fuelcost)
- print("Fuel too Low to Start, Please Insert Buckets")
- choice = tonumber(userInput.getUserInput("Type 1 to Refuel, Type 2 to Re-select Quarry"))
- if choice == 1 then
- turtleRefuel.refuelWithLava()
- turtle.select(1)
- if fuelcost > turtle.getFuelLevel() then
- print("Fuel Still too Low to Start, Terminating Program")
- os.sleep(3)
- end
- else
- return false
- end
- end
- return true
- end
- function quarry(loop, choice)
- if choice == "left" then
- direction = 0
- elseif choice == "right" then
- direction = 1
- else
- os.exit(1)
- end
- width = 5
- length = 5
- depth = 27
- volume = width * length * depth * loop + (length * loop)
- width = width - 1
- x = 0
- while x < loop do
- simpleQuarry.quarry(width, length, depth)
- turtle.turnLeft()
- turtleChest.insertAll()
- turtle.turnRight()
- x = x + 1
- y = -2
- if direction == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- while y < width do
- turtleForward.moveForward()
- y = y + 1
- end
- if direction == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
- function quarryGetDimensions(loop)
- choice = 0
- while choice ~= 1 and choice ~= 2 do
- clearScreen()
- print("Move forward or backwards after quarry?")
- print("1 for Forward, 2 for Backwards\n")
- choice = tonumber(read())
- if choice == 2 then
- direction = 0
- elseif choice == 1 then
- direction = 1
- else
- print("Incorrect Choice, Try again")
- os.sleep(1)
- end
- end
- check = true
- while check do
- clearScreen()
- width = tonumber(userInput.getUserInput("Enter Length: "))
- length = tonumber(userInput.getUserInput("Enter Width: "))
- depth = tonumber(userInput.getUserInput("Enter Depth: "))
- volume = width * length * depth * loop + (length * loop)
- width = width - 1
- check = not fuelCheck(width, length, depth, loop)
- if not check then
- check = volumeCheck(width, length, depth)
- end
- end
- x = 0
- while x < loop do
- simpleQuarry.quarry(width, length, depth)
- turtle.turnLeft()
- turtleChest.insertAll()
- turtle.turnRight()
- x = x + 1
- y = -2
- if direction == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- while y < width do
- turtleForward.moveForward()
- y = y + 1
- end
- if direction == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment