Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.execute("pastebin get -f 19rEYzg1 NM")
- local com = require("component")
- local term = require("term")
- local gpu = com.gpu
- local color = require("colors")
- local comp = require("computer")
- local modem = com.modem
- --Сохранение старых настроек--
- local OldB = gpu.getBackground()
- local OldF = gpu.getForeground()
- local OldW,OldH = gpu.getResolution()
- --Установка новых настроек--
- gpu.setResolution(160,42)
- gpu.setBackground(color.gray)
- gpu.setForeground(color.black)
- term.clear()
- --Объявление функций--
- function textbox(x,y,text,colorF,colorB,hex)
- if not hex then
- if colorB ~= nil then
- gpu.setBackground(colorB,true)
- end
- if colorF ~= nil then
- gpu.setForeground(colorF,true)
- end
- else
- if colorB ~= nil then
- gpu.setBackground(colorB)
- end
- if colorF ~= nil then
- gpu.setForeground(colorF)
- end
- end
- term.setCursor(x,y)
- term.write(text)
- end
- function box(x,y,width,heidth,colorB,colorF,hex)
- if not hex then
- if colorB ~= nil then
- gpu.setBackground(colorB,true)
- end
- if colorF ~= nil then
- gpu.setForeground(colorF,true)
- end
- else
- if colorB ~= nil then
- gpu.setBackground(colorB)
- end
- if colorF ~= nil then
- gpu.setForeground(colorF)
- end
- end
- gpu.fill(x,y,width,heidth," ")
- end
- function drawLoadLine(x,y,weight,heidht,Value,colorB)
- gpu.setBackground(color.silver,true)
- gpu.fill(x,y,weight,heidht," ")
- gpu.setBackground(colorB,true)
- gpu.fill(x,y,weight/150*Value,heidht," ")
- end
- --Отрисовка статичного интерфейса
- textbox(70,1,"Nanomachines Control",color.gray,color.black)
- textbox(150,41,"Выйти")
- while true do
- local type,_,sX,sY,button,nick = comp.pullSignal(0)
- modem.open(1)
- modem.broadcast(1,"nanomachines","setInput",1,true)
- if type == "touch" then
- if sX >= 150 and sX <= 155 then
- if sY > 41 and sY <= 42 then
- break
- end
- end
- end
- if type == "modem_message" then
- textbox(1,3,button,nick)
- end
- end
- --Возвращение старых настроек--
- gpu.setBackground(OldB)
- gpu.setForeground(OldF)
- gpu.setResolution(OldW,OldH)
- term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement