Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle Cave Detector
- -- Written by DiabolusNeil | CC 1.56
- -- Requires: Mining Turtle
- local bool = false
- if turtle.detectDown() == false then
- while turtle.detectDown() == false do
- turtle.down()
- end
- end
- if turtle.digDown() == false and turtle.detectDown() == true then
- print("Turtle cannot dig down!")
- else
- local num1
- local total = 0
- for i = 1, 16 do
- turtle.select(i)
- num1 = turtle.getItemCount()
- total = total + num1
- end
- if total ~= 0 then
- print("Clear the turtle's inventory!")
- else
- print("All ready to go! Excavating...")
- bool = true
- end
- end
- if bool then
- local level = 0
- while turtle.digDown() do
- turtle.digDown()
- level = level + 1
- end
- if turtle.detectDown() == true then
- for i = 1, level do
- turtle.up()
- end
- print("No cave detected below.")
- elseif turtle.detectDown() == false then
- for i = 1, level do
- turtle.up()
- end
- print("A cave has been detected!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment