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

Project Red Bundled Cable Support.

Started by CCJJSax, 14 November 2013 - 04:18 PM
CCJJSax #1
Posted 14 November 2013 - 05:18 PM
I thought this type of issue was on their side of things, but they said that it's on Computercraft's end.

https://github.com/MrTJP/ProjectRed/issues/218#issuecomment-28524270
Lyqyd #2
Posted 14 November 2013 - 05:31 PM
Recent versions of ComputerCraft use MFR's version of bundled cables.
CCJJSax #3
Posted 15 November 2013 - 12:39 AM
Recent versions of ComputerCraft use MFR's version of bundled cables.

Is there a difference in APIs or something between the two? I have MFR installed, so I use that, but It'd be good for both, in case someone doesn't have MFR.
Cloudy #4
Posted 15 November 2013 - 12:44 AM
Dan, on this - https://twitter.com/DanTwoHundred/status/401174104956366848
theoriginalbit #5
Posted 15 November 2013 - 07:51 AM
Is there a difference in APIs or something between the two?
Of course there is. What a silly question.
ElvishJerricco #6
Posted 15 November 2013 - 08:00 AM
Is there a difference in APIs or something between the two?
Of course there is. What a silly question.

There are no bad questions - Just uninformed ones.

Oh. And bad answers. There are bad answers.
Lyqyd #7
Posted 15 November 2013 - 10:21 AM
There's a difference on the bundled cable mods' side of things, of course, since they are different mods. The MFR bundled cable usage on ComputerCraft's side of things is the same, you use the bundled redstone functions.
ElvishJerricco #8
Posted 15 November 2013 - 12:45 PM
Although, on the subject, I do believe since ChickenBones is now a part of ProjectRed, it will likely come out on top. It's already as good as RP2 in wiring (and in some ways better, due to Forge MultiPart). IMO, it's the best wiring mod out there at the moment.
CCJJSax #9
Posted 15 November 2013 - 03:58 PM
Is there a difference in APIs or something between the two?
Of course there is. What a silly question.

ha, let me rephrase that then. Is the API so different that it wouldn't be practical to create one for ProjectRed?
Lyqyd #10
Posted 15 November 2013 - 04:01 PM
You wouldn't "create an API" to add support for it. Dan would have to use their API to interact with their cables, end-users would use the same bundled cable API calls in ComputerCraft. See the tweet linked above for reasons why only MFR is currently supported.
theoriginalbit #11
Posted 15 November 2013 - 07:27 PM
ha, let me rephrase that then. Is the API so different that it wouldn't be practical to create one for ProjectRed?
It would be difficult yes, and when both mods are present on a server, with the current methods its implemented, it would crash ComputerCraft.
ElvishJerricco #12
Posted 15 November 2013 - 11:05 PM
Really it wouldn't be that hard. There's one method to implement for which sides connect, one for getting the byte array of output, and one to call to get the input. It's a really simple API.
theoriginalbit #13
Posted 15 November 2013 - 11:14 PM
Really it wouldn't be that hard. There's one method to implement for which sides connect, one for getting the byte array of output, and one to call to get the input. It's a really simple API.
Well if its so simple and needed then why don't you do it… stating how simple simple something is or isn't won't change the developers minds or opinion on the matter.
Sebra #14
Posted 16 November 2013 - 12:53 AM
Is it impossible to support both? Doubt it.
Cloudy #15
Posted 16 November 2013 - 01:40 AM
Is it impossible to support both? Doubt it.

We technically support both RedPower 2 (lol) and MFR at the same time right now - just never had chance to test them working together!
ElvishJerricco #16
Posted 17 November 2013 - 02:31 AM
Well if its so simple and needed then why don't you do it…

Not sure why you said this. You know very well that CC isn't open source. My point was that the issue isn't one of difficulty. It's a simple API, so the devs could adopt it easily if they actually chose to do so (which is the actual issue).
ElvishJerricco #17
Posted 17 November 2013 - 02:55 PM
Actually, maybe CC should just provide API for hooking multi-signal cable in. Like a registry for TileEntity classes and IBundledSignal handlers (multiple entries for each class allowed for sake of multiparts).


/**
 * Register with ComputerCraftAPI.registerBundledSignalHandler(Class<T> clazz, IBundledSignalHandler<T> handler);
 *
 * @param <T>
 * Generics for fun and less casting
 */
public interface IBundledSignalHandler<T extends TileEntity> {
	/**
	 * 
	 * @param tile
	 * @return
	 * Does the given tile contain a signal to be read or set?
	 */
	public boolean tileHasSignal(T tile);
	/**
	 * 
	 * @param tile
	 * @return
	 * Signal in tile
	 */
	public int getSignal(T tile);
	/**
	 * Set the signal in tile
	 * @param tile
	 */
	public void setSignal(T tile);
}

Obviously this is fairly incomplete but it gets the idea across.
Edited on 17 November 2013 - 02:15 PM
CCJJSax #18
Posted 17 November 2013 - 07:09 PM
Ideally it would be cool to get some API to have any mod that has this capability to just add functionality simply. such as RP2, ProjectRed, MFR, EnderIO and others. But I have no idea how hard it would be. It would be cool if it were as easy as ElvishJerricco is thinking.
Lyqyd #19
Posted 17 November 2013 - 09:07 PM
The API implementation going in that direction makes no sense. The sensible way is the current method, that the mod adding the wires provides an API to interact with them, and anything wishing to interact with them uses their API.
ElvishJerricco #20
Posted 17 November 2013 - 09:44 PM
The API implementation going in that direction makes no sense. The sensible way is the current method, that the mod adding the wires provides an API to interact with them, and anything wishing to interact with them uses their API.

How does it make no sense? CC adds API for any mod to hook in bundled cables, so any mod that so desires can add theirs. PR keeps its API for interfacing with bundled cable, but chooses to also add in CC support because they wanted to. It makes sense. It works. It's probably not ideal, so I'm on the fence about whether it's actually worth implementing, but it makes sense.
Lyqyd #21
Posted 17 November 2013 - 11:08 PM
That doesn't make sense for the mod adding the cables, though. To go around and look for any mod that provides an API for bundled cables to interact with their blocks would be a little silly, I think. It could work, I guess, it just seems a little absurd if you expand the concept beyond just ComputerCraft.
ElvishJerricco #22
Posted 17 November 2013 - 11:40 PM
That doesn't make sense for the mod adding the cables, though. To go around and look for any mod that provides an API for bundled cables to interact with their blocks would be a little silly, I think. It could work, I guess, it just seems a little absurd if you expand the concept beyond just ComputerCraft.

It's no sillier than it would be for computercraft to go around and look for any mod that provides an API for bundled cables would be. It's just people making choices for things they want.
Edited on 17 November 2013 - 10:45 PM
theoriginalbit #23
Posted 18 November 2013 - 12:02 AM
It's no sillier than it would be for computercraft to go around and look for any mod that provides an API for bundled cables would be. It's just people making choices for things they want.
How about this… ComputerCraft makes the API, the other mod makes an API, and then someone makes a 3rd mod to bridge the gap between them :P/>
Edited on 17 November 2013 - 11:02 PM
Sebra #24
Posted 18 November 2013 - 09:03 AM
What if someone (Forge may be) add Bundled Cable Interface, which can be used by all authors?
I'm not developer, but I think that will allow any different cables to interact with each other.
theoriginalbit #25
Posted 18 November 2013 - 09:14 AM
What if someone (Forge may be) add Bundled Cable Interface, which can be used by all authors?
What happened to that one that ChickenBones was doing?
ElvishJerricco #26
Posted 18 November 2013 - 09:23 AM
What if someone (Forge may be) add Bundled Cable Interface, which can be used by all authors?
What happened to that one that ChickenBones was doing?

ChickenBones is a developer on ProjectRed now.

It's totally not something Forge should be involved in though. Forge should be involved in things like the fluid API or maybe a motion API (← man I hope someone gets to doing this); things that are very core MC style features. Not something as high level and specific as bundled cables.
Edited on 18 November 2013 - 08:25 AM
Arduin #27
Posted 24 December 2013 - 11:10 AM
Since ChickenBones and MrTJP are doing such an awesome job on the Project: Red mod, I think it should be supported. It is really the best replacement out there.
awsmazinggenius #28
Posted 24 December 2013 - 01:03 PM
Since ChickenBones and MrTJP are doing such an awesome job on the Project: Red mod, I think it should be supported. It is really the best replacement out there.

What is the 'best' replacement and who is doing 'an awesome job' is completely opinion based. (I do love ChickenBones's mods though :)/>) Also, you just bumped a month old thread to show support for a suggestion. While not officially stated, moderators have replied to certain threads to say that you need to add useful or good content (something that these forums could use a little more of) to bump an old suggestion.
Edited on 24 December 2013 - 12:04 PM
Jguy #29
Posted 02 January 2014 - 11:59 AM
Having used both Project Red and RedLogic in both server and player capacities I'd have to say that Project Red seems to be easier to use, most like RedPower2 and least buggier. Project Red also mimics what RedPower had more closely as well. I really hope that ComputerCraft moves to support Project Red soon.

In the meantime: I'm a bit perplexed. Is there a way to interface the MFR RedNet cables to Project Red bundled cables?
Lyqyd #30
Posted 02 January 2014 - 12:29 PM
You could probably split them out by color so that the MFR cables input to the same color of the other system.
Pzyber #31
Posted 06 January 2014 - 01:44 PM
I'm working on a peripheral mod (started yesterday) and the first perephiral i'm adding is a Bundled Connector that works with Project Reds bundled cables.

The output works and i'm working on the part for reading the input.

Below is a screenshot taken 30 mins ago.


local p = peripheral.wrap("left")
p.setBundledOutput(colors.white + colors.magenta)

oeed #32
Posted 08 January 2014 - 03:02 AM
I'm working on a peripheral mod (started yesterday) and the first perephiral i'm adding is a Bundled Connector that works with Project Reds bundled cables.

The output works and i'm working on the part for reading the input.

Below is a screenshot taken 30 mins ago.


local p = peripheral.wrap("left")
p.setBundledOutput(colors.white + colors.magenta)

–snip–

Whats with the "colors.white + colors.magenta"? Does that select both?
awsmazinggenius #33
Posted 08 January 2014 - 03:50 AM
Since the "colors" API just is a table of strings that point to numbers (plus a few other methods), I would assume that this adds the numbers together.
theoriginalbit #34
Posted 08 January 2014 - 05:33 AM
Whats with the "colors.white + colors.magenta"? Does that select both?
yes it will, since colors.white is 1 and colors.magenta is 4. Luckily in this case it does work, but its the worst way of doing it.
For example colors.white + colors.white + colors.orange you would expect for it to turn on white and orange, however it doesn't, it turns on magenta. Why? because 1 + 1 + 2 = 4 and as shown before magenta is 4.
The way that this should be used is use of colors.combine so that you get the desired output, if we test with the above using this, colors.combine(colors.white, colors.white, colors.orange), it will now be 3 which is what the output should be to get white and orange.
Pzyber #35
Posted 09 January 2014 - 12:25 AM
I now got a working version of the Extra Peripherals Mod.
As I'm not allowed to create a new topic I'll post a link here.

It includes the Bundled Connector peripheral so you can control Project Red bundled output/input through your computers.
It works almost like the bundled options in the redstone API except for that it uses north, west, south and east instead of fron, left, back and right as side.
CCJJSax #36
Posted 10 January 2014 - 12:25 AM
I now got a working version of the Extra Peripherals Mod.
As I'm not allowed to create a new topic I'll post a link here.

It includes the Bundled Connector peripheral so you can control Project Red bundled output/input through your computers.
It works almost like the bundled options in the redstone API except for that it uses north, west, south and east instead of fron, left, back and right as side.

Very nice! I can't wait to start using it.
Jguy #37
Posted 11 January 2014 - 05:36 PM
I'm working on a peripheral mod (started yesterday) and the first perephiral i'm adding is a Bundled Connector that works with Project Reds bundled cables.

The output works and i'm working on the part for reading the input.

Below is a screenshot taken 30 mins ago.


local p = peripheral.wrap("left")
p.setBundledOutput(colors.white + colors.magenta)


Nice! It would be nice if it was able to be attached to the side of the computer like a modem, but still nice none the less. Good work!
Alice #38
Posted 11 January 2014 - 06:34 PM
Nice! It would be nice if it was able to be attached to the side of the computer like a modem, but still nice none the less. Good work!
It would still take up one block, and the cord would look weird connecting to it.
Jguy #39
Posted 11 January 2014 - 09:20 PM
Nice! It would be nice if it was able to be attached to the side of the computer like a modem, but still nice none the less. Good work!
It would still take up one block, and the cord would look weird connecting to it.

Oh I know it would still take up the block. But whenever I think of perpheals I think of them looking like modems. XD
Alice #40
Posted 11 January 2014 - 10:34 PM
Oh I know it would still take up the block. But whenever I think of perpheals I think of them looking like modems. XD
There are two peripherals in the game that look like modems.
The wired modem, and the wireless modem.
There are at least four peripherals that are full-block
computer, monitor, disk drive, and printer.
Where did you get that idea?
Csstform #41
Posted 11 January 2014 - 11:58 PM
Oh I know it would still take up the block. But whenever I think of perpheals I think of them looking like modems. XD
There are two peripherals in the game that look like modems.
The wired modem, and the wireless modem.
There are at least four peripherals that are full-block
computer, monitor, disk drive, and printer.
Where did you get that idea?
Scince when has a computer been a peripheral?
Edited on 11 January 2014 - 10:59 PM
Alice #42
Posted 12 January 2014 - 12:06 AM
Scince when has a computer been a peripheral?
http://computercraft.info/wiki/Computer#Peripheral_Functions
Galbi3000 #43
Posted 13 January 2014 - 01:09 AM
Since ChickenBones and MrTJP are doing such an awesome job on the Project: Red mod, I think it should be supported. It is really the best replacement out there.

What is the 'best' replacement and who is doing 'an awesome job' is completely opinion based. (I do love ChickenBones's mods though :)/>) Also, you just bumped a month old thread to show support for a suggestion. While not officially stated, moderators have replied to certain threads to say that you need to add useful or good content (something that these forums could use a little more of) to bump an old suggestion.

The whole point of showing support for a sugestion, be it old or new, is to provide weight to the idea and further convince the 'powers that be' that the idea is a good one. The support itself is useful for that purpose :)/>

Whats with the "colors.white + colors.magenta"? Does that select both?
yes it will, since colors.white is 1 and colors.magenta is 4. Luckily in this case it does work, but its the worst way of doing it.
For example colors.white + colors.white + colors.orange you would expect for it to turn on white and orange, however it doesn't, it turns on magenta. Why? because 1 + 1 + 2 = 4 and as shown before magenta is 4.
The way that this should be used is use of colors.combine so that you get the desired output, if we test with the above using this, colors.combine(colors.white, colors.white, colors.orange), it will now be 3 which is what the output should be to get white and orange.

Why use a function like colors.combine? Yes, you make a very valid point that using addition is incorrect for this purpose but there is another mathematical operator in programming that will do the exact same as colors.combine, the 'and' operator ( &amp; ).
E.G. colors.white &amp; colors.white &amp; colors.orange = 3 which is the same result as colors.white + colors.orange effectively ignoring the extra white, and is exactly the same as your colors.combine example only shorter to write and quicker in operation (as the interpreter does not have to do extra overhead stuff before and after calling the function of combine in the colors object) :)/>

As to the original sugestion of this topic. I had seen before a reply to one such sugestion where it was said that Project Red bundled cable support might be added if there were more people using it. It is now used in 3 of the latest mod packs in Feed The Beast, including Direwolf20's pack. You can't have much better endorsement for a mod than Direwolf20 ;)/>

So how about finally adding support for Project Red? Of all the RedPower2 replacements I have looked at, Project Red is the most complete and true to the original that I have seen. I just wish Mr TJP would get round to adding the frames and machines that are missing from Project Red :)/>
Csstform #44
Posted 13 January 2014 - 02:08 PM
All Pokèmon endorse this suggestion, and wholeheartedly wish this to be included in a near future update. Pokèmon are ninjas. :ph34r:/>
Edited on 13 January 2014 - 01:09 PM
Jguy #45
Posted 14 January 2014 - 05:07 PM
Oh I know it would still take up the block. But whenever I think of perpheals I think of them looking like modems. XD
There are two peripherals in the game that look like modems.
The wired modem, and the wireless modem.
There are at least four peripherals that are full-block
computer, monitor, disk drive, and printer.
Where did you get that idea?
Scince when has a computer been a peripheral?

I suppose peripheral wasn't a good word.

My point was that things that interface with computers via cables (such as LAN and Network cables) have modems which attach onto the side of computers, I would have expected this to try and do the same just to keep with what's already been done.

If work would be done on the graphics it wouldn't look "weird" at all.

It's no big deal and definitely does not warrant an argument of "Well these are peripherals, where did you get that dumb idea".
Bomb Bloke #46
Posted 14 January 2014 - 08:27 PM
Why use a function like colors.combine? Yes, you make a very valid point that using addition is incorrect for this purpose but there is another mathematical operator in programming that will do the exact same as colors.combine, the 'and' operator ( &amp; ).
E.G. colors.white &amp; colors.white &amp; colors.orange = 3 which is the same result as colors.white + colors.orange effectively ignoring the extra white, and is exactly the same as your colors.combine example only shorter to write and quicker in operation (as the interpreter does not have to do extra overhead stuff before and after calling the function of combine in the colors object) :)/>
Er, no, colors.white &amp; colors.white &amp; colors.orange = 0. You're thinking of "or", usually denoted by a pipe, though under ComputerCraft's Lua implementation you have to use the bit.bor() function (which only accepts two parameters, unlike colours.combine(), making BIT's code easier to implement then what you propose).

The colour functions are there for simplification - granted they do so little as to be near redundant (in the past I've forgotten they exist), but they're easier to explain, for one thing.
SilverSatin #47
Posted 21 January 2014 - 02:56 PM
I now got a working version of the Extra Peripherals Mod.
As I'm not allowed to create a new topic I'll post a link here.

It includes the Bundled Connector peripheral so you can control Project Red bundled output/input through your computers.
It works almost like the bundled options in the redstone API except for that it uses north, west, south and east instead of fron, left, back and right as side.

Holy smokes THANK YOU !!

where can I report bugs within your mod? I don't want to hijack this thread and get banned or whatever..
awsmazinggenius #48
Posted 21 January 2014 - 07:59 PM
I now got a working version of the Extra Peripherals Mod.
As I'm not allowed to create a new topic I'll post a link here.

It includes the Bundled Connector peripheral so you can control Project Red bundled output/input through your computers.
It works almost like the bundled options in the redstone API except for that it uses north, west, south and east instead of fron, left, back and right as side.

Holy smokes THANK YOU !!

where can I report bugs within your mod? I don't want to hijack this thread and get banned or whatever..
https://github.com/pzyber/ExtraPeripherals/issues
Galbi3000 #49
Posted 10 July 2014 - 05:12 PM
ComputerCraft is a great mod, one of the best.

BUT….

The maker refuses to support ProjectRed Bundled Cables as he prefers to stick to supporting the original, RedPower. Native support for RedPower in versions after 1.4.7 is pointless as RedPower is no longer in development. Supporting its successor, ProjectRed makes more sense.

ALSO…

ComputerCraft is falling behind the rest of the modding community by not progressing on to MC 1.7.2+. Many of the major mods have progressed to 1.7.2 like BuildCraft, Industrial Craft, ProjectRed, Tinker's Construct/Mechworks, Twilight Forest… I could go on but I think my point is made.

There is a competing mod for ComputerCraft now in the form of OpenComputers and it does have a version for MC1.7.2. It is more advanced than ComputerCraft but does not have as good looking blocks, especially for its turtles. I would still prefer to use ComputerCraft :)/>

Come on, you know it makes sense to drop RedPower and adopt ProjectRed, plus move on to MC1.7.2 everyone else is! :)/>
Lyqyd #50
Posted 10 July 2014 - 05:34 PM
The current beta of ComputerCraft is for 1.7.2.
Cranium #51
Posted 10 July 2014 - 05:51 PM
…The maker refuses to support ProjectRed Bundled Cables as he prefers to stick to supporting the original, RedPower. Native support for RedPower in versions after 1.4.7 is pointless as RedPower is no longer in development. Supporting its successor, ProjectRed makes more sense.
There is an API for other mods to add their bundled cables to ComputerCraft. We have gotten word from ChickenBones, one of the devs of Project:RED, that support will be added to Project:RED soon.
ComputerCraft is falling behind the rest of the modding community by not progressing on to MC 1.7.2+. Many of the major mods have progressed to 1.7.2 like BuildCraft, Industrial Craft, ProjectRed, Tinker's Construct/Mechworks, Twilight Forest… I could go on but I think my point is made.
Obviously you missed the beta section of the forums. The beta version currently undergoing testing is available for 1.7.2
theoriginalbit #52
Posted 11 July 2014 - 01:18 AM
Native support for RedPower in versions after 1.4.7 is pointless as RedPower is no longer in development.
Well someone clearly isn't keeping up with the modding community. Eloraam has started development on RP3
Edited on 10 July 2014 - 11:18 PM
Dog #53
Posted 11 July 2014 - 01:48 AM
Well someone clearly isn't keeping up with the modding community. Eloraam has started development on RP3
Oh my…news to me as well. Definitely looking forward to RP3! And with ProjectRed and RedLogic out there, we'll have a nice bevy of choices…
ElvishJerricco #54
Posted 11 July 2014 - 05:07 AM
Well someone clearly isn't keeping up with the modding community. Eloraam has started development on RP3

Dear lord after a year and a half almost? I'm glad because I've always been a fan of Eloraam's. But she's going to have to use multipart instead of her own micro blocks. And Project Red is already really good and almost identical (which is a trait I wish Red would have strayed away from).
Cranium #55
Posted 11 July 2014 - 06:19 AM
IMO, multipart is way better than her microblocks. Much less buggyness.
theoriginalbit #56
Posted 11 July 2014 - 06:23 AM
yep, but sadly she said no to using multipart. :(/>
Cranium #57
Posted 11 July 2014 - 03:28 PM
yep, but sadly she said no to using multipart. :(/>
Well, it says she's not decided yet. It'd be dang stupid of her not to include multipart, because then there'd be two microblock systems out there, which likely wouldn't be compatible with each other. My money is on the idea that she will use multipart.
asie #58
Posted 11 July 2014 - 04:18 PM
Well, it says she's not decided yet. It'd be dang stupid of her not to include multipart, because then there'd be two microblock systems out there, which likely wouldn't be compatible with each other. My money is on the idea that she will use multipart.

There are already four incompatible ones (Immibis' Microblocks, FMP, BC facades, AE2 facades). TE3 is adding their own in 1.7.10, from what I heard, so that makes five. If not for the fact BluePower died, we'd have six (but BluePower's was only supposed to be a fallback).

FMP is not really a standard.
Cranium #59
Posted 11 July 2014 - 05:45 PM
Fair enough, I suppose. But still, I'd really like to see it become a standard. It's way better than what she had before.
ElvishJerricco #60
Posted 12 July 2014 - 09:55 AM
There are already four incompatible ones (Immibis' Microblocks, FMP, BC facades, AE2 facades). TE3 is adding their own in 1.7.10, from what I heard, so that makes five. If not for the fact BluePower died, we'd have six (but BluePower's was only supposed to be a fallback).

FMP is not really a standard.

I thought AE2 and TE3 were using FMP? Also BC is the only thing that uses its facades and Immibis' Microblocks aren't really used too much. FMP is used a lot.
asie #61
Posted 13 July 2014 - 12:07 PM
There are already four incompatible ones (Immibis' Microblocks, FMP, BC facades, AE2 facades). TE3 is adding their own in 1.7.10, from what I heard, so that makes five. If not for the fact BluePower died, we'd have six (but BluePower's was only supposed to be a fallback).

FMP is not really a standard.

I thought AE2 and TE3 were using FMP? Also BC is the only thing that uses its facades and Immibis' Microblocks aren't really used too much. FMP is used a lot.

TE3 in 1.7.10 removes FMP compat. AE2 has FMP compat but it also supports Immibis' Microblocks *AND* its own facades.

FMP is not used a lot: Tubes!, Project: Red and Mekanism are the only three mods which depend on FMP. Immibis' Microblocks, on the other hand, supports almost every cable and block type in existence due to the fact it has builtin class transformers.
asie #62
Posted 25 July 2014 - 06:35 PM
http://mc.shinonome.ch/doku.php?id=wiki:computronics

Computronics 0.6.0 now lets you read RedLogic and Project: Red bundled cable signals directly. Writing will probably need a special adapter block (due to the way the API works), which will be added sometime later.
Galbi3000 #63
Posted 27 July 2014 - 09:18 PM
Why use a function like colors.combine? Yes, you make a very valid point that using addition is incorrect for this purpose but there is another mathematical operator in programming that will do the exact same as colors.combine, the 'and' operator ( &amp; ).
E.G. colors.white &amp; colors.white &amp; colors.orange = 3 which is the same result as colors.white + colors.orange effectively ignoring the extra white, and is exactly the same as your colors.combine example only shorter to write and quicker in operation (as the interpreter does not have to do extra overhead stuff before and after calling the function of combine in the colors object) :)/>
Er, no, colors.white &amp; colors.white &amp; colors.orange = 0. You're thinking of "or", usually denoted by a pipe, though under ComputerCraft's Lua implementation you have to use the bit.bor() function (which only accepts two parameters, unlike colours.combine(), making BIT's code easier to implement then what you propose).

The colour functions are there for simplification - granted they do so little as to be near redundant (in the past I've forgotten they exist), but they're easier to explain, for one thing.

Sorry, you are right, OR would work and not AND as I stated. But besides my mistake of saying AND instead of OR, the reason for using the logic operator to combine the values is still a valid reason. ComputerCraft is using an interpreted language, using a function slows a program a lot more than a mathematical operator (even on modern powerful systems as it's being interpreted inside a game).


Native support for RedPower in versions after 1.4.7 is pointless as RedPower is no longer in development.
Well someone clearly isn't keeping up with the modding community. Eloraam has started development on RP3

Well, Twitter failed to inform me of her post as I too follow Eloraam's tweets <_</>
In it she states it will be a new version and not RedPower 2 ported so my statement still holds true :P/>
Alice #64
Posted 02 August 2014 - 06:58 AM
Recently talked to ChickenBones about this. Guess what mod's getting PR cable support? :3