Marlingaming

TestChamber Monitor V1

Sep 14th, 2021 (edited)
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.95 KB | None | 0 0
  1. --Monitor Manager
  2. --This program manages and Draws Items onto a Test Chambers Detail Monitor to show the Tests Environment and other Details about the Test
  3. --this program is used for Minecraft 1.16.5 CC Tweaked
  4.  
  5. local tArg = {..}
  6. local TestNum = tArg[1]
  7. local TrackNum = tArg[2]
  8. local TestItems = tArg[3]
  9. local TestSection = tArg[4]
  10. local TestState = tArg[5]
  11. local Monitor = peripheral.find("monitor")
  12. start()
  13.  
  14. local function start()
  15. monitor.clear()
  16. monitor.setBackground("black")
  17. monitor.writeLine("-------------------")
  18. monitor.writeLine("TEST BOOT SCREEN")
  19. monitor.writeLine("-------------------")
  20. MonitorManager()
  21. end
  22.  
  23. local function MonitorManager()
  24. if TestState == "Lockdown" then
  25. monitor.setCursorPos(1,5)
  26. monitor.writeLine("CHAMBER UNDER LOCKDOWN")
  27. monitor.writeLine("PLEASE FIND SAFE PLACE TO HIDE")
  28. monitor.writeLine("WHILE SECURITY ATTEMPTS TO DEAL")
  29. monitor.writeLine("WITH THE CAUSE OF LOCKDOWN")
  30. elseif TestState == "Disabled" then
  31. monitor.clear()
  32. monitor.setBackground("blue")
  33. monitor.setCursorPos(1,5)
  34. monitor.writeLine("Test chamber is disabled")
  35. monitor.writeLine("please contact the tracks adminstrator")
  36. monitor.writeLine("if you have any questions or problems")
  37. monitor.writeLine("relating to this chamber")
  38. elseif TestState == "Boot" then
  39. monitor.setCursorPos(1,5)
  40. monitor.writeLine("Test Boot System")
  41. monitor.setCursorPos(1,6)
  42. CenterTest("=====================")
  43. monitor.setCursorPos(1,7)
  44. CenterText("Please Wait, System Processing")
  45. monitor.setCursorPos(1,8)
  46. CenterText("=====================")
  47. else
  48. monitor.clear()
  49. monitor.setBackground("white")
  50. monitor.paintutils.drawBox(30,20,70,60,gray)
  51.  
  52. end
  53. end
  54.  
  55. local function CenterTest(text)
  56. local x,y = monitor.getTextScale()
  57. local x2,y2 = monitor.getCursorPos()
  58. monitor.setCursorPos(math.ceil((x/2) - (text:len() /2)), y2)
  59. monitor.write(text)
  60. end
Add Comment
Please, Sign In to add comment