Advertisement
NorthmcCormick

Untitled

Sep 17th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. print("Booting NOS")
  2. --os.sleep(1)
  3. print("Checking Monitors")
  4. --os.sleep(1)
  5. print("Checking Disks")
  6. --os.sleep(1)
  7. print("Here we go!")
  8. os.sleep(1)
  9.  
  10.  
  11. --Set Up Globals
  12.  
  13. local screenWidth, screenHeight = term.getSize()
  14.  
  15. --Graphics
  16. -------Boot Animation
  17. local bootframe1 = {
  18. {5,5,colors.cyan}
  19. }
  20. local bootframe2 = {
  21. {5,6,colors.cyan}
  22. }
  23. local bootframe3 = {
  24. {5,7,colors.cyan}
  25. }
  26. local bootframe4 = {
  27. {5,8,colors.cyan}
  28. }
  29.  
  30. local bootsequence = {
  31. 0.1,
  32. true,
  33. colors.white,
  34. bootframe1,
  35. bootframe2,
  36. bootframe3,
  37. bootframe4
  38. }
  39. local bootanifile = fs.open("nos_boot.ssf", "r")
  40. local bootanistring = bootanifile.readAll()
  41. bootanifile.close()
  42.  
  43. bootsequence = textutils.unserialize(bootanistring)
  44.  
  45. --Set Up Functions
  46.  
  47. function nos_renderFrame(frame)
  48. if frame == false then
  49.  
  50. else
  51. for p=1,#frame do
  52. paintutils.drawPixel(frame[p][1], frame[p][2], frame[p][3])
  53. end
  54. end
  55. end
  56.  
  57. function nos_renderSequence(sequence)
  58. local delay = 0.15--sequence[1]
  59. local clearing = true--sequence[2]
  60. local bg = colors.black
  61.  
  62. for f=1,#sequence do
  63. term.setBackgroundColor(bg)
  64.  
  65. if clearing == true then
  66. term.clear()
  67. end
  68.  
  69. nos_renderFrame(sequence[f])
  70. os.sleep(delay)
  71. end
  72. end
  73.  
  74. function bootAnimation()
  75.  
  76. term.clear()
  77.  
  78. term.setTextColor(colors.white)
  79. term.setBackgroundColor(colors.white)
  80.  
  81. local delay = 0
  82.  
  83. for x=1,screenWidth do
  84. for y=1,screenHeight do
  85. paintutils.drawPixel(x,y, colors.red)
  86. end
  87. end
  88. os.sleep(delay)
  89. for x=1,screenWidth do
  90. for y=1,screenHeight do
  91. paintutils.drawPixel(x,y, colors.orange)
  92. end
  93. end
  94. os.sleep(delay)
  95. for x=1,screenWidth do
  96. for y=1,screenHeight do
  97. paintutils.drawPixel(x,y, colors.yellow)
  98. end
  99. end
  100. os.sleep(delay)
  101. for x=1,screenWidth do
  102. for y=1,screenHeight do
  103. paintutils.drawPixel(x,y, colors.lime)
  104. end
  105. end
  106. os.sleep(delay)
  107. for x=1,screenWidth do
  108. for y=1,screenHeight do
  109. paintutils.drawPixel(x,y, colors.cyan)
  110. end
  111. end
  112. os.sleep(delay)
  113. for x=1,screenWidth do
  114. for y=1,screenHeight do
  115. paintutils.drawPixel(x,y, colors.purple)
  116. end
  117. end
  118. os.sleep(delay)
  119. for x=1,screenWidth do
  120. for y=1,screenHeight do
  121. paintutils.drawPixel(x,y, colors.white)
  122. end
  123. end
  124.  
  125. nos_renderSequence(bootsequence)
  126.  
  127. end
  128.  
  129. --Boot Up
  130. bootAnimation()
  131.  
  132. --Set Up Render
  133.  
  134. while true do
  135. --Logic
  136.  
  137. --Render
  138.  
  139.  
  140. os.sleep(1)
  141. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement