Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- version = 7.1
- running = true
- --Images
- _dt = paintutils.loadImage("dt")
- _dt2 = paintutils.loadImage("dt2")
- _shutdown = paintutils.loadImage("/.shutdown/apagado")
- _shutdown2 = paintutils.loadImage("/.shutdown/apagado2")
- _shutdown3 = paintutils.loadImage("/.shutdown/apagado3")
- _shutdown4 = paintutils.loadImage("/.shutdown/apagado4")
- _shutdown5 = paintutils.loadImage("/.shutdown/apagado5")
- _shutdown6 = paintutils.loadImage("/.shutdown/apagado6")
- _shutdown7 = paintutils.loadImage("/.shutdown/apagado7")
- _shutdown8 = paintutils.loadImage("/.shutdown/apagado8")
- _shutdown9 = paintutils.loadImage("/.shutdown/apagado9")
- _shutdown10 = paintutils.loadImage("/.shutdown/apagado10")
- _shutdown11 = paintutils.loadImage("/.shutdown/apagado11")
- _shutdown12 = paintutils.loadImage("/.shutdown/apagado12")
- _shutdown13 = paintutils.loadImage("/.shutdown/apagado13")
- _shutdown14 = paintutils.loadImage("/.shutdown/apagado14")
- --Colors
- --Booleans
- _ms = 0
- _rcm = 0
- --Functions
- clear = function()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1 ,1)
- end
- drawMenu1 = function()
- term.setCursorPos(1, 2)
- term.setBackgroundColor( colors.blue )
- term.setTextColor( colors.white )
- print( "Apagar" )
- end
- ReDraw = function()
- drawDeskTop()
- drawTaskBar()
- end
- drawTaskBar = function()
- term.setCursorPos(1, 1)
- --term.setBackgroundColor( colTaskBar )
- term.clearLine()
- term.setCursorPos( 1, 1 )
- term.setBackgroundColor( colors.lime )
- term.setTextColor( colors.white )
- term.write( "Inicio" )
- end
- drawRightClickMenu = function(x, y)
- term.setCursorPos(x, y)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.write(" LUA ")
- term.setCursorPos(x, y+1)
- term.write(" IDE ")
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- while true do
- if button ==1 and yPos == y and xPos <= (x+9) and xPos >= x then
- running = false
- clear()
- term.setTextColor( colors.red )
- print("Abriendo Simbolo de Sistema...")
- print("El sistema podria apagarse tras salir del Simbolo de Sistema")
- print("Ninguna funcion del Sistema esta en las funciones de LUA ahora")
- shell.run("lua")
- break
- elseif button == 1 and yPos == (y+1) and xPos <= (x+9) and xPos >= x then
- shell.run("edit", "/gui")
- init()
- break
- else
- ReDraw()
- break
- end
- end
- _rcm = 0
- end
- drawDeskTop = function()
- term.setBackgroundColor( colBackground)
- term.clear()
- term.setCursorPos(1 ,1)
- paintutils.drawImage(_dt, 1, 1)
- end
- closingSesion = function()
- paintutils.drawImage(_shutdown, 1, 1)
- term.setCursorPos(18 ,9)
- print("Cerrando sesion")
- term.setCursorPos(1 ,1)
- sleep(1)
- shell.run("clear")
- paintutils.drawImage(_shutdown4, 1, 1)
- term.setCursorPos(18 ,9)
- print("Cerrando sesion")
- term.setCursorPos(1 ,1)
- sleep(2)
- shell.run("clear")
- paintutils.drawImage(_shutdown7, 1, 1)
- term.setCursorPos(18 ,9)
- print("Cerrando sesion")
- term.setCursorPos(1 ,1)
- sleep(2)
- shell.run("clear")
- paintutils.drawImage(_shutdown12, 1, 1)
- term.setCursorPos(18 ,9)
- print("Cerrando sesion")
- term.setCursorPos(1 ,1)
- sleep(3)
- paintutils.drawImage(_shutdown, 1, 1)
- term.setCursorPos(18 ,9)
- print("Apagando equipo")
- term.setCursorPos(1 ,1)
- sleep(1)
- shell.run("clear")
- paintutils.drawImage(_shutdown4, 1, 1)
- term.setCursorPos(18 ,9)
- print("Apagando equipo")
- term.setCursorPos(1 ,1)
- sleep(2)
- shell.run("clear")
- paintutils.drawImage(_shutdown7, 1, 1)
- term.setCursorPos(18 ,9)
- print("Apagando equipo")
- term.setCursorPos(1 ,1)
- sleep(2)
- shell.run("clear")
- paintutils.drawImage(_shutdown12, 1, 1)
- term.setCursorPos(18 ,9)
- print("Apagando equipo")
- term.setCursorPos(1 ,1)
- sleep(3)
- shell.run("shutdown")
- end
- loadConfig = function()
- end
- stop = function()
- clear()
- running = false
- paintutils.drawImage(_dt2, 1, 1)
- term.setCursorPos(18 ,9)
- term.setTextColor( colors.black )
- print("Apagando equipo")
- sleep(2)
- clear()
- term.setCursorPos(18 ,9)
- print("Cerrando sesion")
- exit()
- end
- runTime = function()
- while running do
- event, button, x, y = os.pullEvent("mouse_click")
- if _ms == 0 and button == 1 and x < 10 and y == 1 then
- drawMenu1()
- _ms = 1
- elseif _ms == 1 and button == 1 and y == 2 and x < 10 then
- stop()
- elseif _ms == 1 and button == 1 and x < 10 and y == 1 then
- init()
- elseif _ms == 0 and _rcm == 0 and button == 2 then
- drawRightClickMenu(x, y)
- _rcm = 1
- elseif _ms == 0 and _rcm == 1 and x > 52 and y > 20 then
- drawDeskTop()
- _rcm = 0
- end
- end
- end
- init = function()
- _ms = 0
- _rcm = 0
- drawDeskTop()
- drawTaskBar()
- runTime()
- end
- --Main Stuff
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement