Advertisement
levshx

Place&Mine

Nov 21st, 2020
667
0
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 i_c = component.inventory_controller
  4. local sides = require("sides")
  5. local term = require("term")
  6.  
  7. term.clear()
  8.  
  9. print("LEVSHX SOFTWARE")
  10.  
  11. function dropRES()
  12. local i = 1
  13. robot.turnLeft()
  14. for i=1, 16 do
  15. robot.select(i)
  16. i_c.dropIntoSlot(sides.front, i )
  17. end
  18. robot.turnRight()
  19. robot.select(1)
  20. end
  21.  
  22. function takeRES()
  23. robot.turnAround()
  24. local inv, item = i_c.getInventorySize(sides.front)
  25. for slot = 1, inv do
  26. item = i_c.getStackInSlot(sides.front, slot)
  27. if item then
  28. i_c.suckFromSlot(sides.front, slot)
  29. break
  30. end
  31. end
  32. robot.turnAround()
  33. end
  34.  
  35. function workRES()
  36. robot.select(1)
  37. local items_count = robot.count(1)
  38. for i=1, items_count do
  39. robot.place()
  40. robot.swing()
  41. end
  42. end
  43.  
  44. while true do
  45. takeRES()
  46. workRES()
  47. dropRES()
  48. term.clear()
  49. print("")
  50. print("")
  51. print("")
  52. print("")
  53. print("               LEVSHX SOFTWARE")
  54. print("")
  55. print("")
  56. print("        Press Ctrl+Alt+C for exit program")
  57. os.sleep(1)
  58. term.clear()
  59. print("")
  60. print("")
  61. print("")
  62. print("")
  63. print("               LEVSHX SOFTWARE                     ")
  64. print("")
  65. print("")
  66. print("           Robot working ... wait")
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement