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

how to read bundledcable inputs

Started by dcleondc, 24 July 2012 - 05:27 AM
dcleondc #1
Posted 24 July 2012 - 07:27 AM

Hello i would like to make it so when i pushed the button for the white wire it would beable to send it to the computer and when i pushed it it would run a program i made called "white cable". and when i push the button for the orange cable it would run a program called "orange cable".
limdingwen #2
Posted 24 July 2012 - 07:31 AM
According to the wiki page for redstone (http://computercraft.info/wiki/index.php?title=Redstone_%28API%29) You can use rs.getBundledInput(string side). This is how to test if a color is on:


print (colors.test (redstone.getBundledInput("back"), colors.blue))

Good luck!
Noodle #3
Posted 24 July 2012 - 08:50 AM

if colors.test( rs.getBundledInput("back"), colors.white ) then
  print("White")
elseif colors.test( rs.getBundledInput("back"), colors.orange ) then
  print("Orange")
elseif colors.test( rs.getBundledInput("back"), colors.magenta ) then
  print("Magenta")
end
-- IDK if this works, I never really used the colors/rs api.