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

Remote Redstone Signaling via Modems

Started by RadiationWave, 16 February 2014 - 10:21 AM
RadiationWave #1
Posted 16 February 2014 - 11:21 AM
I've been using ComputerCraft for a while now and have just returned from a brief hiatus. In that time it seems RedPower has fallen by the wayside along with it's bundled cables, often a pivital part of any command / control programs. In search of a replacement I ventured into using OpenPeripherals in an attempt to control and monitor a sizeable amount of IC2 nuclear reactors. Since I didn't pay too much attention to detail I failed to realise that it's not possible to switch them on and off remotely in OpenPeripherals. After examining the situation I realised that there is no way to achieve this without placing a computer by every single reactor, roughtly 16 in total.

After giving it some thought I went out on a limb and tried to coax the redstone api into sending signals through modems, since their syntax seems similar to the input that the peripherals api expects.


redstone.setOutput("nuclear_reactor_0", true)

Any advice would be great along with any supporting material. It would also be nice if anyone could tell me if the redstone api will ever be able to handle remote signaling like the code above, as it would make it much easier to control huge arrays of machines and contraptions.

Thanks in advance and all the best.
CometWolf #2
Posted 16 February 2014 - 04:29 PM
While it would be cool, the modems themselves can't use redstone. There are however wireless redstone mods. RedPower might be gone, but MFR has redstone bundled cables which are supported by CC. As for your reactors, your best bet would probably be to network them with a wired modem. This way you can attach them all to the same computer and control them with openP.
RadiationWave #3
Posted 16 February 2014 - 04:51 PM
Ah, interesting. RedNet cables are now compatible with CC?
I'm trying to avoid using wireless redstone receivers just incase sombody manages to stumble upon a fequency used by one of the reactors. It's a shame the modems can't output the signal directly to the peripheral, would definetly help in keeping the reactors less messy. Looks like I'll currently need the wired modems, ME cables and RedNet connections for each reactor. The major pain in this is that I'll have to manually map each on/off line with the associated modem in my program.

Assuming I do decide to place a computer with each reactor (19 including the hub controllers), what would be the expected resource drain on the server?
CometWolf #4
Posted 17 February 2014 - 03:14 AM
Working with multiple wired modems connected to the same type of machine is super easy.

local tReactors = {}
local tPerips = peripheral.getNames()
for i = 1,#tPerips do
  if tPerips[i]:match"reactor" then
    tReactors[#tReactors+1] = peripheral.wrap(tPerips[i])
  end
end

for i = 1,#tReactors do
  tReactors[i].on()
end
Note that i have no idea what the actual reactor peripheral name or methods are called.

As for wireless redstone security, you can make private channels if you make a sniffer. So no one can accidentally stumble upon them, let alone acess them intentionally.

The computers all run on the same thread, as in only one in the whole world runs at any one given time. So it wouldn't affect the server in any noticeable way. It would however require far more work on your end.