Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeWall(x,count)
- if x==1 then
- --Right wall
- turtle.turnRight()
- if not turtle.detect() then
- selectGlass()
- turtle.place()
- end
- turtle.turnLeft()
- elseif x==2 then
- --Above
- if count%6==0 then
- turtle.digUp()
- sleep(0.4)
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.4)
- end
- selectGlow()
- turtle.placeUp()
- end
- if not turtle.detectUp() then
- selectGlass()
- turtle.placeUp()
- end
- elseif x==3 then
- --Left wall
- turtle.turnLeft()
- if not turtle.detect() then
- selectGlass()
- turtle.place()
- end
- turtle.turnRight()
- elseif x==4 then
- --Bottom
- if not turtle.detectDown() then
- selectGlass()
- turtle.placeDown()
- end
- end
- end
- function selectGlass()
- local x = 0
- for i = 2,12 do
- turtle.select(16)
- if turtle.compareTo(i) then
- if turtle.getItemCount(i)>16 then
- turtle.select(i)
- x = 1
- return true
- end
- end
- end
- if x == 0 then
- return false
- end
- end
- function renewGlass()
- while not selectGlass() do
- selectChest()
- turtle.placeDown()
- turtle.suckDown()
- turtle.suckDown()
- if turtle.getItemSpace(11)<64 then
- selectGlow()
- turtle.dropDown()
- end
- turtle.dropDown()
- collectChest()
- end
- end
- function selectGlow()
- local x = 0
- for i = 2,12 do
- turtle.select(15)
- if turtle.compareTo(i) then
- if turtle.getItemCount(i)>16 then
- turtle.select(i)
- x = 1
- return true
- end
- end
- end
- if x == 0 then
- return false
- end
- end
- function renewGlow()
- while not selectGlow() do
- selectChest()
- turtle.placeDown()
- turtle.suckDown()
- turtle.suckDown()
- if turtle.getItemSpace(11)<64 then
- selectGlass()
- turtle.dropDown()
- end
- turtle.dropDown()
- collectChest()
- end
- end
- function selectChest()
- turtle.select(1)
- end
- function selectChest1()
- for i=1,12 do
- turtle.select(14)
- if turtle.compareTo(i) then
- turtle.select(i)
- end
- end
- end
- function collectChest()
- turtle.select(1)
- turtle.digDown()
- end
- function forward()
- renewGlass()
- renewGlow()
- if turtle.getItemCount(12)>=1 then
- turtle.select(12)
- turtle.drop()
- end
- makeWall(1,count)
- makeWall(2,count)
- turtle.dig()
- turtle.down()
- makeWall(1,count)
- turtle.dig()
- turtle.down()
- makeWall(1,count)
- makeWall(4,count)
- turtle.dig()
- sleep(0.6)
- while turtle.detect() do
- turtle.dig()
- sleep(0.4)
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- makeWall(4,count)
- turtle.dig()
- sleep(0.4)
- while turtle.detect() do
- turtle.dig()
- sleep(0.4)
- end
- turtle.up()
- turtle.dig()
- turtle.up()
- makeWall(2,count)
- turtle.dig()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- makeWall(2,count)
- makeWall(3,count)
- turtle.dig()
- turtle.down()
- makeWall(3,count)
- turtle.dig()
- turtle.down()
- makeWall(3,count)
- makeWall(4,count)
- turtle.dig()
- sleep(0.4)
- while turtle.detect() do
- turtle.dig()
- sleep(0.4)
- end
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.up()
- turtle.up()
- turtle.forward()
- count=count+1
- return true
- end
- count = 0
- term.clear()
- term.setCursorPos(1,1)
- print("Enter how many blocks forward you would like to mine: ")
- blocks = io.read()
- for i=1,blocks do
- forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment