Posted 10 June 2013 - 07:59 PM
Hi.
I'm trying to make a program that checks for certain inputs goes false or true and then perform some code to my monitor.
The problem I'm having is that i don't know how to check if an input just got true or false or if it was true or false before it's getting checked.
If you see my code below the white cable will be the only one performing its code because I use an if/elsif statments. How can I change my code so that it checks if an input went true or false instead of checking if they are.
Thanks :)/>
I'm trying to make a program that checks for certain inputs goes false or true and then perform some code to my monitor.
The problem I'm having is that i don't know how to check if an input just got true or false or if it was true or false before it's getting checked.
If you see my code below the white cable will be the only one performing its code because I use an if/elsif statments. How can I change my code so that it checks if an input went true or false instead of checking if they are.
if event == "redstone" and rs.testBundledInput("back",colors.white) == true then
mon.setCursorPos(1,3)
mon.setBackgroundColor(8192)
mon.setTextColor(1)
mon.write("Stop ")
mon.setCursorPos(1,4)
mon.write("Engines")
elseif event == "redstone" and rs.testBundledInput("back",colors.white) == false then
mon.setCursorPos(1,3)
mon.setBackgroundColor(16384)
mon.setTextColor(1)
mon.write("Start ")
mon.setCursorPos(1,4)
mon.write("Engines")
elseif event == "redstone" and rs.testBundledInput("back",colors.lightBlue) == true then
mon.setTextScale(2)
mon.setCursorPos(1,6)
mon.setBackgroundColor(8192)
mon.setTextColor(1)
mon.write("LavaShip")
mon.setCursorPos(1,7)
mon.write(" Moving ")
elseif event == "redstone" and rs.testBundledInput("back",colors.lightBlue) == false then
mon.setTextScale(2)
mon.setCursorPos(1,6)
mon.setBackgroundColor(16384)
mon.setTextColor(1)
mon.write(" Move ")
mon.setCursorPos(1,7)
mon.write("LavaShip")
end
Thanks :)/>