Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("libstruct")
- b=libstruct
- a=aware
- args = {...}
- if #args < 1 then
- error("Arguments: <name>")
- end
- t=b.load(args[1]..".3d")
- height=t["height"]
- width=t["width"]
- depth=t["depth"]
- endblock=t["endblock"]
- a.setposition("start")
- firstdown=true
- for h=0,height do
- if(firstdown) then
- firstdown=false
- pos=a.getposition("current")
- pos[3] = pos[3] - height-h --down
- a.goto(pos)
- elseif (h<=height) then
- pos=a.getposition("current")
- pos[3] = pos[3] + 1
- a.goto(pos)
- end
- w=width
- moveleft=true
- while (w > 0) do
- for d=0,depth do
- pos = a.getposition("current")
- print("Pos: h" .. pos[3]*-1 .. "-w" .. pos[1] .. "-d" .. pos[2])
- block = t[pos[3]*-1][pos[1]][pos[2]]
- b.place(block)
- if(d<depth) then
- a.df()
- end
- end
- w = w - 1
- if (w < 0) then
- moveleft=true
- else
- if(moveleft) then
- a.l()
- a.df()
- a.l()
- moveleft=false
- else
- a.r()
- a.df()
- a.r()
- moveleft=true
- end
- end
- end
- if(h<height) then
- a.r()
- a.r()
- end
- end
- a.goto(a.getposition("start"))
- b.awarecleanup()
Advertisement
Add Comment
Please, Sign In to add comment