redstone.getInput
When given a parameter with a valid side, this function will return a boolean value indicating whether the computer or turtle is receiving a redstone signal. Where true corresponds to a present signal and false corresponds to no present signal.
|
|||
| Prints any side that is receiving a redstone signal | |||
| Code | <nowiki>
for key, value in pairs(redstone.getSides()) do
if (redstone.getInput(value)) then
print("Side "..value.." is receiving a signal.")
end
end
</nowiki>
|
||
| Output | Side [top, bottom, front, back, left, right] is receiving a signal. | ||
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| redstone.getInput Function | |
|---|---|
|
Syntax redstone.getInput(
| |
| Returns | boolean state 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.