Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chestSlot = 1;
- posX = 0
- posY = 0
- posZ = 0
- orientation = 0
- function forward()
- repeat
- turtle.dig()
- until turtle.forward()
- end
- function up()
- repeat
- turtle.digUp()
- until turtle.up()
- posZ = posZ + 1
- end
- function down()
- repeat
- turtle.digDown()
- until turtle.down()
- posZ = posZ - 1
- end
- function turnRight()
- turtle.turnRight()
- end
- function turnLeft()
- turtle.turnLeft()
- end
- function deposit()
- turnRight()
- turnRight()
- repeat
- turtle.dig()
- turtle.select(chestSlot)
- until turtle.place()
- for i=1,16 do
- if(i~=chestSlot)then
- turtle.select(i)
- turtle.drop()
- end
- end
- turtle.select(chestSlot)
- turtle.dig()
- turnRight()
- turnRight()
- turtle.select(2)
- end
- function checkFull()
- local currentSlot = turtle.getSelectedSlot()
- turtle.select(13)
- if (turtle.getItemCount()>0) then
- deposit()
- else
- turtle.select(currentSlot)
- end
- end
- function dig()
- turtle.dig()
- end
- print "Enter Length"
- length = tonumber(read())
- print "Enter Width"
- width = tonumber(read())
- print "Enter height (multiple of 6)"
- height = tonumber(read())
- print "Please place ender chest in slot 1. Press any key to start."
- os.pullEvent("key")
- local i = 1
- up()
- repeat
- turtle.dig()
- forward()
- turnRight()
- local j = 2
- repeat
- local k = 1
- repeat
- turtle.digUp()
- turtle.digDown()
- turtle.dig()
- forward()
- k = k + 1
- until k >= width
- turtle.digDown()
- checkFull()
- turnRight()
- turnRight()
- up()
- up()
- up()
- j = j + 3
- local k = 1
- repeat
- turtle.digUp()
- turtle.digDown()
- turtle.dig()
- forward()
- k = k + 1
- until k >= width
- turtle.digDown()
- checkFull()
- turnRight()
- turnRight()
- if(j>= height-1) then
- turtle.digUp()
- else
- up()
- up()
- up()
- j = j + 3
- end
- until j >= height - 1
- repeat
- down()
- down()
- down()
- j = j - 3
- until j <= 2
- turnLeft()
- i = i + 1
- until i > length
- down()
- turnLeft()
- turnLeft()
- repeat
- forward()
- i = i - 1
- until i <= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement