----Startup---- local modem = peripheral.wrap("back") termX, termY = term.getSize() modem.open(1) -------------- function toggle() modem.transmit(1, 1, "toggle") end function LockScreen() term.setBackgroundColor(colors.black) term.clear() term.setCursorPos(1, 1) term.setBackgroundColor(colors.red) term.write(string.rep(" ", termX)) term.setCursorPos(1, termY) term.write(string.rep(" ", termY)) term.setBackgroundColor(colors.black) term.setTextColor(colors.red) term.setCursorPos(termX/2-3, 3) term.write("Lock") end function UnlockScreen() term.setBackgroundColor(colors.black) term.clear() term.setCursorPos(1, 1) term.setBackgroundColor(colors.green) term.write(string.rep(" ", termX)) term.setCursorPos(1, termY) term.write(string.rep(" ", termY)) term.setBackgroundColor(colors.black) term.setTextColor(colors.green) term.setCursorPos(termX/2-3, 3) term.write("Unlock") end -------------- event, side, xpos, ypos = os.pullEvent("mouse_click") ------------------------- if event == "mouse_click" then toggle() end event, modemSide, senderChannel, replyChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message") if message == "UNLOCK" then LockScreen() end if message == "LOCK" then UnLockScreen() end sleep(0.1) shell.run("startup")