Advertisement
lpjakewolfskin

plotter

Nov 28th, 2021 (edited)
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pos = 0
  2.  
  3. function selectConcrete()
  4.   for i = 1, robot.inventorySize()/2 do
  5.     if robot.count(i*2-1) ~= 0 then
  6.       robot.select(i*2-1)
  7.       break
  8.     end
  9.   end
  10. end
  11.  
  12. function selectGlass()
  13.   for i = 1, robot.inventorySize()/2 do
  14.     if robot.count(i*2) ~= 0 then
  15.       robot.select(i*2)
  16.       break
  17.     end
  18.   end
  19. end
  20.  
  21. function swap()
  22.     if pos == 0 then
  23.         robot.turnLeft()
  24.         robot.forward()
  25.         robot.turnLeft()
  26.         pos = 1
  27.     else
  28.         robot.turnRight()
  29.         robot.forward()
  30.         robot.turnRight()
  31.         pos = 0
  32.     end
  33. end
  34.  
  35. function pattern1()
  36.     for i = 1, 15 do
  37.         selectConcrete()
  38.         robot.placeDown()
  39.         robot.forward()
  40.     end
  41.     selectConcrete()
  42.     robot.placeDown()
  43. end
  44.  
  45. function pattern2()
  46.     selectConcrete()
  47.     robot.placeDown()
  48.     robot.forward()
  49.     for i = 1, 14 do
  50.         selectGlass()
  51.         robot.placeDown()
  52.         robot.forward()
  53.     end
  54.     selectConcrete()
  55.     robot.placeDown()
  56. end
  57.  
  58. pattern1()
  59. swap()
  60.  
  61. for i = 1, 14 do
  62.     pattern2()
  63.     swap()
  64. end
  65.  
  66. pattern1()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement