Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- original script by matdombrock/pyramid.lua
- b = 0 --bricks laid
- w = 0 --wall number
- h = 5 --height of the structure in layers
- i = 0 --current number layers
- x = 9--how wide the base should be
- n = 1 --selection number for inv
- function start()
- turtle.up()
- end
- function sel()
- if turtle.getItemCount(n) <1 then--check to see if we are out of material
- n = n+1
- end
- if n > 16 then --if we are done the last item slot
- n = 1 --switch back to slot one
- while turtle.getItemCount(1) <1 do --if there is nothing in slot one ask user to refill
- print ('please reload, by filling slot one last')
- sleep(1)
- end
- end
- turtle.select(n)--change slot
- end
- function buildlayer()
- if w == 0 then
- x = x -1
- end
- while w < 4 do --while we have not built 4 walls yet
- while b < x do
- sel()
- turtle.digDown()
- turtle.placeDown()
- turtle.forward()--build the wall
- b = b + 1
- end
- while b == x do
- turtle.turnLeft()--turn so we can build the next wall
- w = w+1
- b = 0
- end
- if w == 3 then
- x = x-1
- end
- end
- while w == 4 do
- turtle.placeDown()
- turtle.up()--move up so we can start another layer
- turtle.forward()
- w = 0
- end
- end
- start()
- while i < h do--while we have not reached our intended height
- buildlayer()
- i = i+1
- end
Advertisement
Add Comment
Please, Sign In to add comment