This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
evilcooldud's profile picture

need help with simple code

Started by evilcooldud, 06 September 2012 - 06:07 PM
evilcooldud #1
Posted 06 September 2012 - 08:07 PM
im trying to setup a computer so when it recives a input in the back it will activate the side bundled cable


here in my currnt code but its not working

rs.getInput("back") if ("true") then
rs.setOutput("right", true)
end

im a noob and i need help
kazagistar #2
Posted 06 September 2012 - 08:12 PM
This is what your code is actually doing

rs.getInput("back")  -- finds out if the redstone in back is on, and then promptly ignores/forgets it
if ("true") then -- this is always true
rs.setOutput("right", true) -- always turns on the power
end
-- stops running, so if something happens to the back, it wouldnt know
What you want is a comparsion

if rs.getInput("back") == true then
evilcooldud #3
Posted 06 September 2012 - 08:18 PM
awww sweet thanks man im using this for a tic tac toe game