Posted 01 November 2013 - 06:22 AM
So, I am trying to make a program that will control all my spawners. I have a table that looks like this:
Which I want to use in this sort of way:
The thing is, I need to tell the program what color cable to turn on/off, which is where this table comes in:
How do I incorporate the cableColor table in?
e.g.,
local spawn = {
creeper = true,
witch = true,
skeleton = true,
blaze = true,
pigmen = true,
slime = true,
chicken = true,
witch = true,
cow = true,
zombie = true,
}
Which I want to use in this sort of way:
for i, v in pairs(spawn) do
if [i] then
--"leave a rs signal to that spawner"
end
end
The thing is, I need to tell the program what color cable to turn on/off, which is where this table comes in:
local cableColor = {
colors.green = "creeper",
colors.red = "witch",
colors.white = "skeleton",
colors.orange = "blaze",
colors.yellow = "pigmen",
colors.lime = "slime",
colors.pink = "chicken",
colors.purple = "witch",
colors.brown = "cow",
colors.lightgrey = "zombie",
}
How do I incorporate the cableColor table in?
e.g.,
for i, v in pairs(spawn) do
if [i] then
rs.setBundledOutput("back", cableColor[i])
end
end