This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
lodimas's profile picture

Not sure how to write function for bundled cables

Started by lodimas, 12 July 2012 - 01:16 AM
lodimas #1
Posted 12 July 2012 - 03:16 AM

function flashleft(Str)
local cur = rs.getBundledOutput("left")
a = colors.combine(cur, colors.(Str))
rs.setBundledOutput("left", a)
sleep(3)
b = colors.subtract(cur, colors.(Str))
rs.setBundledOutput("left", :)/>/>
sleep(3)
end
flashleft("blue")

if there is a rogue capital B it isn't there on the terminal just shows up on forums. This code doesn't work unfortunately i think it is pretty clear from my effort what i am trying to achieve can someone please look it over? Thank you
Graypup #2
Posted 12 July 2012 - 04:46 AM
Colors.(Str) can't and won't work, use colors[Str] intead.
Graypup #3
Posted 12 July 2012 - 04:50 AM
It's case sensitive, too, fix capitol B.
lodimas #4
Posted 12 July 2012 - 09:30 AM
Colors.(Str) can't and won't work, use colors[Str] intead.

thanks for your reply, i'm not home right now but just to clarify, is it colors.[str] or colors[str] ?
and does the function need to be flashleft[str]?

thanks
lod
gmt2001 #5
Posted 12 July 2012 - 01:44 PM
colors[str]

function is flashleft(str)