11 posts
Posted 06 July 2015 - 02:26 PM
I was thinking of a way to put multiple colors in one word or line so like
The redstone input is (in the color line) true
Or
redstone input is (in the color red) false
I've seen it done before I just done know how
7083 posts
Location
Tasmania (AU)
Posted 06 July 2015 - 04:51 PM
It sounds like you want
colours.combine(), in conjunction with
rs.testBundledInput()..
if rs.testBundledInput("side", colours.combine(colours.red, colours.lime)) then ...
8543 posts
Posted 06 July 2015 - 05:45 PM
Sounds more like he's looking for:
term.write("The redstone input is ")
if rs.getInput("left") then
term.setTextColor(colors.lime)
else
term.setTextColor(colors.red)
end
term.write(tostring(rs.getInput("left")))
7083 posts
Location
Tasmania (AU)
Posted 07 July 2015 - 01:09 AM
Ah! That makes more sense.
Condensing that to one line would require more code overall than spreading it over a few, but
the technique discussed here can easily reduce it at least somewhat:
term.write("The redstone input is ")
term.setTextColor(rs.getInput("left") and colors.lime or colors.red)
term.write(tostring(rs.getInput("left")))
11 posts
Posted 08 July 2015 - 03:14 PM
this has nothing to do with redstone. let me try another example
bank = perpheral.wrap("left")
power = bank.getEnergy() –just act like this will work ok
if power >= 4000000 then –bank has 5 million RF storage
print("the power is "..power) –pretend that power will appear as lime green
else
print("the power is"..power) –pretend that power will appear as red
end
how can i make this happen
3057 posts
Location
United States of America
Posted 08 July 2015 - 05:07 PM
local bank = perpheral.wrap("left")
local power = bank.getEnergy() --just act like this will work ok
write( "the power is " )
if power >= 4000000 then --bank has 5 million RF storage
term.setTextColor( colors.lime )
else
term.setTextColor( colors.red )
end
print( power )
11 posts
Posted 14 July 2015 - 02:29 PM
Thanks so much I thought that was the way to do it :)/>