Difference between revisions of "Redstone (event)"
From ComputerCraft Wiki
Smiley43210 (Talk | contribs) m (Fixed spelling, grammar; made an edit to keep consistency) |
(better coding habits) |
||
Line 9: | Line 9: | ||
|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 18: | ||
|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"), |
Revision as of 09:41, 28 October 2013
This page needs some serious TLC, stat! Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: A demonstration on the use and handling of this event would be beneficial. AfterLifeLochie 16:13, 30 November 2012 (MSK)) |
Event redstone | |
Fired when any Redstone inputs change on any of the sides of the computer. | |
Returned Object 1 | Nothing |
Basic Usage
Application