This should do it.
while true do
yellowin = rs.testBundledInput("back", colors.yellow)
if yellowin == true then
rs.setOutput("left", true)
end
if yellowin == false then
rs.setOutput("left", false)
end
sleep(.1)
end
This will do the first part, but send the signal through the black line in the bundled cable conected to the back of your computer
while true do
yellowin = rs.testBundledInput("back", colors.yellow)
if yellowin == true then
rs.setBundledOutput("back", colors.black)
end
if yellowin == false then
rs.setBundledOutput("back", 0)
end
sleep(.1)
end
If you want this as part of a program you already have then you can put it in as a function like so
function readinput()
yellowin = rs.testBundledInput("back", colors.yellow)
if yellowin == true then
rs.setBundledOutput("back", colors.black)
end
if yellowin == false then
rs.setBundledOutput("back", 0)
end
sleep(.1)
end
Then everytime you want to check if the yellow line is on you can run
readinput()
And it will run the detecter program thing that I just made