Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function prc(text, y)
- local w = term.getSize()
- local _, cy = term.getCursorPos()
- term.setCursorPos(math.ceil((w-#text)/2), y or cy)
- write(text)
- end
- function clear()
- term.clear()
- term.setBackgroundColor(colors.white)
- for i=1,w do
- for j=1,h do
- term.setCursorPos(i,j)
- write(" ")
- end
- end
- end
- function start ()
- if not fs.exists ("/system/RAM/bluescreen") then
- local data = fs.open ("/system/RAM/bluescreen", "w")
- data.close ()
- shell.run ("/system/desktop")
- end
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.clear()
- prc ("Pepdroll has Crashed!", 2)
- prc ("Select the next step", 5)
- term.setTextColor(colors.white)
- term.setCursorPos(5, 10)
- print ("- Commander")
- term.setCursorPos(5, 12)
- print ("- Reboot")
- term.setCursorPos(5, 14)
- print ("- Shutdown")
- term.setBackgroundColor(colors.purple)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- xy = x..","..y
- if x >= 5 and x <= 20 and y == 10 and button == 1 then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(5, 10)
- print ("- Commander")
- sleep (0.2)
- term.clear()
- local data = fs.open ("/system/RAM/ercommander", "w")
- data.close ()
- term.setCursorPos(1,1)
- shell.run ("/system/api/commander")
- elseif x >= 5 and x <= 20 and y == 12 and button == 1 then
- term.setCursorPos(5, 12)
- print ("- Reboot")
- sleep (0.2)
- os.reboot ()
- elseif x >= 5 and x <= 20 and y == 14 and button == 1 then
- term.setCursorPos(5, 14)
- print ("- Shutdown")
- sleep (0.2)
- os.shutdown ()
- end
- end
- end
- start ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement