Set individual bundled cable channels
MajestadESP opened this issue ยท 2 comments
I have question i think thers no one more like this.
First im a noob in this of programing mods.
And second im from the oldies versions of mine with Eloraam's RedPower2 and CC, in that time the Bundled output had the bolean ARG, to turn on and off single color with out the colors subtract or combine.
My question is what happend if change this line in RedstoneAPI.java
From:
@LuaFunction
public final void setBundledOutput(ComputerSide side, int output) {
environment.setBundledOutput(side, output);
}
To:
@LuaFunction
public final void setBundledOutput(ComputerSide side, int output, bolean on) {
environment.setBundledOutput(side, output, on ? 0 : 255);
}
Sorry if im saying something crazy or something, but for my the old api was perfect.
Thanks and have nice day :)
And second im from the oldies versions of mine with Eloraam's RedPower2 and CC, in that time the Bundled output had the bolean ARG, to turn on and off single color with out the colors subtract or combine.
Do you know which version this was? I had a look through a couple of the older CC versions (1.11 through to 1.46), and they all have the same method signature as the current one.
Edit: @Lemmmy has pointed out you might be thinking of OpenComputers, which has a similar method.
I've mixed feelings about adding this to CC. On one hand, I can definitely see why it's useful. It just also feels a little messy when working with several colours.
For now, you can probably implement this with something like the following:
local function setBundledOutput(side, colour, on)
if on then
rs.setBundledOutput(side, colours.combine(colour, rs.getBundledOutput(side)))
else
rs.setBundledOutput(side, colours.subtract(colour, rs.getBundledOutput(side)))
end
end