Posted 14 March 2012 - 07:01 AM
First time here, Hi.
Anyway, i just started working with computer craft and as a basic program to start off i am attempting to control my town lights with a simple menu.
However, the problem i am having is that when i display my menu. i show "Lights are On" or "Lights are Off" and first used just redstone wire to
the back of the computer and as i adapted more possibilities to turn on other things through out my town i upgraded the restone wire to
bundled cable. But now the menu of saying something is on or off isnt working. I am having trouble checking my bundled cables.
Here is my code i am currently using with just Lights functions
I know there are probably minor ways to fix certain things, but im mainly looking for checking the cables.
Also, is there a way to turn no cables on? Like once ive set white, to turn just it off or none on?
Thanks in advance,
The One and Only Anti
Anyway, i just started working with computer craft and as a basic program to start off i am attempting to control my town lights with a simple menu.
However, the problem i am having is that when i display my menu. i show "Lights are On" or "Lights are Off" and first used just redstone wire to
the back of the computer and as i adapted more possibilities to turn on other things through out my town i upgraded the restone wire to
bundled cable. But now the menu of saying something is on or off isnt working. I am having trouble checking my bundled cables.
Here is my code i am currently using with just Lights functions
I know there are probably minor ways to fix certain things, but im mainly looking for checking the cables.
Also, is there a way to turn no cables on? Like once ive set white, to turn just it off or none on?
local exit = "0"
while exit == "0" do
shell.run("clear")
print(" ")
print(" **Control Panel Status**")
write(" 1. Lights - ")
if rs.testBundledInput("back", colors.white) == true then
print("On")
else
print("Off")
end
print(" ")
print(" ")
print(" ")
write(" Hit enter to continue... ")
input = read()
shell.run("clear")
print(" ")
print(" **Control Panel Operations**")
write(" 1. Turn Lights ")
if rs.testBundledIntput("back", colors.white) == true then
print("Off")
else
print("On")
end
print(" 2. Exit")
print(" ")
print(" ")
write(" Choice: ")
input = read()
if input == "1" then
if rs.testBundledInput("back", colors.white) == true then
rs.setBundledOutput("back", colors.white)
print("Lights are now off")
else
rs.setBundledOutput("back", colors.black)
print("Lights are now on")
end
if input == "2" then
exit = "1"
end
end
end
Thanks in advance,
The One and Only Anti