Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rcolors ()
- term.setTextColor(1)
- term.setBackgroundColor(32768)
- term.setCursorPos(1,1)
- end
- function background ()
- term.setCursorPos(51,18)
- term.setBackgroundColor(8)
- term.clear()
- rcolors()
- end
- function writetxt (wt,wx,wy,wc,wbc)
- term.setTextColor(wc)
- term.setBackgroundColor(wbc)
- term.setCursorPos(wx,wy)
- term.write(wt)
- rcolors()
- end
- function writeStatus (st,sc)
- term.setCursorPos(1,19)
- term.setTextColor(sc)
- term.setBackgroundColor(8)
- term.clearLine()
- term.write(st)
- rcolors()
- end
- function bar (bl,bc)
- term.setCursorPos(51,bl)
- term.setBackgroundColor(bc)
- term.clearLine()
- rcolors()
- end
- function eshell ()
- rcolors()
- term.clear()
- term.setTextColor(2)
- term.write("Emergency shell! Use exit to go back!")
- term.setTextColor(1)
- term.setCursorPos(1,2)
- shell.run("shell")
- end
- --
- function drawmain ()
- background()
- bar(1,1)
- writeStatus("Ok",1)
- writetxt("Shell Reboot Delete Exit",1,1,8,1)
- end
- drawmain()
- run = true
- while run do
- event, AA, AB, AC = os.pullEventRaw()
- if event == "terminate" then
- writeStatus("Bye!",1)
- sleep(0.5)
- rcolors()
- term.clear()
- run = false
- end
- if event == "mouse_click" then
- if AA == 1 and AB >= 21 and AB <= 24 and AC == 1 then
- rcolors()
- term.clear()
- run = false
- end
- if AA == 1 and AB >= 0 and AB <= 5 and AC == 1 then
- writeStatus("Emergency Shell Activated!",32)
- eshell()
- drawmain()
- writeStatus("Ok",1)
- end
- if AA == 1 and AB >= 7 and AB <= 12 and AC == 1 then
- os.reboot()
- end
- if AA == 1 and AB >= 14 and AB <= 19 and AC == 1 then
- writeStatus("Delete File>",2)
- term.setCursorPos(14,19)
- term.setBackgroundColor(8)
- term.setTextColor(32768)
- deletefile = io.read()
- term.clear()
- term.setCursorPos(1,1)
- drawmain()
- -- DelFile
- if fs.exists(deletefile) then
- fs.delete(deletefile)
- writeStatus("Deleted File " .. deletefile,8192)
- sleep(1)
- writeStatus("Ok",1)
- else
- writeStatus("Could Not Find File " .. deletefile,16384)
- sleep(1)
- writeStatus("Ok",1)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement