Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blockIdx = 1
- local slabIdx = 5
- local wallIdx = 9
- local torchIdx = 13
- function selectOrDie(idx)
- turtle.select(idx)
- if turtle.getItemCount() <= 0 then
- error("Out of items at idx: "..idx)
- end
- end
- function initial()
- turtle.up()
- selectOrDie(slabIdx)
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.placeDown()
- end
- function bridge()
- turtle.forward()
- selectOrDie(blockIdx)
- turtle.placeDown()
- turtle.turnRight()
- turtle.forward()
- selectOrDie(wallIdx)
- turtle.placeDown()
- turtle.up()
- turtle.placeDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.down()
- turtle.forward()
- selectOrDie(blockIdx)
- turtle.placeDown()
- turtle.forward()
- selectOrDie(wallIdx)
- turtle.placeDown()
- turtle.up()
- turtle.placeDown()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.down()
- turtle.forward()
- turtle.turnLeft()
- end
- function turnAround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function torch()
- selectOrDie(torchIdx)
- turtle.up()
- turtle.turnRight()
- turtle.place()
- turnAround()
- turtle.forward()
- turtle.place()
- turnAround()
- turtle.forward()
- turtle.turnLeft()
- turtle.down()
- end
- local len = 1
- -- Entrance
- initial()
- bridge()
- torch()
- for i=1,50 do
- bridge()
- if len % 15 == 0 then
- torch()
- end
- len = len + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement