WireNetwork PCMod2 addon


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?

  1. Extract this into garrysmod/addons/pcmod/
  2. Open garrysmod/lua/pcmod/sh_config.lua and find the line starting with “cfg.FullProgramList” (without quotes)
  3. Add “,wirenetwork” (without quotes) to the end of the list, before the last quote.
  4. 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.

Looks interesting, good job. I’m surprised PCMod 2 still works.

Sadly, printer is broken :frowning:

No, it works fine, aside from a slight error that fucks up the world view for reasons unknown.

I had a problem with the printer too, where it just printed blank pages. I had to save documents before it would print anything. I also only managed to get the print server working sometimes.

I hope someone will continue coding on PCMod2. It was kinda awesome.