Advertisement
Marlingaming

OsManager API

Nov 28th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. local function SystemError(text,blueScreen)
  2. while true do
  3. if blueScreen == true then term.clear() term.setCursorPos(1,1) term.write("///////Crash//////") end
  4. for i = 1, #text do
  5. term.setCursorPos(1,i+3)
  6. term.clearLine()
  7. term.write(text[i])
  8. end
  9. term.setCursorPos(6,16)
  10. if blueScreen == true then term.write("press enter to shutdown") else term.write("press enter to continue") end
  11. local a, b = os.pullEvent("key")
  12. if b == keys.enter then
  13. if blueScreen == true then os.shutdown() else break end
  14. end
  15. end
  16. end
  17.  
  18. function ApiCheck(list)--checks files for requested api, if any are missing, runs system error
  19. local Pass = 0
  20. local Status = {}
  21. for i = 1, #list do
  22. if fs.exists(fs.combine("API",list[i])) then Pass = Pass + 1 Status[i] = true else Status[i] = false end
  23. end
  24. local Copied = {"API check failed","files mentioned:"}
  25. for i = 1, #Status do
  26. Copied[i + 2] = (list.." found - "..Status[i])
  27. end
  28. if Pass < #list then SystemError(Copied,true) return false else return true end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement