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