mirror of
https://github.com/osmarks/random-stuff
synced 2025-12-19 12:28:06 +00:00
add CC projects
This commit is contained in:
26
computercraft/door-external.lua
Normal file
26
computercraft/door-external.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local channel = 22907
|
||||
local modem = peripheral.find "modem"
|
||||
|
||||
modem.open(channel)
|
||||
|
||||
while true do
|
||||
term.clear()
|
||||
term.setCursorPos(1, 1)
|
||||
print "GTech RDS-V2 Door Lock System Terminal"
|
||||
write "Passcode: "
|
||||
local input = read "*"
|
||||
modem.transmit(channel, channel, input)
|
||||
parallel.waitForAny(
|
||||
function()
|
||||
local _, _, channel, reply_channel, message, distance = os.pullEvent "modem_message"
|
||||
if distance < 10 then
|
||||
print(message)
|
||||
sleep(5)
|
||||
end
|
||||
end,
|
||||
function()
|
||||
sleep(5)
|
||||
printError "Connection timed out. Press the Any key to continue."
|
||||
os.pullEvent "char"
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user