Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.refuel()
- SETL = 0 -- How far seting
- SETW = 0 -- How wide seting
- SETH = 0 -- How tall seting
- L = 1 -- Far dis.
- W = 0 -- Wide dis.
- H = 0 -- Tall dis.
- SL = 0 -- secondary Demenchons
- SW = 0
- SH = 0
- ----
- UPDown = 1 -- If going up up then 0
- ----
- LeftRight = 0 -- Tells which way it is going 0=Right
- Start = 1
- ----
- EP = 1 -- If At End Pont 0 = false
- ----
- FL = 0 -- FuelLevel
- GOOD = "Y"
- BAD = "N"
- --------
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("How Deep Do You Want To Go?")
- print(">")
- term.setCursorPos(2,2)
- SETL = io.read()
- term.setCursorPos(1,1)
- term.clear()
- print("The Turtle Will go "..SETL.." Blocks")
- print("Are You Sure? Input = "..SETL)
- print(">")
- term.setCursorPos(2,3)
- Input = io.read()
- if Input == GOOD then
- term.clear()
- term.setCursorPos(1,1)
- print("Inputing")
- sleep(.5)
- break
- end
- if Input == BAD then
- term.clear()
- term.setCursorPos(1,1)
- print("Undoing Input")
- sleep(.5)
- end
- if Input ~= Good or Input ~= BAD then
- term.clear()
- term.setCursorPos(1,1)
- print("Invaled Input")
- sleep(.5)
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- while true do
- print("How Tall Do You Want The Tunnel?")
- print(">")
- term.setCursorPos(2,2)
- SETH = io.read()
- term.clear()
- term.setCursorPos(1,1)
- print("The Turtle Will Go "..SETH.." Blocks Tall")
- print("Are You Sure? Input = "..SETH)
- print(">")
- term.setCursorPos(2,3)
- Input = io.read()
- term.clear()
- term.setCursorPos(1,1)
- if Input == GOOD then
- print("Inputing")
- sleep(.5)
- break
- end
- if Input == BAD then
- print("Undoing Input")
- sleep(.5)
- end
- if Input ~= GOOD or Input ~= BAD then
- print("Invaled Input")
- sleep(.5)
- end
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("How Wide Do You Want The Tunnel?")
- print(">")
- term.setCursorPos(2,2)
- SETW = io.read()
- break
- end
- function Left()
- turtle.turnLeft()
- end
- function Right()
- turtle.turnRight()
- end
- function UPCheck()
- if turtle.detectUp() == true then
- UpDetect = 1
- else
- UpDetect = 0
- end
- end
- function FORWARDCheck()
- if turtle.detect() == true then
- ForwardDetect = 1
- else
- ForwardDetect = 0
- end
- end
- function Start()
- FORWARDCheck()
- while true do
- if ForwardDetect == tonumber(0) then
- turtle.forward()
- else
- break
- end
- FORWARDCheck()
- end
- end
- function MineUP()
- while H ~= SETH-1 do
- UPCheck()
- while UpDetect == tonumber(1) do
- turtle.digUp()
- sleep(.4)
- UPCheck()
- end
- if H < tonumber(SETH) then
- turtle.up()
- H = H+1
- end
- end
- end
- function MineDOWN()
- while H ~= tonumber(0) do
- turtle.digDown()
- if H > tonumber(0) then
- turtle.down()
- H = H-1
- end
- end
- end
- function MineForward()
- FORWARDCheck()
- while ForwardDetect == tonumber(1) do
- turtle.dig()
- sleep(.4)
- FORWARDCheck()
- end
- turtle.forward()
- end
- END2 = 0
- Start()
- MineForward()
- turtle.turnRight()
- LeftRight = 0
- --------
- function Layer()
- Start = 0
- W = 0
- EP = 0
- if L ~= tonumber(SETL) then
- END = 0
- else
- END2 = 1
- end
- if END == tonumber(0) then
- while W ~= tonumber(SETW) do
- if UPDown == tonumber(1) then
- MineUP()
- UPDown = 0
- else
- MineDOWN()
- UPDown = 1
- end
- if SETW ~= tonumber(0) then
- if W == tonumber(SETW - 1) then
- break
- else
- MineForward()
- W = W + 1
- end
- end
- end
- if END2 == tonumber(1) then
- END = 1
- end
- EP = 1
- end
- end
- function EPLeft()
- if EP == tonumber(1) and L ~= tonumber(SETL) and Start == tonumber(0) then
- Left()
- MineForward()
- L = L + 1
- Left()
- LeftRight = 1
- end
- end
- function EPRight()
- if EP == tonumber(1) and L ~= tonumber(SETL) then
- Right()
- MineForward()
- L = L + 1
- Right()
- LeftRight = 0
- end
- end
- --------
- while true do
- while L ~= tonumber(SETL) do
- if UPDown == tonumber(1) and LeftRight == tonumber(0) and L < tonumber(SETL + 1) then
- EPLeft()
- Layer()
- end
- if UPDown == tonumber(0) and LeftRight == tonumber(0) and L < tonumber(SETL + 1) then
- EPLeft()
- Layer()
- end
- if UPDown == tonumber(0) and LeftRight == tonumber(1) and L < tonumber(SETL + 1) then
- EPRight()
- Layer()
- end
- if UPDown == tonumber(1) and LeftRight == tonumber(1) and L < tonumber(SETL + 1) then
- EPRight()
- Layer()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement