Posted 15 August 2016 - 04:57 PM
Hey guys! So I have a couple questions about using multiple computers for this project I'm working on, which will probably seem super simple to all of you. But, I'm just beginning computercraft, so I'm doing my best to learn!
Anyway, here goes:
I have one Advanced Computer hooked up via networking cable and wired modems to a monitor, and a vibrant capacitor bank. It monitors the percentage of power in the capacitor bank (energy stored / max energy * 100). If the power falls below 25%, then it turns off a quarry / mining laser by turning off a redstone output. Once the power climbs back to 100%, the output is turned on and the mining resumes. The monitor just shows us the current status of power in the bank and whether or not the quarry is on.
This part works great! It's the next part that I need help with.
What I'd like is for a second advanced computer to be linked up to the network. This computer's sole purpose would be to monitor user input, such as "off" or "auto". Based on these inputs, the data would be sent to the main control computer, and force the quarry off or set it to auto mode again. Basically, I need to share the variable between two computers.
I know you can use peripheral.wrap() to wrap a second computer into the network, but the computer API found here: http://computercraft.info/wiki/Computer_(API) only allows for rebooting, turning the computer on/off, and getting some information about it. How do I grab a variable from this second computer?
Thanks for any help!
–
Vortex
Anyway, here goes:
I have one Advanced Computer hooked up via networking cable and wired modems to a monitor, and a vibrant capacitor bank. It monitors the percentage of power in the capacitor bank (energy stored / max energy * 100). If the power falls below 25%, then it turns off a quarry / mining laser by turning off a redstone output. Once the power climbs back to 100%, the output is turned on and the mining resumes. The monitor just shows us the current status of power in the bank and whether or not the quarry is on.
This part works great! It's the next part that I need help with.
What I'd like is for a second advanced computer to be linked up to the network. This computer's sole purpose would be to monitor user input, such as "off" or "auto". Based on these inputs, the data would be sent to the main control computer, and force the quarry off or set it to auto mode again. Basically, I need to share the variable between two computers.
I know you can use peripheral.wrap() to wrap a second computer into the network, but the computer API found here: http://computercraft.info/wiki/Computer_(API) only allows for rebooting, turning the computer on/off, and getting some information about it. How do I grab a variable from this second computer?
Thanks for any help!
–
Vortex