Wired Relay
From GMod Wiki
Wiremod Tool | Back |
Function: | A configurable multi-pole, multi-throw relay. |
Primary fire: | Spawns a Relay. |
Secondary fire: | Updates an existing relay |
Reload: | No action |
Notes: | Coded by TAD2020 |
Brief
Switches between many sets of inputs.
A 3 pole, dual throw relay. It has 7 inputs and 3 outputs. Inputs 1-6 are 2 sets, set 1 is {1A, 1B, 1C} and set 2 is {2A, 2B, 2C}. The 7th input is the throw, a value of 1 connects the outputs to set 1, 2 to set 2, and 0 is open (all outputs = 0).
Instructions
Choose the number of poles (outputs) and the number of throws (sets of inputs). Optionally, numpad keys can be defined with or without toggle. Can also choose which set to normally close to when keys is not pressed (default is open).
Inputs
Many. As few as 1(+1), as many as 80(+1). 1-80 are the [throw #][pole letter] (1A to 10H) inputs and +1 to set the throw.
Outputs
One to 8 poles (letters A to H)
Useful hints
Used it to switch between several sets of inputs. Works like an if..then..else gate but with many elseifs with many returns.
- if throw = 1 then output_A = input_1A, output_B = input_1B, output_C = input_1C
- elseif throw = 2 then output_A = input_2A, output_B = input_2B, output_C = input_2C
- elseif throw = 3 then output_A = input_3A, output_B = input_3B, output_C = input_3C
- elseif throw = 0 then output_A = 0, output_B = 0, output_C = 0