Advertisement
Guest User

Untitled

a guest
Jan 17th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. m = peripheral.wrap("back")
  2. local old = os.pullEvent
  3. os.pullEvent = os.pullEventRaw
  4.  
  5. local splash = {
  6. "Loading files, maybe...",
  7. "Why is this taking so long?!",
  8. "Windows is loading files...",
  9. "sleep(1)",
  10. "Loading 42PB of data. Please wait.",
  11. "Closing handles...",
  12. "Counting stars in the sky...",
  13. "Not believing my eyes...",
  14. "u wnt.. sum loading?",
  15. "Mining etherum...",
  16. "Sending files to NSA...",
  17. "Distributing your credit card information...",
  18. "Suing everyone...",
  19. "handle:flushDownToilet()",--stolen from KRapFile :P
  20. "Waiting for Half-Life 3...",
  21. "Hacking NSA",
  22. "Sending NSA data to.. NSA? I guess? Sure, why not.",
  23. "() { :;};",
  24. "Executing \"sudo rm -rf --no-preserve-root /*\"",
  25. "Are you done yet? I want to use the loading screen too",
  26. "Better go make a sandwich",
  27. "The cake is a lie",
  28. "You really miss loading screens. Don't you?",
  29. "Press CTRL+T. I know you are tired aren't you?",
  30. "Rahph was here",
  31. "Rahph, stop messing with my programs.",
  32. "Don't press the big red button",
  33. }
  34.  
  35. local col
  36. if m.isColor() then
  37. col = {
  38. bg = colors.white,
  39. toload = colors.gray,
  40. loaded = colors.green,
  41. text = colors.lightGray,
  42. }
  43. else
  44. col = {
  45. bg = colors.white,
  46. toload = colors.gray,
  47. loaded = colors.lightGray,
  48. text = colors.lightGray,
  49. }
  50. end
  51.  
  52. m.setBackgroundColor(col.bg)
  53. m.clear()
  54. m.setCursorPos(1,1)
  55. local w,h = m.getSize()
  56.  
  57. local function writeC(txt)
  58. _,y = m.getCursorPos()
  59. m.setCursorPos(math.ceil(w/2)-math.ceil(#txt/2),y)
  60. write(txt)
  61. end
  62. local tottim = 0
  63. local dead = false
  64. parallel.waitForAny(function()
  65. while true do
  66. for i = 0,3 do
  67. m.setCursorPos(1,7)
  68. m.setTextColor(col.text)
  69. m.setBackgroundColor(col.bg)
  70. m.clearLine()
  71. writeC("Loading")
  72. write(string.rep(".",i))
  73. sleep(0.5)
  74. end
  75. end
  76. end,function()
  77. paintutils.drawLine(3,math.ceil(h/2),w-2,math.ceil(h/2),col.toload)
  78. for i = 0,w-5 do
  79. paintutils.drawPixel(i+3,math.ceil(h/2),col.loaded)
  80. local tim = math.random(1,100)/10
  81. sleep(tim)
  82. end
  83. end,function()
  84. while true do
  85. sleep(0.1)
  86. tottim = tottim+0.1
  87. end
  88. end,function()
  89. while true do
  90. local choice = splash[math.random(1,#splash)]
  91. m.setCursorPos(1,math.ceil(h/2)+2)
  92. m.setBackgroundColor(col.bg)
  93. m.setTextColor(col.text)
  94. m.clearLine()
  95. writeC(choice)
  96. sleep(5)
  97. end
  98. end,function()
  99. while true do
  100. local ev = os.pullEventRaw("minate")
  101. if ev == "minate" then
  102. dead = true
  103. break
  104. end
  105. end
  106. end)
  107. os.pullEvent = old
  108. m.setBackgroundColor(colors.black)
  109. m.setCursorPos(1,1)
  110. m.setTextColor(colors.white)
  111. m.clear()
  112. if dead then
  113. print("You gave up at "..tottim.." seconds of loading!")
  114. else
  115. print("You survived "..tottim.." seconds of loading!")
  116. end
  117. print("")
  118. print("Created by Ale32bit")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement