LDShadowLord

Banker

Apr 12th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. --os.loadAPI(shell.resolve(".").."ntk")
  2.  
  3. slc = 0
  4. tBarC = 8
  5. tBartC = 1
  6. backColor = 1
  7. term.setBackgroundColor(backColor)
  8. term.clear()
  9. function titleBar()
  10.   term.setCursorPos(1,1)
  11.   term.setBackgroundColor(tBarC)
  12.   term.setTextColor(tBartC)
  13.   term.clearLine()
  14.   term.setCursorPos(3, 1)
  15.   print("[Begin]")
  16. end
  17. function drawDesktop()
  18.   term.setBackgroundColor(backColor)
  19.   term.clear()
  20.   bground = paintutils.loadImage(".background")
  21.   paintutils.drawImage(bground,1,1)
  22.   titleBar()
  23.  
  24. end
  25.  
  26. function drawcontextual()
  27.   term.setTextColor(256)
  28.   term.setBackgroundColor(128)
  29.   term.setCursorPos(1,2)
  30.   print("          ")
  31.   term.setCursorPos(1,3)
  32.   print(" Shutdown ")
  33.   term.setCursorPos(1,4)
  34.   print(" Restart  ")
  35.   term.setCursorPos(1,5)
  36.   print("          ")
  37. end
  38.  
  39. drawDesktop()
  40. while true do
  41. local event, button, X, Y = os.pullEventRaw()
  42.   if slc == 0 then
  43.     if event == "mouse_click" then
  44.       if X >=2 and X <=8 and Y==1 and button ==1 then
  45.       drawMenu1()
  46.       slc = 1
  47.         else
  48.         drawcontextual()
  49.       end
  50.     end
  51.    elseif slc == 1 then
  52.      if X >=1 and X <=11 and button == 1 and Y== 3 then slc = 0
  53.        os.shutdown()
  54.     elseif X>=1 and X<=11 and Y==4 and button ==1 then slc = 0
  55.        os.reboot()
  56.     else
  57.        slc = 0
  58.        drawcontextual()
  59.  
  60.      
  61.     end
  62.   end
  63. end
Add Comment
Please, Sign In to add comment