Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ***************** --
- -- Jim's Door Opener --
- -- By Jharakn --
- -- ***************** --
- function whitePulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.white)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function orangePulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.orange)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function magentaPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.magenta)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function lightBluePulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.lightBlue)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function yellowPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.yellow)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function limePulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.lime)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function pinkPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.pink)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function grayPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.gray)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function lightGrayPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.lightGray)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- function cyanPulse(BundleDirection, number)
- for i = 1, number do
- redstone.setBundledOutput(BundleDirection, colors.cyan)
- sleep(1)
- redstone.setBundledOutput(BundleDirection, 0)
- sleep(1)
- end
- end
- -- Main Program --
- local pulseNumber = 3
- while true do
- local leftInput = rs.getInput("left")
- local rightInput = rs.getInput("right")
- os.pullEvent("redstone")
- sleep(0.5)
- if rs.getInput("right") == true then
- print("Opening Door")
- limePulse("top", pulseNumber)
- grayPulse("top", pulseNumber)
- cyanPulse("top", pulseNumber)
- lightGrayPulse("top", pulseNumber)
- pinkPulse("top", pulseNumber)
- end
- if rs.getInput("left") == true then
- print("Closing Door")
- magentaPulse("top", pulseNumber)
- yellowPulse("top", pulseNumber)
- whitePulse("top", pulseNumber)
- orangePulse("top", pulseNumber)
- lightBluePulse("top", pulseNumber)
- end
Advertisement
Add Comment
Please, Sign In to add comment