Kneelawk/WiredRedstone

Bundled Cable support for CC: Restitched

Closed this issue · 9 comments

ComputerCraft/CC: Restitched has support for reading values directly from RedPower-esque bundled cables. However, it does not currently support WiredRedstone, as neither mod has compatibility for the other.

The API for this is quite simple to implement, would you be interested in adding (or accepting a PR which added) support for it? Alternatively, compatibility can be added on CC:R's side, I just wasn't sure if you had a stable API we could interface with.

Is there a way to set the bundled-cable input value on a computer?

Wired Redstone bundled cabled don't actually store their value, effectively only acting as a conduit for signals.

Ah, no. It's very much designed to be pull based, like vanilla redstone. Hrm, yeah - looking through the code, this will be harder than I expected - feel free to close if you don't think it's worth it!

How frequently does CC poll the state of attached bundled cables?

Poll based is possibly the wrong term (sorry, was trying to contrast it to push, but I guess neither is really right). It behaves pretty much the same as most non-wire redstone components (i.e. lamps). Whenever it receives a block update on a given side, it then reads the redstone value of the adjacent block.

We also read the redstone values whenever a computer turns on/off, which can happen at fairly arbitrary points.

Hmm, looks like the easiest way to implement this is to just start storing bundled cables' values in themselves and then just supply that when queried by CC.

Otherwise I end up with a lot of duplicated calculations and unnecessary updates.

One thing to note is that Wired Redstone bundled cables actually support analog signals. I don't suppose it would be very easy to add support for these in CC: Restitched?

For the time being, I'll probably just interpret a signal strength of > 0 as an ON value and an ON value as a signal strength of 15.

Ok, CC:R integration has been added. You can now read from and write to bundled cables using computers.

I'll close this issue once the feature is released.

Oops. Looks like I forgot to close this when I made the release. This is now added in version 0.2.10.