2021-05-14 20:11:50 +00:00
|
|
|
local robot = require("robot")
|
|
|
|
local component = require("component")
|
2021-05-14 20:13:40 +00:00
|
|
|
local shell = require("shell")
|
2021-05-14 20:14:38 +00:00
|
|
|
local event = require("event")
|
|
|
|
local computer = require("computer")
|
2021-05-14 20:11:50 +00:00
|
|
|
local magnet = component.tractor_beam
|
|
|
|
local inv = component.inventory_controller
|
|
|
|
|
|
|
|
shell.execute("clear")
|
|
|
|
print("U - обновить ПО робота, E - выйти в OpenOS")
|
|
|
|
|
|
|
|
function onKeyPressed()
|
|
|
|
local _, _, _, key, _ = event.pull(0.05, "key_down")
|
|
|
|
if key == 0x16 then
|
|
|
|
computer.shutdown(true)
|
|
|
|
elseif key == 0x12 then
|
|
|
|
os.exit()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function farmSkeletons()
|
|
|
|
for i = 1, 3 do
|
|
|
|
robot.swingDown()
|
|
|
|
end
|
2021-05-14 20:12:11 +00:00
|
|
|
magnet.suck()
|
2021-05-14 20:11:50 +00:00
|
|
|
for i = 1, 8 do
|
|
|
|
robot.select(i)
|
|
|
|
robot.drop()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
while true do
|
|
|
|
onKeyPressed()
|
|
|
|
farmSkeletons()
|
|
|
|
end
|