Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require("component")
- local gpu = com.gpu
- local modem = com.modem
- local colors = require("colors")
- local term = require("term")
- local kb = require("keyboard")
- local event = require("event")
- local thread = require("thread")
- OldF=gpu.getForeground()
- OldB=gpu.getBackground()
- OldSX,OldSY=gpu.getResolution()
- gpu.setResolution(80,25)
- NewF=colors.blue
- NewB=colors.orange
- gpu.setBackground(NewB,true)
- gpu.setForeground(NewF,true)
- term.clear()
- thread.init()
- locRU=
- {
- Version="0.1",
- Main="Автокрафт ",
- Error="Ошибка",
- Exit="Выход",
- AddRecept="Добавить рецепт"
- }
- --Заголовок--
- term.setCursor(40-(12/2),2)
- term.write(locRU.Main.." "..locRU.Version)
- --Выход--
- term.setCursor(80-7,24)
- term.write(locRU.Exit)
- --Добавить рецепт--
- term.setCursor(40-(17/2),13)
- term.write(locRU.AddRecept)
- --Поисковая строка--
- gpu.setBackground(colors.black)
- gpu.setForeground(colors.white)
- gpu.fill(20,16,40,3," ")
- while true do
- function KD()
- KD,_,_,_,_,_=event.pull("key_down")
- return KD
- end
- function Touch()
- Touch,_,ScreenX,ScreenY,_,nick=event.pull("touch")
- return Touch
- end
- thread.create(KD)
- thread.create(Touch)
- T=Touch()
- K=KD()
- if T and ScreenX>=73 and ScreenX<=78 and ScreenY==24 then
- break
- end
- if K and kb.isKeyDown(kb.keys.q) then
- break
- end
- if T and ScreenX>=20 and ScreenY<=60 and ScreenY==16 then
- term.setCursor(22,16)
- end
- thread.waitForAll()
- end
- gpu.setBackground(OldB)
- gpu.setForeground(OldF)
- gpu.setResolution(OldSX,OldSY)
- term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement