Guest User

help

a guest
Oct 11th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.31 KB | None | 0 0
  1. version = 1.0
  2. running = true
  3. _ms = 0
  4. _dt = paintutils.loadImage("/OS/.backgrounds/dt")
  5.  
  6.   clear = function()
  7.     term.setBackgroundColor(colors.black)
  8.     term.clear()
  9.     term.setCursorPos(1, 1)
  10.   end
  11.  
  12.   drawMenu1()
  13.     term.setCursorPos(1, 2)
  14.     term.setBackgroundColor( colors.cyan )
  15.     term.setTextColor( colors.black )
  16.     print( "[POWER]" )
  17.   end
  18.  
  19.   drawTaskBar = function()
  20.     term.setCursorPos(1, 1)
  21.     term.setBackgroundColor( colors.blue )
  22.     term.clearLine()
  23.     term.setCursorPos(1, 1)
  24.     term.setBackgroundColor( colors.red )
  25.     term.setTextColor( colors.black )
  26.     term.write("[PROGS.]")
  27.   end
  28.  
  29.   drawDeskTop = function()
  30.     term.setBackgroundColor(colors.lightBlue)
  31.     term.clear()
  32.     term.setCursorPos(1, 1)
  33.     paintutils.drawImage(_dt, 1, 1)
  34.   end
  35.  
  36.   stop = function()
  37.     clear()
  38.     running = false
  39.     term.setTextColor( colors.blue )
  40.     print("Thanks for using NXOS")
  41.   end
  42.  
  43.   runTime = function()
  44.     while running do
  45.     event, button, x, y = OS.pullEvent("mouse_click")
  46.       if _ms == 0 and button == 1 and x < 7 and y == 1 then
  47.       drawMenu1()
  48.       elseif _ms == 1 and button == 1 and y == 1 and x < 7 then
  49.         stop()
  50.       end
  51.     end
  52.   end
  53.  
  54.   init = function()
  55.     drawDeskTop()
  56.     drawTaskBar()
  57.     runTime()
  58.   end
  59.  
  60. init()
Advertisement
Add Comment
Please, Sign In to add comment