Jump to content

Multiple Computers in one System

computer utility networking

2 replies to this topic

#1 DarkVortex

  • New Members
  • 1 posts

Posted 15 August 2016 - 03: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...i/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!


#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,459 posts

Posted 15 August 2016 - 06: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.

#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 16 August 2016 - 02: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.

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users