View difference between Paste ID: Rq3U5Js2 and TMgJm6wC
SHOW: | | - or go back to the newest paste.
1
--remote terminal program
2
while true do
3
    term.clear()
4
    term.setCursorPos(1,1)
5
    write("Enter Password: ")
6
    sPassword = tostring(read())
7
    if sPassword == "Open Sesame" then
8
        rednet.send ( nDoorId, "safe to open" ) --nDoorId is the ID # of the door's computer
9
    end
10
end
11
12
13
14
15
--door program
16
while true do
17
    ID, message = rednet.receive ( 5 )
18
    if ID == safeID and message == "safe to open" then --safeID being the remote terminal's ID #
19
        --do door opening code
20
    else
21
        os.sleep(0.5)
22
    end
23
end