Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainComputer = {aeTimerID = nil}
- comp = MainComputer
- while true do
- event, param1, param2, param3 = os.pullEvent()
- if event == "redstone" then -- redstone, nil, nil, nil
- if colors.test(rs.getBundledInput('bottom'), colors.green) then
- seconds = 300
- print('Powering on AE for ' .. seconds .. ' seconds')
- comp.aeTimerID = os.startTimer(seconds)
- outputs = rs.getBundledInput('bottom')
- outputs = colors.combine(outputs, colors.red)
- rs.setBundledOutput('bottom', colors.red)
- end
- elseif event == "timer" then -- timer, timerid, nil, nil
- if param1 == comp.aeTimerID then
- print('Turning off the AE system.')
- outputs = rs.getBundledOutput('bottom')
- outputs = colors.subtract(outputs, colors.red)
- rs.setBundledOutput('bottom', outputs)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement