Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function goTillWall()
- while turtle.detect()==false do
- turtle.forward()
- end
- end
- local function goTillFloor()
- while turtle.detectDown()==false do
- turtle.down()
- end
- end
- local function countDistance()
- local count=1
- while turtle.detect()==false do
- turtle.forward()
- count=count+1
- end
- return count
- end
- local function countHeight()
- local count=1
- while turtle.detectUp()==false do
- turtle.up()
- count=count+1
- end
- return count
- end
- local function getInvCount()
- local itemCount=0
- local slot=1
- while slot<=16 do
- turtle.select(slot)
- itemCount=itemCount+turtle.getItemCount()
- slot=slot+1
- end
- return itemCount
- end
- goTillWall()
- turtle.turnLeft()
- goTillWall()
- turtle.turnLeft()
- local x=0
- local z=0
- local y=0
- x=countDistance()
- turtle.turnLeft()
- z=countDistance()
- goTillFloor()
- y=countHeight()
- print("Your room's dimension is the following x:",x," z:",z," y:",y)
- print("\nPut ",x*y*2+x*z*2+z*y*2, " blocks inside me and press enter, if the amount of blocks doesn't fit at once. I' ll stop when I ran out.")
- read()
- local blocks=0
- blocks=getInvCount()
- print("\n Blocks inside:",blocks)
- read()
Add Comment
Please, Sign In to add comment