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

Bundle Cable Input

Started by freiguy48, 10 April 2012 - 02:40 AM
freiguy48 #1
Posted 10 April 2012 - 04:40 AM
HI I am trying to make a program that will tell me what bundle cable is activated but I have no clue why I am getting errors with it because when I run the code it tells me no cables are running even when I know that there are. What code would work also instead of it giving numbers could I do a

if color == "NUMBER" then

and have it so that it then tells me the color name and not the number.
Hawk777 #2
Posted 10 April 2012 - 05:01 AM
First, here’s some example code that shows how to read bundled cables. When you run this program, it will tell you whether each of the black, red, and green wires is powered or not, in a bundled cable attached to the left side of the computer:


if rs.testBundledInput("left", colours.black) then
  print("Black is on.")
end
if rs.testBundledInput("left", colours.red) then
  print("Red is on.")
end
if rs.testBundledInput("left", colours.green) then
  print("Green is on.")
end

Second, sometimes people have trouble getting ComputerCraft working with RedPower. In the past (I don’t know if this is still true with the most recent version) there were load order issues; the ComputerCraft mod had to be initialized after the RedPower mod when starting up Minecraft, or else bundled cable wouldn’t work. See this thread or this thread for details. There’s a program called “redprobe” provided with ComputerCraft that shows you the state of both ordinary redstone and bundled cable on each side of a computer; try running it with bundled cable attached (and one or more wires powered) and see if it recognizes the input. If that doesn’t work, the load order problem is probably what you’re running into, and the problem clearly isn’t your own code.
Cloudy #3
Posted 10 April 2012 - 05:04 AM
In 1.2.4 this issue has been resolved. If you're on the latest CC you won't have any issues.
Hawk777 #4
Posted 10 April 2012 - 07:57 AM
Good to know, Cloudy! As soon as BC updates I can stop with the stupid file renaming.