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

Automatically detect which side a bundled cable is on?

Started by Rybec, 14 February 2014 - 08:29 PM
Rybec #1
Posted 14 February 2014 - 09:29 PM
I am running FTB Direwolf20, and just updated from v1.0.12 to v1.0.14
Previously MFR's bundled cables were showing up as peripherals, presumably due to Open Peripherals. As such I was able to detect which side of the computer had a bundled cable on it, allowing for free-form construction as I could put the cable wherever and my programs would adjust without needing input. (I try to make my programs plug and play; all I want to do is "pastebin get code startup" once and everything else should be automatic from there)

However, now that I've updated, MFR bundled cables no longer count as peripherals. Is there another way to detect if a cable is attached to a side? The cable in question is only used for output, so I cannot test if one of the channels is active without sacrificing an output (which I would really rather avoid).
CometWolf #2
Posted 15 February 2014 - 12:20 AM
MFR cables should work regardless of openP, as they are programmed into the main CC mod. Are you sure you're using the right methods?
Give this a try, and tell me what it prints.

local tPerips = peripheral.getNames()
for k,v in pairs(tPerips) do
  print(peripheral.getType(k))
end
Lyqyd #3
Posted 15 February 2014 - 02:03 AM
There likely won't be any peripheral methods without OpenP, as they are intended to be used with the redstone API, not as a peripheral.