What is this?
This adds a simple program to PCMod 2 computers (servers only). The program uses an attached I/O Device to tunnel wire links over a PCMod network.
You give it the IP address of another computer running the program, and it transmits data.
How do I install this?
- Extract this into garrysmod/addons/pcmod/
- Open garrysmod/lua/pcmod/sh_config.lua and find the line starting with “cfg.FullProgramList” (without quotes)
- Add “,wirenetwork” (without quotes) to the end of the list, before the last quote.
- Start GMod.
How do I interface this with Wiremod devices?
Input F is the clock. When input F changes from 0 to 2, the numbers in A-D are stored as the target IP address (A.B.C.D). When input F changes from 0 to 1, if there is a saved IP address it sends the values of inputs A-E to that IP address.
Outputs 1-5 receive the values of A-E when a packet is received.
Output 6 is the output clock. It toggles between 1 and -1 when a packet is received, 2 and -2 if a “net port locked” error is received (indicating that the port has been locked via the firewall), 3 and -3 if a “net port closed” error is received (indicating the other computer is not running the program).
Also, this is my first Lua scripting and first garrysmod.org upload. I started this without even knowing Lua, but it seems to work. Just don’t be too surprised (but do be a little bit surprised, because I did test it) if it doesn’t work for you.