redstone.getAnalogueInput
When passed a valid side, this function will return a number value indicating the strength of the redstone signal received on that side. If there is no redstone signal it returns 0. Similar to redstone.getInput except it returns the strength instead of boolean on/off status.
|
|||
Prints the redstone signal strength on each side of the computer. | |||
Code | <nowiki>
for _, side in pairs(redstone.getSides()) do
print(("redstone signal on %s is %d"):format(side, redstone.getAnalogueInput(side)))
end
</nowiki>
|
||
Output | redstone signal on [top, bottom, left, right, front, back] is [0-15] |
redstone.getAnalogueInput Function | |
---|---|
Syntax redstone.getAnalogueInput(
| |
Returns | number strength of the redstone signal |
API | redstone |
Source | CC:Tweaked (source) |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.