Posted 08 July 2012 - 06:10 AM
Hi, I'm new to lua and ComputerCraft, and I have a good knowledge of Java. I thought the rs API's way of using bundled cable colors was very weird, so I attempted to make a very small API that would make setting colors true or false a lot easier.
Here it is:
When I test this with:
What am I doing wrong? Thanks!
Here it is:
function setColor(a,b,c)
if type(a) ~= "string" then return end
if type(:)/>/> ~= "int" then return end
if type(c) ~= "boolean" then return end
if c == true then
rs.setBundledOutput(a,B)/>/>
else
if colors.test(rs.getBundledOutput(a,B)/>/>) == true then
rs.setBundledOutput(a, rs.getBundledOutput(a) - B)/>/>
end
end
end
When I test this with:
gagcolors.setColor("back",colors.pink,false)
it just outputs "gagcolors:13: Attempt to call nil". "gagcolors" is the name of my API, by the way.What am I doing wrong? Thanks!