Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##-- My turtle Program Made by Callum
- -- Current block
- print("This is Callum's 3x3 Tunnel Building Program")
- print("The turtle will Mine a 3x3 tunnel starting at the block IN FRONT of the currrent position of the turtle")
- print("ALWAYS but a chest directly behind where the turtle originally started for the materials to go into, otherwise the turtle will throw the items on the floor and despawn")
- local x
- -- How far to go
- local y
- -- Torches
- local t
- local f
- local p
- local v
- print("How far do you want me to mine?")
- x = 0
- y = tonumber(read())
- t = 7
- f = turtle.getFuelLevel()
- print("Do you want me to place torches? (Yes or No)")
- v = (read())
- p = y * 9 + y + y
- if f < p then
- print("This turtle does not have the necessary fuel to do the tunnel size you have selected.")
- print("the longest tunnel you can do is")
- print(f / 11)
- end
- while x < y do
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turtle.turnRight()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while turtle.detect() do
- turtle.dig()
- end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.4)
- end
- turtle.up()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnRight()
- turtle.turnRight()
- while turtle.detect() do
- turtle.dig()
- end
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.4)
- end
- turtle.up()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnRight()
- while turtle.detectDown() do
- turtle.digDown()
- end
- turtle.down()
- while turtle.detectDown() do
- turtle.digDown()
- end
- turtle.down()
- turtle.turnRight()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- while turtle.detect() do
- turtle.dig()
- end
- turtle.turnRight()
- x = x + 1
- t = t + 1
- if v == ("Yes") then
- if t==8 then
- turtle.turnLeft()
- turtle.place()
- turtle.turnRight()
- t = 1
- end
- end
- if turtle.getItemCount(16) > 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,x do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.select(2)
- turtle.drop(64)
- turtle.select(3)
- turtle.drop(64)
- turtle.select(4)
- turtle.drop(64)
- turtle.select(5)
- turtle.drop(64)
- turtle.select(6)
- turtle.drop(64)
- turtle.select(7)
- turtle.drop(64)
- turtle.select(8)
- turtle.drop(64)
- turtle.select(9)
- turtle.drop(64)
- turtle.select(10)
- turtle.drop(64)
- turtle.select(11)
- turtle.drop(64)
- turtle.select(12)
- turtle.drop(64)
- turtle.select(13)
- turtle.drop(64)
- turtle.select(14)
- turtle.drop(64)
- turtle.select(15)
- turtle.drop(64)
- turtle.select(16)
- turtle.drop(64)
- turtle.select(1)
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,x do
- turtle.forward()
- end
- end
- end
- if x==y then
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,x do
- if turtle.detect() then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.select(2)
- turtle.drop(64)
- turtle.select(3)
- turtle.drop(64)
- turtle.select(4)
- turtle.drop(64)
- turtle.select(5)
- turtle.drop(64)
- turtle.select(6)
- turtle.drop(64)
- turtle.select(7)
- turtle.drop(64)
- turtle.select(8)
- turtle.drop(64)
- turtle.select(9)
- turtle.drop(64)
- turtle.select(10)
- turtle.drop(64)
- turtle.select(11)
- turtle.drop(64)
- turtle.select(12)
- turtle.drop(64)
- turtle.select(13)
- turtle.drop(64)
- turtle.select(14)
- turtle.drop(64)
- turtle.select(15)
- turtle.drop(64)
- turtle.select(16)
- turtle.drop(64)
- print("I have finished your new Tunnel! All materials collected have been placed in the chest.")
- print("The current remaining fuel level is")
- print(f)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement