Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Подключили модули--
- local gp = require("GPAPI")
- local comp = require("computer")
- local com,gpu,term,color,unicode,seri = gp.require()
- --Проверяем экран--
- if gpu.maxResolution() < 80 then
- print("Ваш экран I уровня. Нужен хотя бы II")
- os.exit()
- end
- --Переменные--
- local StyleBackground = color.gray
- local StyleForeground = color.white
- local char = string.char()
- --Сохранили старые настройки--
- local OldB,OldF,OldW,OldH = gp.saveOld()
- --Поставили новые настройки--
- gpu.setResolution(80,25)
- gpu.setBackground(StyleBackground,true)
- gpu.setForeground(color.green,true)
- --Отрисовка начального интерфейса--
- gp.textbox(_,2,"Code: Security","center")
- gp.textBox(_,24,char("U+2699").." Выйти","right",_,StyleForeground)
- gp.textbox()
- --Выбор типов защиты--
- gp.textbox(_,4,"Магнитная","center")
- gp.textbox(_,6,"RFID","center")
- gp.textbox(_,8,"Отпечаток пальца ноги","center")
- gp.textbox(_,10,"Детектор движения","center")
- gp.textbox(_,12,"Детектор душ","center")
- gp.textbox(_,14,"Keypad","center")
- gp.charStolb(30,4,6,"U+2610")
- --Стартовый цикл--
- while true do
- local typeT,_,sX,sY,button,nick = comp.pullSignal(0,"touch") --Захват сигнала касания
- --Кнопки--
- gp.button(sX,sY,70,24,5,1,GPAPI.exit,OldB,OldF,OldW,OldH)
- if typeT == "touch" then
- if sX >= 70 and sX < 75 then
- if sY >= 24 and sY < 25 then
- goto Settings
- end
- end
- end
- end
- --Цикл для меню настройки--
- ::Settings::
- term.clear()
- gp.textbox(_,2,"Code: Security","center")
- gp.textBox(_,24,"Выйти","right",_,StyleForeground)
- gp.textbox(_,2,"Вернуться")
- while true do
- local typeT,_,sX,sY,button,nick = comp.pullSignal(0,"touch") --Захват сигнала касания
- --Кнопки--
- gp.button(sX,sY,70,24,5,1,GPAPI.exit,OldB,OldF,OldW,OldH)
- end
- --Ставим старые настройки--
- gp.setOld(OldB,OldF,OldW,OldH)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement