Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Excavate(length, width)
- turnRight = false
- while(GetBlockUnderneath)
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.down()
- for j=1,width do
- for i=1,length do
- turtle.digDown()
- turtle.digUp()
- turtle.dig()
- turtle.forward()
- end
- if(turnRight) then
- turtle.digDown()
- turtle.digUp()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turnRight = false
- else
- turtle.digDown()
- turtle.digUp()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turnRight = true
- end
- end
- end
- end
- function GetBlockUnderneath()
- if(turtle.inspectDown() == 7) then
- return false
- else
- return true
- end
- end
- function Tunnel()
- while(true) do
- TunnelLeftToRight()
- TunnelRightToLeft()
- end
- end
- function TunnelRightToLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- end
- function TunnelLeftToRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- end
- function Refuel()
- for i = 1, 16 do
- turtle.select(i)
- turtle.refuel()
- end
- end
- function Menu()
- Refuel()
- print("Mining by Keokix_")
- print("Select mode:")
- print("1: Strip mining, 3x1 and every 3rd block, 3 in each side")
- print("2: Excavate - Are is adjustable when selecting this")
- print("3: Tunnel - 3x3 Tunnel")
- print("Please select a mode:")
- input = io.read()
- if(input == "1") then
- StripMining()
- elseif(input == "2") then
- print("Please define the length in front direction: ")
- length = io.read()
- print("Please define the width (going in right direction):")
- width = io.read()
- Excavate(length, width)
- elseif(input == "3") then
- Tunnel()
- else
- print("Invalid input, Try again!")
- Menu()
- end
- end
- Menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement