Advertisement
Guest User

api

a guest
Mar 31st, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. function desktop()
  2. term.clear()
  3. A = paintutils.loadImage(".bg")
  4. paintutils.drawImage(A,1, 2)
  5. F = paintutils.loadImage(".bgsleep")
  6. local evnt, btn, x, y = os.pullEvent("mouse_click")
  7.   --Drawing the startmenu
  8.   term.setBackgroundColor(colors.black)
  9.   if btn == 1 and x >= 1 and x <= 2 and y >= 18 and y <= 19 then
  10.   term.setBackgroundColor(colors.black)
  11.   paintutils.drawFilledBox(1, 6, 20, 17, colors.gray)
  12.   term.setCursorPos(1, 7)
  13.   print("Package Installer")
  14.   term.setCursorPos(1, 9)
  15.   print("Shell")
  16.   local evnt, btn, x, y = os.pullEvent("mouse_click")
  17.     if btn == 1 and x >= 1 and x <= 5 and y == 9 then
  18.        term.setBackgroundColor(colors.black)
  19.        term.clear()
  20.        term.setCursorPos(1, 1)
  21.        shell.run("shell")
  22.        term.clear()
  23.        term.setCursorPos(1, 1)
  24.        print("Shell")
  25.     else
  26.     term.setBackgroundColor(colors.black)
  27.     term.clear()
  28.     api.desktop()
  29.       local evnt, btn, x, y = os.pullEvent("mouse_click")
  30.       end
  31. elseif
  32. btn == 1 and x == 51 and y == 19 then
  33. os.shutdown()
  34. elseif
  35. btn == 1 and x == 50 and y == 19 then
  36. paintutils.drawImage(F,1, 2)
  37. local evnt, btn, x, y = os.pullEvent("mouse_click")
  38.   if btn == 1 then
  39.   term.clear()
  40.   term.setBackgroundColor(colors.black)
  41.   api.desktop()
  42.  end
  43. else
  44. api.desktop()
  45. end
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement