Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- * configuration
- rednet.open("MODEM_SIDE_HERE")
- local receiverID = 0
- local password = ""
- local waitForClose = false
- while true do
- local eventData = {os.pullEvent()}
- if eventData[1] == "rednet_message" and eventData[2] == receiverID then
- waitForClose = (eventData[3] == "closeinterface")
- elseif eventData[1] == "key" and eventData[2] == 28 then
- if waitForClose then
- rednet.send(receiverID, "close")
- else
- rednet.send(receiverID, password)
- password = ""
- end
- end
- if not waitForClose then
- if eventData[1] == "char" then
- password = password .. eventData[2]
- elseif eventData[1] == "key" and eventData[2] == 14 then
- password = string.sub(password, 1, #password - 1)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement