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

Computers (and Maybe Turtles) Can Function As Comparitors

Started by megamit, 12 November 2013 - 12:17 PM
megamit #1
Posted 12 November 2013 - 01:17 PM
could it be possible to add a comparitor function to the redstone api. I imagine it could work like so:

int = redstone.comparitor( primaryside , secondaryside )
Where primaryside / secondaryside (behaving as the back and side of a comparitor respectively) could be either integers to replicate analog redstone levels or be strings that are sides. Using it you could access information that a comparitor could, such as how full a chest is or even utilise any mods custom comparitor implementation. The function would return an integer that is the output of the comparitor.
LBPHacker #2
Posted 12 November 2013 - 02:55 PM
That's not going to happen. We have redstone.getAnalogInput and redstone.setAnalogOutput, so we can use Lua to make a Computer work like a Comparator.
Edited on 12 November 2013 - 01:55 PM
megamit #3
Posted 12 November 2013 - 04:29 PM
That's not going to happen. We have redstone.getAnalogInput and redstone.setAnalogOutput, so we can use Lua to make a Computer work like a Comparator.
Hmm im not sure that i explained myself properly. The basic functionality of comparing signals that a comparitor is capable of is ofcourse possible to implement with current code, but what it could do nicely is emulate a comparitors inventory checking capabilities. I dont think its an overpowered addition to computercraft and its encorporating a system thats already in minecraft.
Lyqyd #4
Posted 12 November 2013 - 04:55 PM
Nope. You literally only have to put a comparator down facing the computer to accomplish this.