Advertisement
Guest User

fill

a guest
May 27th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ChangeLog
  2.  
  3. -- local Variables
  4. local wide = 0
  5. local wideCount = 0
  6. local long = 0
  7. local longCount = 0
  8. local selectType = 1
  9. local fuelItem = turtle.getItemCount(1)
  10. local buildSlot = 3
  11.  
  12. local function refuel()
  13. repeat
  14. if turtle.getFuelLevel() < 100 then
  15. if fuelItem > 0 then
  16. turtle.select(1)
  17. turtle.refuel(1)
  18. else
  19. os.shutdown()
  20. end
  21. end
  22. until turtle.getFuelLevel () > 100 then
  23. end
  24.  
  25. local function fill()
  26. repeat
  27. repeat
  28. refuel()
  29. if turtle.getItemCount(buildSlot) > 0 then
  30. turtle.select(buildSlot)
  31. turtle.placeDown()
  32. turtle.forward()
  33. else
  34. buildSlot = buildSlot + 1
  35. turtle.select(buildSlot)
  36. turtle.placeDown()
  37. turtle.forward()
  38. end
  39. longCount = longCount + 1
  40. until long = longCount
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnRight()
  44. wideCount = wideCount + 1
  45. until wide == wideCount
  46.  
  47. --starting
  48. print("welcome to Fill Program")
  49. print("Please enter lenght you want to fill")
  50. input1 = io.read()
  51. long = tonumber(input1)
  52. print("Please Enter wide you want to fill")
  53. input2 = io.read()
  54. wide = tonumber(input2)
  55. print("Please enter what type fill you want")
  56. print("1 = Fill, 2 = Walls, 3 = Cube")
  57. input3 = io.read()
  58. selectType = tonumber(input3)
  59. fill()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement