Difference between revisions of "Redstone (event)"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Fixed spelling, grammar; made an edit to keep consistency) |
m (The NeedsWork note seems to have already been fixed.) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
{{Event | {{Event | ||
|name=redstone | |name=redstone | ||
| Line 9: | Line 7: | ||
|code= | |code= | ||
while true do | while true do | ||
| − | event = os.pullEvent("redstone") | + | local event = os.pullEvent("redstone") |
print("Redstone input changed.") | print("Redstone input changed.") | ||
end | end | ||
| Line 18: | Line 16: | ||
|code= | |code= | ||
-- Set up a list which contains the sides as keys, and the current redstone state of each side as a boolean value | -- Set up a list which contains the sides as keys, and the current redstone state of each side as a boolean value | ||
| − | statelist = { | + | local statelist = { |
["top"] = rs.getInput("top"), | ["top"] = rs.getInput("top"), | ||
["front"] = rs.getInput("front"), | ["front"] = rs.getInput("front"), | ||
Latest revision as of 04:35, 25 March 2014
| Fired when any Redstone inputs change on any of the sides of the computer. | |
| Returned Object 1 | Nothing |
Basic Usage
Application