Posted 26 December 2012 - 08:03 AM
Hey. So I am making a program with bundled cables for RP2 and some lights. I have typed a program and ran it in the latest version of ComputerCraft for 1.4.6 and it doesn't work. I think that I am having some problems with user Input. I the program, I type "programs" and it appears with the words "Would you like the lights on or off", so I then type "on" and it skips through both "if, then" statements and procedes to clear the screen and reset the cursor position like it should. I do have all the cables coming correctly out the back of the computer and the white cable coming out of the bundled followed by the red alloy wire. I am using the black wire as a sort of "ground" wire if you are familiar with electricity. Any help would be great! Thanks.
term.clear()
term.setCursorPos(1,1)
print("Would you like the lights on or off")
yes = "yes"
no = "no"
local input = read()
if input == yes then
print("Lights are on")
redstone.setBundledOutput("back", colors.white)
end
if input == no then
print("Lights are off")
redstone.setBundledOutput("back", colors.black)
end
term.clear()
term.setCursorPos(1,1)
term.clear()
term.setCursorPos(1,1)
print("Would you like the lights on or off")
yes = "yes"
no = "no"
local input = read()
if input == yes then
print("Lights are on")
redstone.setBundledOutput("back", colors.white)
end
if input == no then
print("Lights are off")
redstone.setBundledOutput("back", colors.black)
end
term.clear()
term.setCursorPos(1,1)