Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- #########################
- -- # Torches, Chest, Empty #
- -- #########################
- -- # Torches = 15 #
- -- # Chest = 14 #
- -- #########################
- print("Starting branch-program")
- print("Please place your turtle like this:")
- print(" # # # ")
- print(" # # # ")
- print(" # T # ")
- print("When ready, press start")
- local message = io.read()
- if ( message == "start" ) then
- print("How many rows?")
- message = io.read()
- rows = tonumber( message )
- end
- if ( rows ~= 0 ) then
- for i=1, rows do
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- end
- -- ##################
- -- # Full inventory #
- -- ##################
- turtle.select(16)
- turtle.getItemCount()
- if turtle.getItemCount > 0 then
- turtle.select(14)
- turtle.place()
- turtle.select(1)
- turtle.drop()
- turtle.select(2)
- turtle.drop()
- turtle.select(3)
- turtle.drop()
- turtle.select(4)
- turtle.drop()
- turtle.select(5)
- turtle.drop()
- turtle.select(6)
- turtle.drop()
- turtle.select(14)
- turtle.dig()
- end
- else
- turtle.select(15)
- end
- -- ###########################
- -- # Return, placing torches #
- -- ###########################
- turtle.select(15)
- for i=1, rows do
- turtle.back()
- if i % 6 == 0 then
- turtle.place()
- end
- -- ######################
- -- # Starting a new row #
- -- ######################
- turtle.turnLeft()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- end
Advertisement
Add Comment
Please, Sign In to add comment