Ok, first welcome to the forum

/>
Now, to make set bundled cable output you use the setBundledOutput function from the redstone api (rs api for short):
redstone.setBundledOutput(side, colors)
-- or
rs.setBundledOutput(side, colors)
So, if you want to make a pulse, you need to turn the color you want on, then off. For that you need to use sleep to wait some time:
rs.setBundledOutput(side, colors) -- turn on
sleep(time) -- wait some time
rs.setBundledOutput(side, colors) -- turn off
sleep(time) -- this is so the output gets to update before making a new pulse
You simply put that in a function and you can call it whenever you want from the program:
local function pulse(side, colors, time)
rs.setBundledOutput(side, colors)
sleep(time / 2)
rs.setBundledOutput(side, 0) -- 0 means no colors, so it turns the output off
sleep(time / 2)
end
pulse("back", colors.orange, 1) -- make a 1-second pulse on the back side with orange color
Now, that will work, but if that will turn off all the other colors off. That's when rs.getBundledOutput comes into play, it tells you what colors are currently on, so you can keep them on when you make the pulse:
rs.getBundledOutput(side)
But we also need to add to the active colors the ones we want to turn on, so we use the combine function from the colors api to do that:
local blackAndWhite = colors.combine(colors.white, colors.black)
So, we combine that with the pulse function so it keeps the previous output on and also turns the new ones on:
local function pulse(side, colors, time)
local current = rs.getBundledOutput(side)
rs.setBundledOutput(side, colors.combine(current, colors))
sleep(time / 2)
rs.setBundledOutput(side, current)
sleep(time / 2)
end
Ok, thats all about making the pulse. Now to wait for the button to be pressed you need to wait for a "redstone" event using os.pullEvent:
os.pullEvent("redstone")
(There's a tutorial about os.pullEvent if you want to know more about it)
And then you check if the input is on with:
rs.getInput(side)
To make it keep checking you have to use a loop:
while true do
-- do something
end
(There's other kind of loops, but this is better in this case)
Now, you'll need some flags to know what to do (if the door is already open you need to close it, not open it again). So I made a program that should work, if there's something that you don't understand, just ask.
Finished program:
local sButtonSide = "top"
local sOutputSide = "back"
local function pulse(side, nColors, time)
local current = rs.getBundledOutput(side)
rs.setBundledOutput(side, colors.combine(current, nColors))
sleep(time / 2)
rs.setBundledOutput(side, current)
sleep(time / 2)
end
local lastInput = false
local bOpen = false
while true do
os.pullEvent("redstone")
local input = rs.getInput(sButtonSide)
if input ~= lastInput then
if input then
bOpen = not bOpen
if bOpen then
rs.setBundledOutput(sOutputSide, colors.white)
pulse(sOutputSide, colors.orange, 1)
else
rs.setBundledOutput(sOutputSide, 0)
pulse(sOutputSide, colors.magenta, 1)
end
end
lastInput = input
end
end
Wow, this is a long post

/>
Hope you understand it. Happy Coding!

/>