Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- By Plazter modified by Kreezxil
- -- Original: https://pastebin.com/Sb8VwgwU
- -- By Kreezxil: https://pastebin.com/KMmf89b5
- -- - I added a waitForEnter() function, instead of using the stupid sleep()
- local block = 1
- local quarry = 13
- local tesseract = 16
- local landmark = 15
- local chest = 14
- local length = 10
- local height = 0
- function height()
- term.clear()
- term.setCursorPos(1,1)
- print("Do you wish the turtle to setup the quarry in air?")
- print("Press Y/N to confirm")
- local event, key = os.pullEvent("key")
- if key == keys.y then
- print("How far up?")
- input = read()
- if input then
- height = tonumber(input)
- end
- end
- end
- function waitForEnter()
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.enter then
- return key
- end
- end
- end
- function checkFuel()
- term.clear()
- term.setCursorPos(1,1)
- print("Checking if i have enough fuel..")
- sleep(2)
- if turtle.getFuelLevel() >= 500 then
- print("Im fine on fuel thanks.. press enter to continue.")
- waitForEnter()
- elseif turtle.getFuelLevel() < 500 then
- print("Please give me fuel master!")
- key = waitForEnter()
- if key == keys.enter then
- turtle.refuel()
- end
- end
- end
- function lenght()
- term.clear()
- term.setCursorPos(1,1)
- print("How big do you want the quarry?")
- input = read()
- if input then
- length = input
- elseif input == nil then
- print("Error..")
- end
- print("You have said that you want the quarry to be: ".. tostring(length))
- print("Are you sure?")
- print("Press Y/N")
- while true do
- local event, key = os.pullEvent("key")
- if key == keys.y then
- print("I'm gonna go a head and build you quarry!")
- sleep(2)
- Quarry()
- end
- if key == keys.n then
- print("You pressed N, breaking the program..")
- break
- end
- end
- end
- function Quarry()
- for i = 0, height do
- turtle.up()
- end
- -- [ Landmarks ] --
- for i = 1,length do
- turtle.forward()
- end
- turtle.select(block)
- turtle.forward()
- turtle.placeDown()
- turtle.back()
- turtle.select(landmark)
- turtle.place()
- for o = 1, length -1 do
- turtle.back()
- end
- turtle.turnRight()
- for p = 1,length do
- turtle.forward()
- end
- turtle.select(block)
- turtle.forward()
- turtle.placeDown()
- turtle.back()
- turtle.select(landmark)
- turtle.place()
- for a = 1, length do
- turtle.back()
- end
- turtle.turnLeft()
- turtle.select(block)
- turtle.placeDown()
- turtle.back()
- turtle.select(landmark)
- turtle.place()
- turtle.attack()
- -- [ Landmarks end] --
- turtle.back()
- turtle.select(quarry)
- turtle.place()
- turtle.up()
- turtle.select(chest)
- turtle.place()
- turtle.back()
- turtle.down()
- turtle.select(tesseract)
- turtle.place()
- print("Done.")
- for i = 0, height do
- turtle.down()
- end
- end
- function itemsSlot()
- term.clear()
- term.setCursorPos(1,1)
- print("Place following items in slot:")
- print("Block for air placement: 1")
- print("Quarry: 13")
- print("Chest: 14")
- print("Landmarks: 15")
- print("Tesseract: 16")
- print("Press enter when ready")
- waitForEnter()
- end
- -- [Main program] --
- itemsSlot()
- checkFuel()
- height()
- lenght()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement