Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require("component")
- local gpu = com.gpu
- local term = require("term")
- local GPAPI = require("GPAPI")
- local color = require("colors")
- local unicode = require("unicode")
- local comp = require("computer")
- local kb = require("keyboard")
- --Сохраняем старые настройки--
- local OldB = gpu.getBackground()
- local OldF = gpu.getForeground()
- local W,H = gpu.getResolution()
- --Ставим новые--
- gpu.setBackground(color.silver,true)
- gpu.setForeground(color.black,true)
- gpu.setResolution(160,42)
- local AddressList,NameList,ComList = {},{},com.list()
- for k,v in pairs(ComList) do
- print(k..v)
- table.insert(AddressList,k)
- table.insert(NameList,v)
- end
- k,v = nil
- i = nil
- GPAPI.textbox(1,2,"Component Monitor",nil,nil,nil,"center")
- GPAPI.textbox(150,24,"Выйти",color.black,color.silver)
- while true do
- local type,_,sX,sY,button,nick = comp.pullSignal(0.01)
- GPAPI.button(sX,sY,150,24,5,1,GPAPI.exit,{OldB,OldF,W,H})
- for i = 1,#AddressList do
- local colorL
- if colorL % 2 == 0 then
- colorL = color.silver
- else
- colorL = color.black
- end
- GPAPI.textbox(1,i,AddressList[i].." "..NameList[i],colorL,_,_,"center")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement