Advertisement
Myros27

Infinibot

Feb 24th, 2021 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. rm Infinity
  2. edit Infinity
  3. local robot = require("robot")
  4. local term = require("term")
  5. local computer = require("computer")
  6. local component = require("component")
  7. local sides = require("sides")
  8. local keyboard = require("keyboard")
  9.  
  10. maxbatt = 120000;
  11.  
  12. local function sucky()
  13. print("Activate vacuum cleaner");
  14. component.tractor_beam.suck()
  15. while (component.tractor_beam.suck()) do
  16. component.tractor_beam.suck();
  17. end
  18. end
  19.  
  20. local function dumpme()
  21. print("Getting rid of shit")
  22. for i = 1, robot.inventorySize() do
  23. robot.select(i)
  24. robot.drop()
  25. end
  26. robot.select(1);
  27. while computer.energy() < maxbatt do
  28. os.sleep(1);
  29. end
  30. end
  31.  
  32. local function burn()
  33. sucky()
  34. local vool, replaceable = robot.detect()
  35. if (replaceable == "replaceable") then
  36. print("Burn baby, burn");
  37. else
  38. roundfin = robot.use();
  39. if (roundfin == false) then
  40. finish = 1;
  41. end
  42. end
  43. end
  44.  
  45. local function burnLeft()
  46. robot.turnLeft();
  47. burn();
  48. robot.turnRight();
  49. if (roundfin == 1) then
  50. goto continue;
  51. end
  52. end
  53.  
  54. local function burnRight()
  55. robot.turnRight();
  56. burn();
  57. robot.turnLeft();
  58. if (roundfin == 1) then
  59. goto continue;
  60. end
  61. end
  62.  
  63.  
  64. while true do
  65. ::continue::
  66. while (robot.back())do end
  67. finish = 0;
  68. term.clear();
  69. robot.turnLeft();
  70. dumpme();
  71. robot.turnAround();
  72. robot.suck();
  73. component.inventory_controller.equip();
  74. robot.turnLeft()
  75. robot.forward();
  76. while (roundfin == 0) do
  77. for i=1,13 do
  78. burnLeft();
  79. burnRight();
  80. robot.forward();
  81. end
  82. for i=1,13 do
  83. burnLeft();
  84. burnRight();
  85. robot.back();
  86. end
  87. end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement