Posted 09 February 2012 - 04:18 PM
Hey. I have a minor issue here i cant figure out as this goes nuts
In the ask a pro i asked into the lights system.
And just to play around with it to learn i changed it to
All thanks to Casper for the basic of this code.
got all colors on thier wire set up to this
The error is following. When it turns on it lights the yellow one
But on turn off it lights the lime red blue cyan pink green and turns off the yellow.
I wonder HOW does the extra colors get into it.
I figure its the line rs.setBundledOutput( "back", - c ) messing up but with - it does the error before this code.
and without it. It will not turn off the yellow lamp
I got this. After reading a 12 page a4 code i found the Solution
rs.setBundledOutput( "back", 0) 0= Turn all off. Would be nice if the "Ingame help redpower" showed that
In the ask a pro i asked into the lights system.
And just to play around with it to learn i changed it to
All thanks to Casper for the basic of this code.
got all colors on thier wire set up to this
The error is following. When it turns on it lights the yellow one
But on turn off it lights the lime red blue cyan pink green and turns off the yellow.
I wonder HOW does the extra colors get into it.
lights = "off"
while true do
term.clear()
term.setCursorPos(1,1)
print ("Lights are: "..lights)
print ("Press [space] to toggle")
event, param1, param2 = os.pullEvent()
if event == "char" and param1 == " " then
if lights == "off" then
lights = "on"
c = colors.combine( colors.yellow )
rs.setBundledOutput( "back", c )
else lights = "off"
c = colors.subtract( colors.yellow )
rs.setBundledOutput( "back", - c )
end
end
end
I figure its the line rs.setBundledOutput( "back", - c ) messing up but with - it does the error before this code.
and without it. It will not turn off the yellow lamp
I got this. After reading a 12 page a4 code i found the Solution
rs.setBundledOutput( "back", 0) 0= Turn all off. Would be nice if the "Ingame help redpower" showed that
Edited on 09 February 2012 - 03:32 PM