-
-
Save complover116/5404622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you should give yourself credit for the lines you changed just sayin...