Advertisement
Guest User

restock.lua

a guest
Feb 20th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.87 KB | None | 0 0
  1. --Restock
  2. local robot = require("robot")
  3.  
  4. --Move to Inventory Area
  5. for i = 1,21,1
  6.   do
  7.   robot.forward()
  8. end
  9.  
  10. -- Facing Inventory
  11. robot.turnLeft()
  12.  
  13. -- Approach Inventory Station 1
  14. for i = 1,5,1
  15.   do
  16.   robot.forward()
  17. end
  18.  
  19. -- Move Up
  20. robot.up()
  21.  
  22. -- Select Slot 1
  23. robot.select(1)
  24.  
  25.   require("cyclestock")
  26.  
  27. --Select Slot 11
  28. robot.select(11)
  29.  
  30.   require("cyclestock")
  31.  
  32. --Move to Second Inventory
  33. robot.turnRight()
  34. robot.forward()
  35. robot.turnLeft()
  36.  
  37. --Select Slot 2
  38. robot.select(2)
  39.  
  40.   require("cyclestock")
  41.  
  42. --Move to Third Inventory
  43. robot.turnRight()
  44. robot.forward()
  45. robot.turnLeft()
  46.  
  47. --Select Slot 3
  48. robot.select(3)
  49.  
  50.   require("cyclestock")
  51.  
  52. --Move to Fourth Inventory
  53. robot.turnRight()
  54. robot.forward()
  55. robot.turnLeft()
  56.  
  57. --Select Slot 4
  58. robot.select(4)
  59.  
  60. require("cyclestock")
  61.  
  62.  
  63. --Select Slot 5
  64. robot.select(5)
  65.  
  66. require("cyclestock")
  67.  
  68.  
  69. --Select Slot 6
  70. robot.select(6)
  71.  
  72. require("cyclestock")
  73.  
  74. --Select Slot 7
  75. robot.select(7)
  76.  
  77. require("cyclestock")
  78.  
  79. --Select Slot 8
  80. robot.select(8)
  81.  
  82. require("cyclestock")
  83.  
  84. --Select Slot 9
  85. robot.select(9)
  86.  
  87. require("cyclestock")
  88.  
  89. --Select Slot 10
  90. robot.select(10)
  91.  
  92. require("cyclestock")
  93.  
  94. --Move to Fifth Inventory
  95. robot.turnRight()
  96. robot.forward()
  97. robot.turnLeft()
  98.  
  99. --Select Slot 12
  100. robot.select(12)
  101.  
  102.   require("cyclestock")
  103.  
  104. --Move to Sixth Inventory
  105. robot.turnRight()
  106. robot.forward()
  107. robot.turnLeft()
  108.  
  109. --Select Slot 13
  110. robot.select(13)
  111.  
  112.   require("cyclestock")
  113.  
  114. --Move to Seventh Inventory
  115. robot.turnRight()
  116. robot.forward()
  117. robot.turnLeft()
  118.  
  119. --Select Slot 14
  120. robot.select(14)
  121.  
  122.   require("cyclestock")
  123.  
  124. --Return to Undock Waypoint
  125.  
  126. --Face the Field Area
  127. for i = 1,2,1
  128.   do
  129.   robot.turnRight()
  130. end
  131.  
  132. --Move toward the Field Area
  133. for i = 1,5,1
  134.   do
  135.   robot.forward()
  136. end
  137.  
  138. --Face the Undock Point
  139. robot.turnRight()
  140.  
  141. --Move Down to Align to Undock Point
  142. robot.down()
  143.  
  144. --Return to the Undock Point
  145. for i = 1,27,1
  146.   do
  147.   robot.forward()
  148. end
  149.  
  150. --Face Work Area
  151. for i = 1,2,1
  152.   do
  153.   robot.turnRight()
  154. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement