redstone.getOutput

From ComputerCraft
Jump to navigation Jump to search

redstone.getOutput
Function
Syntax
redstone.getOutput()
Returns boolean state of the redstone signal
API redstone
Source CC:Tweaked (source)

When given a parameter with a valid side, this function will return a boolean value indicating whether the computer or turtle is outputting a redstone signal. Where true corresponds to a present signal and false corresponds to no present signal.

Error creating thumbnail: Unable to save thumbnail to destination
ExampleCheck if outputting signal.
Prints any side that is outputting a signal.
Code
for key, value in pairs(redstone.getSides()) do
    if (redstone.getOutput(value)) then
        print("Side "..value.." is outputting a signal.")
    end
end
Output Side [top, bottom, front, back, left, right] is outputting a signal.