pirga

авто убийство сушек на роботе

Aug 13th, 2019 (edited)
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. local robot = require("robot")
  2. local inv = require("component").inventory_controller
  3.  
  4. function right()
  5. robot.turnRight()
  6. robot.forward()
  7. robot.turnLeft()
  8. end
  9.  
  10. function left()
  11. robot.turnLeft()
  12. robot.forward()
  13. robot.turnRight()
  14. end
  15.  
  16. function changeTool(i)
  17. robot.select(i)
  18. inv.equip()
  19. end
  20.  
  21. function goToStart()
  22. right()
  23. robot.down()
  24. robot.down()
  25. end
  26.  
  27. function place()
  28. robot.use()
  29. end
  30.  
  31. function createIs()
  32. place()
  33. robot.up()
  34. left()
  35. place()
  36. right()
  37. place()
  38. right()
  39. place()
  40. robot.up()
  41. changeTool(3)
  42. place()
  43. left()
  44. place()
  45. left()
  46. place()
  47. changeTool(3)
  48. end
  49.  
  50. function killIs()
  51. changeTool(1)
  52. while robot.swing() do
  53. robot.swing()
  54. end
  55. changeTool(1)
  56. end
  57.  
  58. function dropInv()
  59. --robot.suckUp()
  60. robot.up()
  61. left()
  62. for i = 4, 16 do
  63. robot.select(i)
  64. robot.dropDown()
  65. end
  66. right()
  67. robot.down()
  68. end
  69.  
  70. while true do
  71. while robot.count(3) > 2 do
  72. --print("начало")
  73. createIs()
  74. goToStart()
  75. os.sleep(5)
  76. killIs()
  77. os.sleep(1)
  78. if robot.count(4) > 0 then
  79. dropInv()
  80. end
  81. --print("конец")
  82. end
  83. end
Add Comment
Please, Sign In to add comment