Isn't there already a PCMOD v2?
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.
Technically, it isn't a Wiremod addon because it doesn't interface directly with Wiremod (the attached I/O Device does), but since it's only useful in the context of Wiremod I'm posting it here.
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.
0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f
Isn't there already a PCMOD v2?
PCMod interfered with Wire, because of some filename overlap I think. This is no longer a problem in PCMod2 IIRC
I am open to suggestions how this could transfer data other than numbers, given that the I/O Device only supports 6 numeric inputs and 6 numeric outputs. If it could transfer strings, it could interact with chat servers and printer servers.
Edit:
Just noticed Grocel was talking about PCMod2's built-in wire program, not this one. If you want to send strings, program an E2 to do it I suppose.
I still can't think of any practical reasons to use this addon.
Last edited by immibis; 07-19-2010 at 03:23 AM.
0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f
Isn't there a "WireAdjustSpecialInputs" function or something?
Apparently not.
What would this function do, anyway?
0a3c696d6d696269733e092e2e2e7774662c20776879206973 20746865726520612068696464656e20666f72756d2063616c 6c6564206469783f200a3c4a6174476f6f6477696e3e093e2e 3e200a3c4a6174476f6f6477696e3e093c2e3c200a3c49616d 4d634c6f76696e3e094e4f200a3c49616d4d634c6f76696e3e 094e4f204e4f204e4f204e4f204e4f
Dug up from E2's init.lua:
I am assuming it re-creates inputs/outputs based on the provided tables. First table is the names, second is the types.Code:self.Inputs = WireLib.AdjustSpecialInputs(self.Entity, self.inports[1], self.inports[2]) self.Outputs = WireLib.AdjustSpecialOutputs(self.Entity, self.outports[1], self.outports[2])
Bookmarks