Advertisement
LDDestroier

CC BSOD test

Mar 10th, 2016
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.45 KB | None | 0 0
  1. local BSOD = function(errorMSG,filename)
  2.     term.setBackgroundColor(colors.black)
  3.     term.clear()
  4.     sleep(1)
  5.     if term.isColor() then
  6.         term.setBackgroundColor(colors.blue)
  7.     else
  8.         if _VERSION then
  9.             term.setBackgroundColor(colors.gray)
  10.         else
  11.             term.setBackgroundColor(colors.black)
  12.         end
  13.     end
  14.     term.setTextColor(colors.white)
  15.     term.clear()
  16.     term.setCursorPos(1,1)
  17.     print("A problem has been detected and CraftOS has shut down to prevent further damage to your computer.\n")
  18.     print("The problem seems to be caused by the following file: "..errorMSG.."\n")
  19.     print("If this is the first time you've seen this stop error screen, restart your computer. If this screen appears again, follow these steps:")
  20.     print("Check to make sure any new hardware or software is properly installed. If this is a new installation, ask your hardware or software manufacturer for any CraftOS updates you need.\n")
  21.  
  22.     print("Technical Information:")
  23.     print("*** STOP 0x000000e2 (0x00000000, 0x00000000, 0x00000000, 0x00000000)")
  24.     write("*** "..filename.." - Address 0x94efd1aa base at 0x94efb000 DateStamp 0x4a5bc705")
  25.     sleep(0.5)
  26.     os.pullEvent("key")
  27.     os.reboot()
  28. end
  29.  
  30. local badFunction = function(boop)
  31.     if #boop > 0 then
  32.         dofile(table.concat(boop," "))
  33.     else
  34.         error("What an almighty idiot!")
  35.     end
  36. end
  37.  
  38. local tArg = {...}
  39.  
  40. local status, result = pcall(badFunction, tArg)
  41. if not status then
  42.     BSOD(result,fs.getName(shell.getRunningProgram()))
  43. end
  44. print("Okey day")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement