Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- local holes = tArgs[1]
- local firstItem,lastItem = 4,13
- local Ypos = 64
- local temp = 0
- term.setCursorPos(1,1)
- term.clear()
- if #tArgs == 1 then
- print("Ok, I am going to make "..holes.." holes!")
- print("To cansel hold Ctrl + T in 1 second")
- sleep(5)
- else
- print("Error!")
- print("Wrong amount of arguments! This program only support 1 argument")
- print()
- print("Argument 1 = Holes you want to dig")
- holes = 0
- end
- function fuel()
- if turtle.getFuelLevel() <= 10 then
- turtle.select(16)
- turtle.refuel(1)
- end
- end
- function isValuable()
- for i=1,3 do
- turtle.select(i)
- if turtle.detect() == false or turtle.compare() then
- return false
- end
- end
- return true
- end
- function checkWalls(dep)
- for j=1,4 do
- if isValuable() then
- turtle.dig()
- end
- turtle.turnRight()
- end
- end
- function putAwayInventory()
- turtle.select(15)
- turtle.place()
- for i=firstItem,lastItem do
- turtle.select(i)
- turtle.drop()
- end
- end
- -- ( Program Start ) --
- for h = 1,holes do
- fuel()
- local depth = 1
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- while turtle.detectDown() == false do
- fuel()
- turtle.down()
- depth = depth + 1
- checkWalls(depth)
- turtle.digDown()
- end
- for k=1,depth do
- fuel()
- turtle.up()
- end
- turtle.select(14)
- turtle.placeDown()
- turtle.turnRight()
- putAwayInventory()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement