Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package.loaded.gpgui = nil
- local gpgui = require("gpgui")
- local f = gpgui.newForm()
- local bs = {}
- local col = {"FF","4B","00"}
- function cols()
- local c1 = col[math.random(1,#col)]
- local c2 = col[math.random(1,#col)]
- local c3 = col[math.random(1,#col)]
- return tonumber("0x"..c1..c2..c3)
- end
- for i=1,10 do --для дохуищи кнопок
- bs["b"..i] = gpgui.newButton()
- bs["b"..i]:setPos(i*2,i*2)
- bs["b"..i]:setColors(cols(),cols())
- bs["b"..i]:setActiveColors(cols(),cols())
- bs["b"..i]:setFunc(function() print(i*i); end)
- f:add(bs["b"..i])
- end
- local b11 = gpgui.newButton()
- b11:setValue("ВЫЙТИ")
- b11:setSize(5,3)
- b11:setPos(74,37)
- b11:setFunc(function() require("term").clear();os.exit() end)
- b11:setColors(0xFF4B4B,0x4BFFFF)
- bs["b1"]:setFunc(function() print(os.date()) end)
- bs["b2"]:setFunc(function() print(os.time()) end)
- bs["b3"]:setFunc(function() print(cols()) end)
- f:add(b11)
- f:draw()
- local l = gpgui.newLabel()
- l:setValue("Дата")
- l:setPos(4,3)
- f:add(l)
- f:draw()
- l:setValue("Время")
- l:setPos(8,7)
- f:draw()
- gpgui.listen()
- f:listen()
- gpgui.ignore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement