Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ComputerCraft Broadcast Rednet Monitor
- -- Monitor all traffic on local broadcast RedNet
- -- by Alexander "SquidLord" Williams (SaladinVrai)
- -- Get the system label for identification
- local SysName = os.getComputerLabel()
- -- Iterate over all sides for rednet.open
- for n,m in ipairs(rs.getSides()) do
- rednet.open(m)
- end
- -- Identify
- print("SquidOS RedNet Sniffer ...")
- if SysName then
- print(" Running on node: " .. os.getComputerLabel())
- else
- write(" Running on ")
- textutils.slowPrint("UNIDENTIFIED NODE")
- end
- -- This part was recoded by complover116 : )
- print()
- print("Press any key to stop")
- print()
- -- Loop until any key is pressed
- -- This part was recoded by complover116 : )
- loop = true
- while loop == true do
- Event, Id, Content = os.pullEvent()
- if Event == "rednet_message" then
- print(Id .. " (" .. textutils.formatTime(os.time(), false) ..")>")
- print(" " .. Content)
- elseif Event == "key" then
- loop = false
- end
- end
- print("------------------------------")
- print("Listening stopped")
- print("Code by Squidlord")
- print("------------------------------")
- -- ShutDown the rednet
- for n,m in ipairs(rs.getSides()) do
- rednet.close(m)
- end
Add Comment
Please, Sign In to add comment