This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
DarkVortex's profile picture

Multiple Computers in one System

Started by DarkVortex, 15 August 2016 - 02:57 PM
DarkVortex #1
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
Lyqyd #2
Posted 15 August 2016 - 07:14 PM
You would use the rednet API to send messages from one computer to another. You don't need the peripheral API for this.
Bomb Bloke #3
Posted 16 August 2016 - 03:50 AM
It sounds like you've connected your two computers together using more network cable - why not link the first computer directly to the second monitor?

But yes, if you really want to use multiple systems, the rednet API is indeed the way to go.