Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local statelist = {
- ["top"] = rs.getInput("top"),
- ["front"] = rs.getInput("front"),
- ["left"] = rs.getInput("left"),
- ["right"] = rs.getInput("right"),
- ["back"] = rs.getInput("back"),
- ["bottom"] = rs.getInput("bottom"),
- }
- local modem = {peripheral.find("modem")}
- for i = 1, #modem do modem[i].open(rednet.CHANNEL_REPEAT) end
- local towert = {peripheral.find("bitnet_towert", function(name, object) return object.istowertComplete() end)}
- if #modem == 0 and #towert == 0 then error("No modems/towerts found.")
- else
- print("Welcome To The Siren Server!!!!!\nThis Program programmed By Yossi Yuval\nFor I.D.F!\nThis system is still in Beta!\nThis will be tested by I.D.F\n")
- end
- while true do -- Start an endless loop
- os.pullEvent("redstone") -- Yield the computer until some redstone changes
- -- We don't care what the event returns, since the first variable will be "redstone" and the rest will be nil.
- -- Now we check each side to see if it's changed.
- for side, state in pairs(statelist) do -- Run the lines of code in this loop for each key/value pair in statelist
- if rs.getInput(side) ~= state then -- If the side we're checking doesn't match what it was last time we checked then
- statelist[side] = rs.getInput(side) -- Update the statelist with the new change
- for i = 1, #towert do towert[i].transmit("off") end
- else
- for i = 1, #towert do towert[i].transmit("on") end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement