ziabl

drovosek

Sep 13th, 2020 (edited)
180
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local robot = require("robot")
  2. local component = require("component")
  3. local inv = component.inventory_controller
  4. local MIN_TOOL_CHARGE = 0.8
  5.  
  6. print 'Разработано корпорацией "Triple Zu #Ziabl_Inside#" (c) ziabl from TM#2-Orion'
  7. while true do
  8. for i = 1, 10 do
  9. robot.select(2)
  10. inv.equip()
  11. robot.use()
  12. inv.equip()
  13. o,t = robot.detect()
  14. while t == 'passable' do
  15. robot.use()
  16. o,t = robot.detect()
  17. end
  18. robot.select(1)
  19. inv.equip()
  20. robot.swing()
  21. inv.equip()
  22. os.sleep(15)
  23. robot.select(2)
  24. robot.suckUp()
  25. for n = 4, 15 do
  26. robot.suckUp()
  27. end
  28. end
  29. for n = 4, 15 do
  30. robot.select(n)
  31. robot.dropDown()
  32. end
  33. if robot.durability() < MIN_TOOL_CHARGE then
  34. robot.select(4)
  35. inv.equip()
  36. robot.dropDown()
  37. os.sleep(1)
  38. while robot.compareTo(5) ~= false do
  39. os.sleep(1)
  40. end
  41. inv.equip()
  42. end
  43. end
RAW Paste Data