This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
byPhins's profile picture

spy - Show all messages in Networks [Updated]

Started by byPhins, 31 January 2017 - 11:26 AM
byPhins #1
Posted 31 January 2017 - 12:26 PM
– Use
You can use it to debug network programs.
If you set the port of ( Computer ID ) in the ports.n file,
you will see ALL incomming messages TO this Computer.
Max. of opened ports is 768.
Can be used for multiple networks in the same time.

spy client
spy server << Coming sooon


– Config
- Filename ports.n

Example:

tReturn = { }
for i=1, 555 do
   table.insert(tReturn, i)
end
return tReturn
This file must return the ports as a table.

- Filename client.cfg

Example:

return {
  file = {
	save = true, -- Says that all will be saved
	name = "testing", -- The fileName
	saveType = "w" -- The Saving type | w or a
  },
  modem = {
	names = {
	 bottom = "Network_1", -- Gives the bottom modem a name
	 top = "Network_2", -- Gives the top ...
	 right = "Wireless" -- Gives the right ...
	},
	useNames = true -- Activates a "Network log" for the modems
	differentNetworks = true -- Save messages from differnt netwroks
  },
  whitelist = { -- set to false to disable
	"aWhitelistFilter" -- sets the whitelist filter
  },
  blacklist = { -- set to false to disable
	"aBlacklistFilter" -- sets the blacklist filer
  },
  disable_doubleMessageFilter = false -- disables double messages
}

– Install &amp; Changelog
Spoiler- New Config file
- New Ports file
- Increased max. opened Ports to 768
- Possible setup for multiple-networking
- Better file saving

pastebin get c9dJujKz spy - http://pastebin.com/c9dJujKz

– Old Versions
Spoiler– Functions
spy <Port> / Will open 1 Port
spy <Port> <Filename> / Will open 1 port and save all messages in <Filename>
spy <Port> <Port2> … / Will open all selcted ports
spy <Port> <Port2> … <Filename> / Will do the same as above and save all messages in <Filename>
spy <Portstart> - <Portend> / Will open all ports from portStart to portEnd
spy <Portstart> - <Portend> <Filename> / Will do the same as above and save all messages in <Filename>

To force a modem side:
open the spy file
edit the first line:
force_modem_side = nil
to
force_modem_side = <Your side as string>
close and save

Create a blacklist or whitelist file to filter messages.
There cant be opened more ports than 128 at the same time!

– Install

pastebin get M0E2azpp spy http://pastebin.com/M0E2azpp
Edited on 17 February 2017 - 07:35 PM
CLNinja #2
Posted 10 February 2017 - 11:21 PM
or just modem.open(65533). Rednet repeats all traffic over 65533.
KingofGamesYami #3
Posted 11 February 2017 - 02:40 AM
Rednet only repeats it's own traffic and disregards all other channels.
CLNinja #4
Posted 11 February 2017 - 03:14 AM
Rednet only repeats it's own traffic and disregards all other channels.
The title of the post:
spy - Show all messages in Rednet Networks
Anavrins #5
Posted 11 February 2017 - 06:03 AM
There cant be opened more ports than 128 at the same time!
You could add detection of multiple modems and rise that to 768!
Bomb Bloke #6
Posted 11 February 2017 - 06:43 AM
or just modem.open(65533). Rednet repeats all traffic over 65533.

Rednet only repeats it's own traffic and disregards all other channels.

Nevertheless, that'd be sufficient to "show all messages in Rednet Networks".
Dave-ee Jones #7
Posted 15 February 2017 - 12:40 AM
That code is painful to read. Seems to be looping on itself in the main loop.

Anyway, you could get it to read multiple modems attached and potentially multiply your open ports by 6. Also, you MIGHT be able to may a loop that constantly changes the open channels, leaving 6 * 128 open at any one time but constantly changing in (potentially) less than a second. This would allow you to cover more ports quicker, lessening the chances of missing a message/broadcast.

Just a thought :P/>

You could potentially make a Prowler Network (just made up the name while I was typing) made up of about 6 computers that are constantly prowling channels, spying on them. Then you could have one main computer that gets messages from those computers (via wire of course, you don't want someone spying on your spying, if you catch my drift) telling you any messages and info about that message (sender/receiver IDs etc.). This would allow you to cover 6 * 6 * 128 channels. It would really only be useful for CC servers but still fun :P/>

Might clog up the Server's speed and potentially crash it but alg :D/>
byPhins #8
Posted 16 February 2017 - 12:24 PM
That code is painful to read. Seems to be looping on itself in the main loop.

Anyway, you could get it to read multiple modems attached and potentially multiply your open ports by 6. Also, you MIGHT be able to may a loop that constantly changes the open channels, leaving 6 * 128 open at any one time but constantly changing in (potentially) less than a second. This would allow you to cover more ports quicker, lessening the chances of missing a message/broadcast.

Just a thought :P/>

You could potentially make a Prowler Network (just made up the name while I was typing) made up of about 6 computers that are constantly prowling channels, spying on them. Then you could have one main computer that gets messages from those computers (via wire of course, you don't want someone spying on your spying, if you catch my drift) telling you any messages and info about that message (sender/receiver IDs etc.). This would allow you to cover 6 * 6 * 128 channels. It would really only be useful for CC servers but still fun :P/>

Might clog up the Server's speed and potentially crash it but alg :D/>

Yeah I had the same idea with the network maybe i ll try it ;)/>
Dave-ee Jones #9
Posted 16 February 2017 - 10:36 PM
So I played around with my own version and found there is almost no point opening different channels.

By opening 65535 (broadcast channel) you can see ANY messages being sent over any of the channels from 65335-0. The cool thing about this is that you can still see the receiver's ID instead of just the broadcast channel ID (65535). However I would assume that if someone actually did broadcast a message and you were listening in on the broadcast channel you would get a massive message spam on your computer as it would fetch the same message for every single channel. That's about 65335 messages…That would probably be the biggest downside to listening in on the one channel. In saying this you could easily make a filter checking if it's the same message/sender as the last message and just hiding it and renaming the receiver ID to "Broadcast" so that it shows it was sent everywhere.

Still, works well. It's easier than opening a few hundred channels at a time.

Never mind, broadcasts send it over the broadcast channel only. My bad.
Edited on 16 February 2017 - 09:55 PM
CLNinja #10
Posted 17 February 2017 - 11:37 PM
So I played around with my own version and found there is almost no point opening different channels.

By opening 65535 (broadcast channel) you can see ANY messages being sent over any of the channels from 65335-0. The cool thing about this is that you can still see the receiver's ID instead of just the broadcast channel ID (65535).

Never mind, broadcasts send it over the broadcast channel only. My bad.

Or, like i said before, you can open 65533 and immediately see all rednet.send and rednet.broadcast messages. if you lookup rednet.CHANNEL_REPEAT in lua, its 65533, which all messages go to other than to the ID of the computer you were sending to.
byPhins #11
Posted 18 February 2017 - 12:42 AM
So I played around with my own version and found there is almost no point opening different channels.

By opening 65535 (broadcast channel) you can see ANY messages being sent over any of the channels from 65335-0. The cool thing about this is that you can still see the receiver's ID instead of just the broadcast channel ID (65535).

Never mind, broadcasts send it over the broadcast channel only. My bad.

Or, like i said before, you can open 65533 and immediately see all rednet.send and rednet.broadcast messages. if you lookup rednet.CHANNEL_REPEAT in lua, its 65533, which all messages go to other than to the ID of the computer you were sending to.

But with this method you wont see any "normal" messages using with peripheral.call(…, "transmit", … )
CLNinja #12
Posted 18 February 2017 - 01:32 AM
So I played around with my own version and found there is almost no point opening different channels.

By opening 65535 (broadcast channel) you can see ANY messages being sent over any of the channels from 65335-0. The cool thing about this is that you can still see the receiver's ID instead of just the broadcast channel ID (65535).

Never mind, broadcasts send it over the broadcast channel only. My bad.

Or, like i said before, you can open 65533 and immediately see all rednet.send and rednet.broadcast messages. if you lookup rednet.CHANNEL_REPEAT in lua, its 65533, which all messages go to other than to the ID of the computer you were sending to.

But with this method you wont see any "normal" messages using with peripheral.call(…, "transmit", … )
See you must have recently updated it, because previously it stated "REDNET NETWORKS" not just 'Networks'
Dave-ee Jones #13
Posted 20 February 2017 - 05:08 AM
So I played around with my own version and found there is almost no point opening different channels.

By opening 65535 (broadcast channel) you can see ANY messages being sent over any of the channels from 65335-0. The cool thing about this is that you can still see the receiver's ID instead of just the broadcast channel ID (65535).

Never mind, broadcasts send it over the broadcast channel only. My bad.

Or, like i said before, you can open 65533 and immediately see all rednet.send and rednet.broadcast messages. if you lookup rednet.CHANNEL_REPEAT in lua, its 65533, which all messages go to other than to the ID of the computer you were sending to.

But with this method you wont see any "normal" messages using with peripheral.call(…, "transmit", … )
See you must have recently updated it, because previously it stated "REDNET NETWORKS" not just 'Networks'

Problem with using 65533 (other than not being able to see any third-party messaging) is that you usually get two messages for every one message (a receive and a send). That's not particularly ideal if you are monitoring them and logging them, because you would have twice as many logged as there are actual messages. Chews up lots of space quicker. Not that it matters if you are just spying.

Personally I would just open up 65535 and use a separate network to monitor third-party messaging because they could be broadcasting on ANY channel really.
CLNinja #14
Posted 21 February 2017 - 12:09 AM
-SNIP-
Problem with using 65533 (other than not being able to see any third-party messaging) is that you usually get two messages for every one message (a receive and a send). That's not particularly ideal if you are monitoring them and logging them, because you would have twice as many logged as there are actual messages. Chews up lots of space quicker. Not that it matters if you are just spying.

Personally I would just open up 65535 and use a separate network to monitor third-party messaging because they could be broadcasting on ANY channel really.

No, you do NOT receive 2 messages on 65533, unless you also have 65535. Close your computers channel and any others, open 65533, and now all rednet traffic is found.
Dave-ee Jones #15
Posted 21 February 2017 - 03:36 AM
-SNIP-
Problem with using 65533 (other than not being able to see any third-party messaging) is that you usually get two messages for every one message (a receive and a send). That's not particularly ideal if you are monitoring them and logging them, because you would have twice as many logged as there are actual messages. Chews up lots of space quicker. Not that it matters if you are just spying.

Personally I would just open up 65535 and use a separate network to monitor third-party messaging because they could be broadcasting on ANY channel really.

No, you do NOT receive 2 messages on 65533, unless you also have 65535. Close your computers channel and any others, open 65533, and now all rednet traffic is found.

While Rednet is fine for those who are just looking for a quick solution to sending messages, it's not the best/most secure way. Just use modem messaging :)/>