it seems you are only showing one of your programs. Do you have a paste of what redset does? I get the feeling it might be the cause of the problem
to be completely truthful, that is the only part of my code that I dont know what it does (
shell.run("redset", side, "white", file.readLine()) )IDo you have any Idea how I could improve that part of the code or any other way I could do this? I have looked everywhere and that was the only thing I could find.
What you mean is, you are using someone else's code and have no bloody clue what it does, right?
well, redset should be a program in your computer, if it isn't there, you should be getting errors.
Well your major flaw is that when the output is being set, it's being set to a single colour, thus it's only sending that one colour, not all the colours needed. To fix that you'd need a variable storing the current colour output and you'd need to amend it with every switch on/off of a machine. If you have no clue how to do that, I can walk you through it, but solving the problem from what I've just said should be simple enough if you are proficient with the colours api.
So basically you're saying that I just need to combine (colors.combine(col1, col2…) and so on? (I.E. The white bundled output, store that as the col1 variable, and the blue bundled output is on, so I would store that as the col2 variable?)
And sorry for being so ignorant, This is my first programming language(at age 13), and I've only being programming ~2 weeks.
Edit: This is my first time using most of these API'S (fs, colors, shell)
It's ok, just be sure to mention if you've copied someone elses code, otherwise people will assume you've written it and thus know what everything in it does.
And if you don't they will figure out by about the second question when you don't know what one of the lines does. It's easiest to just mention from the start so people know.
Anyway, in regards to fixing your problem:
In CC, colours are stored as numbers, thus they are a fixed value, even combined colours, so you can store the output to a single variable.
Firstly, set that variable at the top, something like
local OP = 0 –0 is no colour output
Then what you want to do is in each section of code changing the bundled output, before changing anything the output, set OP to the value of the current bundled output (so OP = rs.getBundledOutput()) then when you go to set the output, where the output is currently 'colours.white' or 'colours.yellow' or something, set it instead to output OS and the new colour, so for the white output:
rs.setBundledOutput(side, colours.combine(OP, colours.white))
in the case of setting the machine off, use colours.subtract instead, so:
rs.setBundledOutput(side, colours.subtract(OP, colours.white))
I'm sure you can fix it from that, but again, if need be, I can upload a paste of the reworked code.
Also if you don't have a redset program on your computer, you can delete all those lines regarding the running of redset.
I also remember my first few times programming, it's been nearly a year since then, things get a lot easier.