Posted 30 November 2012 - 06:21 AM
Hi, me again. I am setting up a system to enable/disable all lights in our building.
I've bumped onto this error: lamp0:1: attempt to call nil
The system works like this:
a program called Lamps, can either launch lamp1 or lamp0 by typing On or Off
lamp1 turns them on, and lamp0 turns them off.
I did manage to get lamp1 to work, but 0 seems to fail (I'm not that experienced yet ;P)
here is the code for lamp0:
The color I use for switching the lamps on or off is yellow, if that matters.
If more information is needed please post ;)/>
Thanks in advance!
EDIT: I forgot the rs. before getBundledInput which caused the program to crash
another problem: it is still not disabling the current running color.
I've bumped onto this error: lamp0:1: attempt to call nil
The system works like this:
a program called Lamps, can either launch lamp1 or lamp0 by typing On or Off
lamp1 turns them on, and lamp0 turns them off.
I did manage to get lamp1 to work, but 0 seems to fail (I'm not that experienced yet ;P)
here is the code for lamp0:
curColor = getBundledInput("top")
term.clear()
term.setCursorPos(1,1)
print("All lamps turned off")
rs.setBundledOutput("top, colors.subtract(curColor))
The color I use for switching the lamps on or off is yellow, if that matters.
If more information is needed please post ;)/>
Thanks in advance!
EDIT: I forgot the rs. before getBundledInput which caused the program to crash
another problem: it is still not disabling the current running color.