Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The command is: room length width height - example: room 5 5 3
- local args = {...}
- local length,width,height
- if( #args==2)then
- length = tonumber(args[1])
- width = tonumber( args[1])
- height = tonumber(args[2])
- print("Creating room with "..args[1].."x"..args[1].."x"..args[2].."...")
- elseif(#args==3)then
- length = tonumber(args[1])
- width = tonumber(args[2])
- height = tonumber( args[3])
- print("Creating room with "..args[1].."x"..args[2].."x"..args[3].."...")
- end
- local function forward()
- while not(turtle.forward())do
- turtle.dig()
- end
- end
- local function up()
- while not(turtle.up())do
- turtle.digUp()
- end
- end
- local tright = true
- local function turnAround()
- if(tright)then
- turtle.turnRight()
- forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- forward()
- turtle.turnLeft()
- end
- tright = not tright
- end
- for h=0, height-1 do
- if h > 0 then
- up()
- turtle.turnLeft()
- turtle.turnLeft()
- end
- for w=0, width-1 do
- if w > 0 then
- turnAround()
- end
- for l=0,length-2 do
- forward()
- end
- end
- --tright = (not tright)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement