Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local depth = 0
- local isJunk = true
- function fuel()
- if turtle.getFuelLevel() < 20 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- function up()
- fuel()
- if turtle.up() then
- return true
- depth = depth - 1
- else
- return false
- end
- end
- function down()
- fuel()
- if turtle.down() then
- return true
- depth = depth + 1
- else
- return false
- end
- end
- function checkWalls()
- for i = 1,4 do
- for j = 1,6 do
- turtle.select(i)
- if turtle.compare() then
- isJunk = true
- end
- end
- if isJunk == false then
- turtle.dig()
- end
- turtle.turnLeft()
- end
- end
- function digDown()
- for k = 1,6 do
- turtle.select(k)
- if turtle.compareDown() then
- if turtle.digDown() then
- return true
- else
- return false
- end
- end
- end
- turtle.select(1)
- turtle.digDown()
- end
- function digUp()
- for l = 1,6 do
- turtle.select(l)
- if turtle.compareUp() then
- if turtle.digUp() then
- return true
- else
- return false
- end
- end
- end
- turtle.select(1)
- turtle.digUp()
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("-------Mining Operation Alpha-------")
- term.setCursorPos(1,2)
- term.write("Commence Mining Operation? (y/n): ")
- local input = read()
- if input == "n" then
- term.setCursorPos(1,3)
- print("Cancelling Operation")
- sleep(1)
- exit()
- elseif input == "y" then
- term.setCursorPos(1,3)
- print("Commencing Alpha Mine")
- sleep(1)
- end
- digDn()
- down()
- digDn()
- down()
- turtle.select(7)
- turtle.placeUp()
- checkWalls()
- digDn()
- while down() do
- checkWalls()
- digDn()
- end
- up()
- turtle.select(15)
- turtle.placeDown()
- for m = 1,5 do
- up()
- end
- turtle.dig()
- fuel()
- turtle.forward()
- turtle.dig()
- fuel()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- fuel()
- turtle.forward()
- turtle.turnLeft()
- digDn()
- while down() do
- digdn()
- end
- checkWalls()
- up()
- turtle.select(15)
- turtle.placeDown()
- checkWalls()
- while depth > 1 do
- digUp()
- up()
- checkWalls()
- end
- digUp()
- up()
- up()
- turtle.select(7)
- turtle.placeDown()
- fuel()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- bios.lua:26: [string "mine.lua"]:14: 'end' expected (to close 'if' at line 12)
Add Comment
Please, Sign In to add comment