Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local time = 0
- local isonGreen = 0
- local isonBlue = 0
- local isonYellow = 0
- local isonLightBlue =0
- local isonWhite = 0
- local isdoor = 0
- redstone.setBundledOutput("top", 0)
- redstone.setAnalogOutput("right", 15)
- function makeOutput()
- local out = 0
- local newrs = 0
- if isdoor ~= 0 then
- out = 5
- else
- if isonGreen ~= 0 then
- out = out + 1
- end
- if isonBlue ~= 0 then
- out = out + 1
- end
- if isonYellow ~= 0 then
- out = out + 1
- end
- if isonWhite ~= 0 then
- out = out + 1
- end
- if isonLightBlue ~= 0 then
- out = out + 1
- end
- end
- if out >= 1 then
- newrs = newrs + colors.white
- end
- if out >= 2 then
- newrs = newrs + colors.orange
- end
- if out >= 3 then
- newrs = newrs + colors.magenta
- end
- if out >= 4 then
- newrs = newrs + colors.lightBlue
- end
- if out >= 5 then
- newrs = newrs + colors.yellow
- end
- redstone.setBundledOutput("top", newrs)
- if out >= 5 and isdoor == 0 then
- redstone.setAnalogOutput("right", 0)
- isdoor = os.startTimer(60)
- end
- end
- while true do
- local e, data = os.pullEvent()
- print("vv" .. e)
- if e == "redstone" then
- local out
- out = redstone.getAnalogOutput("top")
- out = out + 1
- if redstone.testBundledInput("back", colors.yellow) then
- isonYellow = os.startTimer(5)
- end
- if redstone.testBundledInput("back", colors.blue) then
- isonBlue = os.startTimer(8)
- end
- if redstone.testBundledInput("back", colors.white) then
- isonWhite = os.startTimer(1)
- end
- if redstone.testBundledInput("back", colors.lightBlue) then
- isonLightBlue = os.startTimer(1)
- end
- if redstone.testBundledInput("back", colors.green) then
- isonGreen = os.startTimer(3)
- end
- makeOutput()
- end
- if e == "timer" then
- if data == isonYellow then
- isonYellow = 0
- elseif data == isonBlue then
- isonBlue = 0
- elseif data == isonGreen then
- isonGreen = 0
- elseif data == isonWhite then
- isonWhite = 0
- elseif data == isonLightBlue then
- isonLightBlue = 0
- elseif data == isdoor then
- redstone.setAnalogOutput("right", 12)
- isdoor = 0
- end
- makeOutput()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement