Advertisement
Dima99

Floor5

Jul 5th, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. --Program for computer craft's turtles (Minecraft)
  2.  
  3. a = 0
  4. print("What width?")
  5. y = read()
  6. a = y/2
  7. b = 0
  8. print("What length?")
  9. z = read()
  10. b = z - 1
  11. c = 0
  12. print("Where should I go after work?")
  13. print("0-down, 1-up")
  14. c = read()
  15. function slot()
  16. d = 0
  17. turtle.select(4)
  18. d = turtle.getItemCount(4)
  19. if d == 0 then turtle.select(3)
  20. end
  21. d = turtle.getItemCount(3)
  22. if d == 0 then turtle.select(2)
  23. end
  24. d = turtle.getItemCount(2)
  25. if d == 0 then turtle.select(1)
  26. end
  27. l = true
  28. d = turtle.getItemCount(1)
  29. if d == 0 then while l do
  30. print("Waiting for resourses")
  31. sleep(1)
  32. term.clear()
  33. term.setCursorPos(1, 1)
  34. sleep(1)
  35. u = 0
  36. u = turtle.getItemCount(1)
  37. if u > 0 then
  38. l = false
  39. end
  40. end
  41. end
  42. end
  43. function way()
  44. turtle.back()
  45. slot()
  46. turtle.place()
  47. end
  48. for i = 0, a do
  49. turtle.turnRight()
  50. turtle.turnRight()
  51. for i = 0, b do
  52. way()
  53. end
  54. turtle.turnLeft()
  55. turtle.forward()
  56. turtle.turnRight()
  57. turtle.turnRight()
  58. turtle.place()
  59. turtle.turnRight()
  60. for i = 0, b do
  61. way()
  62. end
  63. turtle.turnRight()
  64. turtle.forward()
  65. turtle.turnRight()
  66. turtle.turnRight()
  67. turtle.place()
  68. turtle.turnRight()
  69. end
  70. if c == 0 then
  71. turtle.down()
  72. slot()
  73. turtle.placeUp()
  74. else turtle.up()
  75. slot()
  76. turtle.placeDown()
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement