Advertisement
DigiZA

computer001

Nov 22nd, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.39 KB | None | 0 0
  1. --Desktop
  2. slc = 0
  3. tBarC = 8
  4. tBartC = 1
  5. backColor = 1
  6. term.setBackgroundColor(backColor)
  7. term.clear()
  8. function titleBar()
  9.  term.setCursorPos(1,1)
  10.  term.setBackgroundColor(tBarC)
  11.  term.setTextColor(tBartC)
  12.  term.clearLine()
  13.  term.setCursorPos(3, 1)
  14.  print("[Begin]")
  15. end
  16. function drawDesktop()
  17.  term.setBackgroundColor(backColor)
  18.  term.clear()
  19.  bground = paintutils.loadImage(".background")
  20.  paintutils.drawImage(bground,1,1)
  21.  titleBar()
  22. end
  23. function drawMenu1()
  24.  term.setTextColor(256)
  25.  term.setBackgroundColor(128)
  26.  term.setCursorPos(1,2)
  27.  print("")
  28.  term.setCursorPos(1,3)
  29.  print(" Welcome ")
  30.  term.setCursorPos(1,4)
  31.  print(" Rules01 ")
  32.  term.setCursorPos(1,5)
  33.  print(" Rules02 ")
  34.  term.setCursorPos(1,6)
  35.  print(" Refresh Files ")
  36.  term.setCursorPos(1,7)
  37.  print(" Shutdown ")
  38.  term.setCursorPos(1,8)
  39.  print(" Restart  ")
  40.  term.setCursorPos(1,9)
  41.  print("")
  42. end
  43.  
  44. drawDesktop()
  45. while true do
  46. local event, button, X, Y = os.pullEventRaw()
  47.  if slc == 0 then
  48.    if event == "mouse_click" then
  49. if X >=2 and X <=8 and Y==1 and button ==1 then
  50. drawMenu1()
  51. slc = 1
  52.   else
  53.   drawDesktop()
  54. end
  55.    end
  56.   elseif slc == 1 then
  57. if X >=1 and X <=11 and button == 1 and Y== 3 then slc = 0
  58.   if fs.exists("welcome") then
  59.    shell.run("welcome")
  60.   else
  61.    shell.run("delete", "welcome")
  62.    shell.run("pastebin", "get", "9RquCUTX", "welcome")
  63.    shell.run("welcome")
  64.   end
  65.  elseif X>=1 and X<=11 and Y==4 and button ==1 then slc = 0
  66.   if fs.exists("Rules01") then
  67.    shell.run("Rules01")
  68.   else
  69.    shell.run("delete", "Rules01")
  70.    shell.run("pastebin", "get", "mCWmYwSi", "Rules01")
  71.    shell.run("Rules01")
  72.   end
  73.  elseif X>=1 and X<=11 and Y==5 and button ==1 then slc = 0
  74.   if fs.exists("Rules02") then
  75.    shell.run("Rules02")
  76.   else
  77.    shell.run("delete", "Rules02")
  78.    shell.run("pastebin", "get", "Kjb5jyfB", "Rules02")
  79.    shell.run("Rules02")
  80.   end
  81.  elseif X>=1 and X<=11 and Y==6 and button ==1 then slc = 0
  82.   shell.run("delete", "welcome")
  83.   shell.run("delete", "Rules01")
  84.   shell.run("delete", "Rules02")
  85.   shell.run("pastebin", "get", "9RquCUTX", "welcome")
  86.   shell.run("pastebin", "get", "mCWmYwSi", "Rules01")
  87.   shell.run("pastebin", "get", "Kjb5jyfB", "Rules02")
  88.  elseif X>=1 and X<=11 and Y==7 and button ==1 then slc = 0
  89.   os.shutdown()
  90.  elseif X>=1 and X<=11 and Y==8 and button ==1 then slc = 0
  91.   os.reboot()
  92.  else
  93.  slc = 0
  94.  drawDesktop()
  95.  
  96. end
  97.  end
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement