Advertisement
Guest User

kos

a guest
Nov 1st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.38 KB | None | 0 0
  1. term.setBackgroundColor(1)
  2. term.clear()
  3. function titlebar()
  4. term.setCursorPos(1,1)
  5. term.setBackgroundColor(128)
  6. term.clearLine()
  7. term.setTextColour(256)
  8. term.setCursorPos(4,1)
  9. textutils.slowPrint("KotofeyOS ver.0.2 (Beta)")
  10. term.setCursorPos(1,25)
  11. end
  12. function desktop()
  13. term.setBackgroundColor(1)
  14. term.clear()
  15. bg1 = paintutils.loadImage("bg1")
  16. paintutils.drawImage(bg1,1,1)
  17. titlebar()
  18. end
  19. desktop()
  20. while true do
  21. local event, button, xPos, yPos = os.pullEvent("mouse_click")
  22. if xPos>=1 and xPos<=3 and yPos>=18 and yPos<= 19 then
  23. shell.run("power")
  24. end
  25. function bar()
  26. pus=1
  27. term.setCursorPos(3,2)
  28. print(" ShutDownOS         x")
  29. term.setCursorPos(3,3)
  30. print(" ReBootOS           x")
  31. term.setCursorPos(3,4)
  32. print("                    x")
  33. term.setCursorPos(3,5)
  34. print("                    x")
  35. term.setCursorPos(3,6)
  36. print("                    x")
  37. term.setCursorPos(3,7)
  38. print("                    x")
  39. term.setCursorPos(3,8)
  40. print("                    x")
  41. term.setCursorPos(3,9)
  42. print("                    x")
  43. end
  44. while pus==1 do
  45. local event,button,xPos,yPos=os.pullEvent("mouse_click")
  46. if xPos>=3 and xPos<=30 and yPos==2 then
  47. os.shutdown()
  48. else
  49. pus=0
  50. end
  51. local event,button,xPos,yPos=os.pullEvent("mouse_click")
  52. if xPos>=3 and xPos<=30 and yPos==3 then
  53. os.reboot()
  54. else
  55. pus=0
  56. end
  57. end
  58. if xPos>=1 and xPos<=10 and yPos<=1 then bar()
  59. else
  60. desktop()
  61. end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement