Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turnLeft=true;
- local failCount=0;
- local breakFloor=true;
- local sel=0;
- local slot=1
- local width=1;
- local length=1;
- local args={...}
- print("ceiling builder by Niseg")
- print("refuel the turtle put tell it to go down 2 and start")
- turtle.select(slot)
- if #args==3 then
- width=tonumber(args[1])
- length=tonumber(args[2])
- sel=tonumber(args[3])
- if width<1 or length <1 then
- print("invalid length or width")
- exit()
- end
- -- print("args3="+args[3])
- if sel ~=1 and sel~=2 then
- print("3rd arg invalid 1 right 2 left")
- exit(1)
- end
- else
- repeat
- print("width ")
- width=tonumber(read())
- until width>0
- repeat
- print("length ")
- length=tonumber(read())
- until length>0
- repeat
- print("build to (1) right ")
- print("built to (2) left")
- sel=tonumber(read())
- until sel==1 or sel==2
- end
- if(sel==1) then turnLeft=false end
- for i= 1,width,1 do
- for j= 1,length,1 do
- if turtle.getItemCount(slot)==0 then
- slot=slot+1
- if slot <17 then
- turtle.select(slot)
- end
- end
- turtle.placeUp()
- if j <length then turtle.forward() end
- end
- if(turnLeft) then turtle.turnLeft() else turtle.turnRight() end
- turtle.forward()
- if(turnLeft) then turtle.turnLeft() else turtle.turnRight() end
- turnLeft = not turnLeft;
- end
- print("done")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement