Z1maV1

BSOD

May 14th, 2022 (edited)
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.58 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. local args = {...}
  4.  
  5. w,h = term.getSize()
  6.  
  7. term.clear()
  8.  
  9. function printCentered(y,s)
  10.     local x = math.floor((w - string.len(s)) / 2)
  11.     term.setCursorPos(x,y)
  12.     term.clearLine()
  13.     term.write(s)
  14. end
  15.  
  16. if #args < 1 then
  17.     term.setBackgroundColor(colors.blue)
  18.  
  19.     term.clear()
  20.  
  21.     printCentered(math.floor(h/2) - 2, "Diamond OS")
  22.     printCentered(math.floor(h/2) + 0, "We find fatal error on your computer")
  23.     printCentered(math.floor(h/2) + 1, "The computer will automaticaly reboot")
  24.     printCentered(math.floor(h/2) + 2, "in 5 seconds")
  25.     printCentered(math.floor(h/2) + 3, "If problem will appear,")
  26.     printCentered(math.floor(h/2) + 4, "ask our company for help")
  27.     printCentered(math.floor(h/2) + 6, "Error: [DO:00000] Fatal error while running os" )
  28.     printCentered(math.floor(h/2) + 7, "We hope, that this is small problam :)")
  29.     term.setCursorBlink(false)
  30.  
  31.     sleep(5)
  32.  
  33.     os.reboot()
  34. else
  35.     term.setBackgroundColor(colors.blue)
  36.  
  37.     term.clear()
  38.  
  39.     printCentered(math.floor(h/2) - 2, "Diamond OS")
  40.     printCentered(math.floor(h/2) + 0, "We find fatal error on your computer")
  41.     printCentered(math.floor(h/2) + 1, "The computer will automaticaly reboot")
  42.     printCentered(math.floor(h/2) + 2, "in 5 seconds")
  43.     printCentered(math.floor(h/2) + 3, "If problem will appear,")
  44.     printCentered(math.floor(h/2) + 4, "ask our company for help")
  45.     printCentered(math.floor(h/2) + 6, "Error: " .. args[1])
  46.     printCentered(math.floor(h/2) + 7, "We hope, that this is small problam :)")
  47.     term.setCursorBlink(false)
  48.  
  49.     sleep(5)
  50.  
  51.     os.reboot()
  52. end
  53.  
  54.  
  55.  
Advertisement
Add Comment
Please, Sign In to add comment