Posted 17 March 2014 - 04:37 AM
I'm currently trying to make a program that simplifies advanced monitors for people who can't program. Here's what I have so far (too lazy to type all the stuff where "…" is shown).
http://pastebin.com/ii02ZH2g
m = peripheral.wrap(side)
...
size = read()
m.setTextScale(size)
...
color = read()
m.setTextColor(color)
...
color2 = read()
m.setBackgroundColor(color2)
...
This code is the part that is protesting my use of variables. For some reason, they expect numbers, and even when I give my program a number to use, it still messes up. I think the reason is this:
color2 = read()
m.setBackgroundColor(color2) | m.setBackgroundColor("1")
where it is getting quotes. I don't know how I would fix this, unless I specifically input a bunch of options in an if, elseif sequence like this.
if color2 == "red" then
color2 = colors.red
elseif color2 == "blue" then
color2 = colors.blue
Here is my final code:http://pastebin.com/ii02ZH2g
Edited on 18 March 2014 - 06:22 PM