okay first api then program
api
side = "back"
function Add(color1)
c = rs.getBundledOutput(side)
if color1 == "white" then
c = colors.combine(c,colors.white)
elseif color1 == "orange" then
c = colors.combine(c,colors.orange)
elseif color1 == "magenta" then
c = colors.combine(c,colors.magenta)
elseif color1 == "lightblue" then
c = colors.combine(c,colors.lightBlue)
elseif color1 == "yellow" then
c = colors.combine(c,colors.yellow)
elseif color1 == "lime" then
c = colors.combine(c,colors.lime)
elseif color1 == "pink" then
c = colors.combine(c,colors.pink)
elseif color1 == "gray" then
c = colors.combine(c,colors.gray)
elseif color1 == "lightgray" then
c = colors.combine(c,colors.lightGray)
elseif color1 == "cyan" then
c = colors.combine(c,colors.cyan)
elseif color1 == "purple" then
c = colors.combine(c,colors.purple)
elseif color1 == "blue" then
c = colors.combine(c,colors.blue)
elseif color1 == "brown" then
c = colors.combine(c,colors.brown)
elseif color1 == "green" then
c = colors.combine(c,colors.green)
elseif color1 == "red" then
c = colors.combine(c,colors.red)
elseif color1 == "black" then
c = colors.combine(c,colors.black)
end
rs.setBundledOutput(side,c)
end
function Sub(color1)
c = rs.getBundledOutput(side)
if color1 == "white" then
c = colors.subtract(c,colors.white)
elseif color1 == "orange" then
c = colors.subtract(c,colors.orange)
elseif color1 == "magenta" then
c = colors.subtract(c,colors.magenta)
elseif color1 == "lightblue" then
c = colors.subtract(c,colors.lightBlue)
elseif color1 == "yellow" then
c = colors.subtract(c,colors.yellow)
elseif color1 == "lime" then
c = colors.subtract(c,colors.lime)
elseif color1 == "pink" then
c = colors.subtract(c,colors.pink)
elseif color1 == "gray" then
c = colors.subtract(c,colors.gray)
elseif color1 == "lightgray" then
c = colors.subtract(c,colors.lightGray)
elseif color1 == "cyan" then
c = colors.subtract(c,colors.cyan)
elseif color1 == "purple" then
c = colors.subtract(c,colors.purple)
elseif color1 == "blue" then
c = colors.subtract(c,colors.blue)
elseif color1 == "brown" then
c = colors.subtract(c,colors.brown)
elseif color1 == "green" then
c = colors.subtract(c,colors.green)
elseif color1 == "red" then
c = colors.subtract(c,colors.red)
elseif color1 == "black" then
c = colors.subtract(c,colors.black)
end
if color1 == "all" then
rs.setBundledOutput(side,0)
else
rs.setBundledOutput(side,c)
end
end
function pulse(color,time)
if time == "" or time == 0 then time = 0.1 end
Add(color)
os.sleep(time)
Sub(color)
end
program
function run()
bc.Add("white")
bc.Pulse("blue,0.2")
os.sleep(2)
bc.Sub("white")
bc.Pulse("blue,0.2")
os.sleep(1)
bc.Pulse("blue,0.2")
os.sleep(1)
bc.Pulse("blue,0.2")
os.sleep(1)
bc.Pulse("blue,0.2")
bc.Pulse("red,0.2")
bc.Pulse("green,0.2")
os.sleep(3)
end
while true do
if rs.getInput("right") then
run()
else
os.sleep(10)
end
end