Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --SubComputer
- row = "row1"
- allColors = colors.combine(colors.red, colors.green, colors.brown, colors.blue, colors.purple, colors.cyan, colors.lightGray, colors.gray, colors.pink, colors.lime)
- activeColors = allColors
- colorNames = {colors.red, colors.green, colors.brown, colors.blue, colors.purple, colors.cyan, colors.lightGray, colors.gray, colors.pink, colors.lime}
- row1bottom = {"terra", "arbor", "perditio", "instrumentum", "ignis", "spiritus", "corpus", "iter", "meto", "potentia"}
- row1back = {"praecantatio", "aqua", "sensus", "aer", "herba", "motus", "bestia", "venenum", "mortuus", "victus"}
- function getAspectInfo(name)
- count = 1
- while count <= table.getn(row1bottom) do
- if row1bottom[count] == name then
- return count, "bottom"
- end
- count = count + 1
- end
- count = 1
- while count <= table.getn(row1back) do
- if row1back[count] == name then
- return count, "back"
- end
- count = count + 1
- end
- end
- function removeColor(colorIndex, side)
- col = colorNames[colorIndex]
- activeColors = colors.subtract(activeColors, col)
- end
- function reloadColors()
- activeColors = allColors
- updateSignals("both")
- end
- --Updates the redstone signals
- function updateSignals(side)
- if side ~= "both" then
- redstone.setBundledOutput(side, activeColors)
- else
- redstone.setBundledOutput("bottom", activeColors)
- redstone.setBundledOutput("back", activeColors)
- end
- rednet.broadcast("clear")
- end
- --Just initializes rednet
- function rednetInit()
- rednet.open("top")
- rednet.broadcast(row)
- end
- --Main Code Body
- updateSignals("both")
- rednetInit()
- while true do
- id, msg = rednet.receive(5)
- sleep(0)
- if msg ~= nil and msg ~= "row2" and msg ~= "clear" then
- reloadColors()
- count, side = getAspectInfo(msg)
- removeColor(count)
- updateSignals(side)
- end
- if msg == "clear" then
- reloadColors()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement