Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local term = require("term")
- local com = require("component")
- if false == com.isAvailable("robot") then
- print("Эта прога для робота =Р")
- os.exit()
- end
- local unicode = require("unicode")
- local r = require("robot")
- local active_slot = 1
- local size = r.inventorySize()
- local gpu = com.gpu
- local w, h = 50, 16 -- разрешение экрана (1тир макс "50, 16")
- term.clear()
- gpu.setResolution(w, h)
- --gpu.setBackground(0xFFFFFF) -- цвет фона
- --gpu.setForeground(0x000000) -- цвет текста
- gpu.fill(1, 1, w, h, " ") -- заливаем пустоту
- -- Обводка экрана
- gpu.fill(1, 1, 1, 1, "┌")
- gpu.fill(1, h, 1, 1, "└")
- gpu.fill(1, 2 ,1, h-2, "│") -- левая пололса
- gpu.fill(w, 2, 1, h-2, "│") -- правая полоса
- gpu.fill(2, 1, w-2, 1, "─") -- верхняя полоса
- gpu.fill(2, h, w-2, 1, "─") -- нижняя полоса
- gpu.fill(w, 1, 1, 1, "┐")
- gpu.fill(w, h, 1, 1, "┘")
- -- Текст
- gpu.set(3, 2, "Робот "..r.name().." запущен!")
- gpu.fill(3, 3, unicode.len("Робот "..r.name().." запущен!"), 1, "─")
- gpu.set(w-1-unicode.len("by bogatyr4ik"), h-1, "by bogatyr4ik")
- while true do
- r.place(0, true)
- if r.count(active_slot) == 0 and r.select(active_slot) ~= size then
- active_slot = active_slot + 1
- end
- if r.select(active_slot) == size and r.count(active_slot) == 0 then
- active_slot = 1
- end
- os.sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement