Advertisement
Mat484

lol

Jul 2nd, 2021
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. function rcolors ()
  2. term.setTextColor(1)
  3. term.setBackgroundColor(32768)
  4. term.setCursorPos(1,1)
  5. end
  6. function background ()
  7. term.setCursorPos(51,18)
  8. term.setBackgroundColor(8)
  9. term.clear()
  10. rcolors()
  11. end
  12. function writetxt (wt,wx,wy,wc,wbc)
  13. term.setTextColor(wc)
  14. term.setBackgroundColor(wbc)
  15. term.setCursorPos(wx,wy)
  16. term.write(wt)
  17. rcolors()
  18. end
  19. function writeStatus (st,sc)
  20. term.setCursorPos(1,19)
  21. term.setTextColor(sc)
  22. term.setBackgroundColor(8)
  23. term.clearLine()
  24. term.write(st)
  25. rcolors()
  26. end
  27. function bar (bl,bc)
  28. term.setCursorPos(51,bl)
  29. term.setBackgroundColor(bc)
  30. term.clearLine()
  31. rcolors()
  32. end
  33. function eshell ()
  34. rcolors()
  35. term.clear()
  36. term.setTextColor(2)
  37. term.write("Emergency shell! Use exit to go back!")
  38. term.setTextColor(1)
  39. term.setCursorPos(1,2)
  40. shell.run("shell")
  41. end
  42. --
  43. function drawmain ()
  44. background()
  45. bar(1,1)
  46. writeStatus("Ok",1)
  47. writetxt("Shell Reboot Delete Exit",1,1,8,1)
  48. end
  49. drawmain()
  50. run = true
  51. while run do
  52. event, AA, AB, AC = os.pullEventRaw()
  53. if event == "terminate" then
  54. writeStatus("Bye!",1)
  55. sleep(0.5)
  56. rcolors()
  57. term.clear()
  58. run = false
  59. end
  60.  
  61. if event == "mouse_click" then
  62. if AA == 1 and AB >= 21 and AB <= 24 and AC == 1 then
  63. rcolors()
  64. term.clear()
  65. run = false
  66. end
  67. if AA == 1 and AB >= 0 and AB <= 5 and AC == 1 then
  68. writeStatus("Emergency Shell Activated!",32)
  69. eshell()
  70. drawmain()
  71. writeStatus("Ok",1)
  72. end
  73. if AA == 1 and AB >= 7 and AB <= 12 and AC == 1 then
  74. os.reboot()
  75. end
  76. if AA == 1 and AB >= 14 and AB <= 19 and AC == 1 then
  77. writeStatus("Delete File>",2)
  78. term.setCursorPos(14,19)
  79. term.setBackgroundColor(8)
  80. term.setTextColor(32768)
  81. deletefile = io.read()
  82. term.clear()
  83. term.setCursorPos(1,1)
  84. drawmain()
  85. -- DelFile
  86. if fs.exists(deletefile) then
  87. fs.delete(deletefile)
  88. writeStatus("Deleted File " .. deletefile,8192)
  89. sleep(1)
  90. writeStatus("Ok",1)
  91. else
  92. writeStatus("Could Not Find File " .. deletefile,16384)
  93. sleep(1)
  94. writeStatus("Ok",1)
  95. end
  96. end
  97. end
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement