local robot = require('robot') local c = require('component') local sides = require('sides') local API = {} local function Time(text, n) for i = 1, n do os.execute("clear") io.write(text, i) os.sleep(1) end end function API.Crystal() local t = c.tractor_beam local red = c.redstone local init = true local n = 1 while true do robot.select(n) if robot.count() ~= 0 then if robot.compareTo(14) or robot.compareTo(15) or robot.compareTo(16) then robot.dropUp() init = true elseif robot.compareTo(13) then for i = 1, 6 do robot.select(i) robot.dropDown() end Time('Время создание: ', 10) t.suck() for i = 1, 6 do robot.select(i) robot.dropUp() end else robot.dropDown() init = false end else robot.select(n) if n == 12 then n = 1 end end if not init then red.setOutput(sides.back, 15) Time("Время роста: ", 130) t.suck() red.setOutput(sides.back, 0) robot.select(1) end Time("Время ожидания: ",20) end end function API.Ore() while true do while robot.suckDown() or robot.suckUp() do if robot.place() then os.sleep(0.5) if robot.swing() then os.sleep(0.5) if robot.dropDown() then os.sleep(1) end end end end Time("Время ожидания руды: ", 300) end end return API