pirga

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

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