Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- peripheral.find("modem", rednet.open)
- print("Waiting for remote connection...")
- while true do
- -- Always wait for a connection
- local remoteId, message = rednet.receive()
- if message == "connect" then
- print("Connected to "..remoteId)
- -- Main loop once connected
- while true do
- local sender, command = rednet.receive("command", 60)
- if sender == nil then
- print("Disconnected from "..remoteId)
- break
- else if sender == remoteId then
- print(command)
- shell.run(command)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement