Advertisement
JoeNoIce

bored

Jun 3rd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. function l(sx,sy,ex,ey,lcolor)
  2. paintutils.drawLine(sx,sy,ex,ey,lcolor)
  3. end
  4. function p(x,y,color)
  5. paintutils.drawPixel(x,y,color)
  6. end
  7.  
  8. function drawDesktop()
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. p(1,1,colors.blue)
  12.  
  13. end
  14.  
  15. function ani(char)
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. write(char)
  19. sleep(0.2)
  20. end
  21.  
  22. term.clear()
  23. term.setCursorPos(1,1)
  24. print("Loading windows XP...")
  25. sleep(1)
  26. ani("|")
  27. ani("/")
  28. ani("-")
  29. ani("\\")
  30. ani("|")
  31. ani("/")
  32. ani("-")
  33. ani("\\")
  34. ani("|")
  35. ani("/")
  36. ani("-")
  37. ani("\\")
  38. ani("|")
  39.  
  40.  
  41. while true do
  42. drawDesktop()
  43. nTime = os.time()
  44. event, button, mx, my = os.pullEvent("mouse_click")
  45.  
  46. if button == 1 then
  47. if mx == 1 and my == 1 then
  48. l(1,2,10,2,colors.blue)
  49. l(1,2,1,17,colors.blue)
  50. l(10,2,10,17,colors.blue)
  51. l(1,17,10,17,colors.blue)
  52. p(9,16,colors.red)
  53. p(8,16,colors.green)
  54. p(7,16,colors.orange)
  55.  
  56.  
  57. event, bbutton , mmx ,mmy = os.pullEvent("mouse_click")
  58.  
  59. if bbutton == 1 then
  60. if mmx == 9 and mmy == 16 then
  61. sleep(1)
  62. os.shutdown()
  63. elseif mmx == 8 and mmy == 16 then
  64. term.setBackgroundColor(colors.black)
  65. term.clear()
  66. term.setCursorPos(1,1)
  67. break
  68.  
  69. elseif mmx == 7 and mmy == 16 then
  70. term.setBackgroundColor(colors.black)
  71. term.setCursorPos(10,1)
  72. print("The time is "..textutils.formatTime(nTime,false))
  73. sleep(3)
  74.  
  75.  
  76. end
  77. end
  78. end
  79. end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement