pirga

ферма дереваа на роботах

Aug 6th, 2019 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. local robot = require("robot")
  2. local inv = require("component").inventory_controller
  3. local comp = require("computer")
  4. local s = require("sides")
  5. local timeSleep = 0.1
  6. local timeSl = 0.5
  7. local maxH = 3
  8. local countTik = 0
  9.  
  10. print("начало")
  11.  
  12. function charging()
  13. robot.select(2)
  14. robot.turnRight()
  15. robot.drop()
  16. os.sleep(4)
  17. robot.suck()
  18. robot.turnLeft()
  19. end
  20.  
  21. while true do
  22. ---
  23. countTik = countTik+1
  24. --if robot.durability()<150 then
  25. if countTik==10 then
  26. charging()
  27. end
  28. print("---------")
  29. print(countTik)
  30. print("---------")
  31. if robot.count(16) >= 63 then
  32. for i = 4, 16 do
  33. robot.select(i)
  34. robot.dropDown()
  35. end
  36. end
  37.  
  38. robot.select(1)
  39. robot.place()
  40. os.sleep(timeSl)
  41. for i=1,10 do
  42. robot.use()
  43. end
  44. os.sleep(timeSl)
  45. robot.select(2)
  46. os.sleep(timeSl)
  47. inv.equip()
  48. os.sleep(timeSl)
  49. robot.swing()
  50. os.sleep(timeSl)
  51. robot.select(3)
  52. os.sleep(timeSl)
  53. inv.equip()
  54. os.sleep(timeSl)
  55. for i=1,maxH do
  56. robot.up()
  57. robot.swingUp()
  58. os.sleep(timeSleep)
  59. end
  60.  
  61. for i=1,maxH do
  62. robot.down()
  63. os.sleep(timeSleep)
  64. end
  65. os.sleep(timeSl)
  66. robot.select(3)
  67. inv.equip()
  68. robot.select(2)
  69. inv.equip()
  70.  
  71. os.sleep(5)
  72. ---
  73. end
  74.  
  75. print("работа выполнена")
Add Comment
Please, Sign In to add comment