Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.21 KB | None | 0 0
  1. local Len = 0
  2. local Wid = 0
  3. local i = 1
  4. local j = 1
  5.  
  6. function MakeBlock()  --function to make a block; we only want to use inventory from 1-15; 16 reserved for fuel
  7. --print(j)
  8. print(i)
  9. print(Len)      
  10. --    if (getItemCount(j) ~= 0) and (j < 16) then --if inv. slot has items, AND not fuel slot 16 place block
  11. --        turtle.select(j)
  12. --        turtle.placeDown()
  13. --    else if j < 16 then         -- if fail, ( out of blocks and not fuel slot 16, incr. to next slot
  14. --        j = j + 1           -- incr. j, go to next slot
  15. --        turtle.select(j)
  16.  --       turtle.placeDown()  
  17. --       end  
  18. --    end
  19. end
  20.  
  21. function MakeRow()  --create function to build a row
  22.     repeat
  23.         turtle.digDown()
  24.         MakeBlock()
  25.         turtle.forward()
  26.         i = i + 1  
  27.     until i == 3 --Len --and (j<=16)
  28. end
  29.  
  30. --START OF PROGRAM program easy options menu; captures length & width variables
  31. write("Enter wall length and width\n")
  32.     write("enter length:")
  33.     Len = read()
  34.     write("enter width:")
  35.     Wid = read()
  36.     print("creating floor "..Len.." x "..Wid)
  37.  
  38.  
  39. print("making new row...")
  40. MakeRow()
  41.  
  42. print("Complete!")
  43.  
  44.  
  45. --rise up 1 level; for now keep it so its at foot level
  46. --turtle.up()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement