Advertisement
darthgustav

smallkube.lua

Feb 20th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. --SmallKube
  2. arg = {...}
  3.  
  4. local robot = require("robot")
  5.  
  6. require("undock")
  7.  
  8. require("machinework")
  9.  
  10. for j = 1,arg[1],1
  11. do
  12. --Move from Workspace toward Starting Corner
  13.  
  14. for i = 1,12,1
  15.  
  16. do
  17. robot.forward()
  18. end
  19.  
  20. --Face Starting Corner
  21. robot.turnRight()
  22.  
  23. --Move to Starting Corner
  24. robot.forward()
  25.  
  26. --Face Project Area
  27. robot.turnRight()
  28.  
  29. --Move into Working Position for placeDown
  30. robot.up()
  31.  
  32. --Work
  33.  
  34. --Select Stack 5
  35. robot.select(5)
  36.  
  37. --Place Walls on First Pass Floor
  38. for i = 1,3,1
  39.  
  40. do
  41. --Move to Place Walls
  42. robot.forward()
  43.  
  44. --Place Wall
  45. robot.placeDown()
  46. end
  47.  
  48. --Select Stack 6
  49. robot.select(6)
  50.  
  51. --Move and Turn for Second Pass Floor
  52. for i = 1,2,1
  53. do
  54. robot.forward()
  55. robot.turnRight()
  56. end
  57.  
  58. --Place Walls on Second Pass Floor
  59.  
  60. for i = 1,3,1
  61. do
  62. --Move Forward
  63. robot.forward()
  64.  
  65. --Place Wall
  66. robot.placeDown()
  67. end
  68.  
  69. --Select Stack 7
  70. robot.select(7)
  71.  
  72. --Move and Turn for Final Pass Floor
  73. for i = 1,2,1
  74. do
  75. --Move Forward
  76. robot.forward()
  77.  
  78. --Turn Left
  79. robot.turnLeft()
  80. end
  81.  
  82. --Place Walls on Final Pass Floor
  83. for i = 1,3,1
  84.  
  85. do
  86. --Move Forward
  87. robot.forward()
  88.  
  89. --Place Wall
  90. robot.placeDown()
  91. end
  92.  
  93. --Select Stack 8
  94. robot.select(8)
  95.  
  96. --Move up for Walls
  97. robot.up()
  98.  
  99. --Build Walls
  100. for x = 1,4,1
  101.  
  102. do
  103. --Place First Wall Block on this Side
  104. robot.placeDown()
  105.  
  106. --Facing for Walls
  107. robot.turnLeft()
  108.  
  109. --Building Walls
  110. for i = 1,2,1
  111.  
  112. do
  113. --Place Wall
  114. robot.placeDown()
  115.  
  116. --Move Forward
  117. robot.forward()
  118. end
  119. end
  120.  
  121. --Install Iron Core
  122.  
  123. --Select Stack 11
  124. robot.select(11)
  125.  
  126. --Move to Center
  127. for i = 1,2,1
  128.  
  129. do
  130. --Turn Left
  131. robot.turnLeft()
  132.  
  133. --Move Forward
  134. robot.forward()
  135. end
  136.  
  137. --Place Iron Core
  138. robot.placeDown()
  139.  
  140. --Move Back
  141. for i = 1,2,1
  142.  
  143. do
  144. --Turn Left
  145. robot.turnLeft()
  146.  
  147. --Move Forward
  148. robot.forward()
  149. end
  150. --Move Up for Ceiling
  151. robot.up()
  152.  
  153. --Select Stack 9
  154. robot.select(9)
  155.  
  156. --Facing Work Area
  157. for i = 1,2,1
  158. do
  159. robot.turnLeft()
  160. end
  161.  
  162. --Build Roof
  163. for i=1,3,1
  164.  
  165. do
  166. --Place Blocks on First Pass Ceiling
  167. robot.placeDown()
  168.  
  169. --Move to Place Next Block
  170. robot.forward()
  171. end
  172.  
  173. --Prepare for Second Pass Ceiling
  174. for i = 1,2,1
  175.  
  176. do
  177. --Turn Right before Next Pass
  178. robot.turnRight()
  179.  
  180. --Move forward before Next Pass
  181. robot.forward()
  182. end
  183.  
  184. --Place Blocks on First Pass Ceiling
  185. for i = 1,3,1
  186.  
  187. do
  188. --Place a Block
  189. robot.placeDown()
  190.  
  191. --Move Forward
  192. robot.forward()
  193. end
  194.  
  195. --Prepare for Final Pass Ceiling
  196. for i = 1,2,1
  197. do
  198.  
  199. --Turn Left for Final Pass Ceiling
  200. robot.turnLeft()
  201. --Move Forward for Final Pass Ceiling
  202. robot.forward()
  203. end
  204.  
  205. --Select Stack 10
  206. robot.select(10)
  207.  
  208. --Build Final Pass Ceiling
  209. for i = 1,3,1
  210.  
  211. do
  212. --Place Block
  213. robot.placeDown()
  214.  
  215. --Move Forward
  216. robot.forward()
  217. end
  218.  
  219. --Return to Shoot Pearl
  220.  
  221. --Turn Around
  222. for i=1,2,1
  223.  
  224. do
  225. robot.turnLeft()
  226. end
  227.  
  228. --Move toward Pearl Dispenser
  229. for i = 1,4,1
  230.  
  231. do
  232. robot.forward()
  233. end
  234.  
  235. --Turn Toward Pearl Dispenser
  236. robot.turnRight()
  237.  
  238. --Move Toward Pearl Dispenser
  239. for i = 1,2,1
  240.  
  241. do
  242. robot.forward()
  243. end
  244.  
  245. --Turn Toward Pearl Dispenser
  246. robot.turnLeft()
  247.  
  248. --Move to Pearl Dispenser Y Level
  249. robot.down()
  250.  
  251. --Move Toward Pearl Dispenser
  252. for i = 1,7,1
  253.  
  254. do
  255. robot.forward()
  256. end
  257.  
  258. --Turn to Shoot Pearl
  259. robot.turnLeft()
  260.  
  261. --Select Slot 47
  262. robot.select(47)
  263.  
  264. --Shoot Pearl
  265. robot.use()
  266.  
  267. --Move Down from Button
  268. for i = 1,2,1
  269.  
  270. do
  271. robot.down()
  272. end
  273.  
  274. --Move Toward Work Area
  275. robot.forward()
  276.  
  277. --Face Work Area
  278. robot.turnRight()
  279.  
  280. --Enter Work Area
  281. robot.forward()
  282.  
  283. --Face Field Area
  284. for i = 1,42,1
  285.  
  286. do
  287. robot.turnRight()
  288. end
  289.  
  290. if j % 3 == 0 then
  291.  
  292. require("machineworkreturn")
  293. require("restock")
  294. require("machinework")
  295. end
  296. end
  297.  
  298. require("machineworkreturn")
  299. require("restock")
  300. require("dock")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement