This is honestly really impressive. How did you learn to do all this?
years of redstone and trying to understand basic logic, timing, digital logic circuits..i've been playing this mod, and its predecessors all the way back to FTB ultimate, with the original RedPower mod that started it all (Eloraam...we really need you back
). Also helps to know how to throw around a few hundred lines of code in your programming language of choice
and about that code...i came up with something...evil. And smaller.
This is as good as it gets, without getting into command blocks or creating a custom mod (i almost did that, woulda been kinda cool, but a hack). Computercraft mining turtles are running this board.
I was inspired by the command block version you see on youtube...i dont have the link on me..but it uses command blocks to swap out the wool blocks you toggle. And this one is very evil indeed...because now there are *4* states for each light...black, orange, magenta, lime. in that order. I can only find one reference to this calling the game Colors Out...and it is annoyingly hard to solve the board
the code running the turtles is pretty simple (all the turtles are labeled 'lights out')
Code:
turtle.select(1)
local state = 1
local myTimer = 0
local function toggle()
state = state + 1
if state > 4 then state = 1 end
turtle.dig()
turtle.select(state)
turtle.place()
end
local function setNeighbors(v)
rs.setOutput("top", v)
rs.setOutput("bottom", v)
rs.setOutput("left", v)
rs.setOutput("right", v)
end
while true do
local event, id = os.pullEvent()
if event == "redstone" then
if rs.getInput("front") then
setNeighbors(true)
myTimer = os.startTimer(0.2)
end
if rs.getInput("top") then
toggle()
end
if rs.getInput("bottom") then
toggle()
end
if rs.getInput("top") then
toggle()
end
if rs.getInput("left") then
toggle()
end
if rs.getInput("right") then
toggle()
end
end
if event == "timer" and id == myTimer then
setNeighbors(false)
toggle()
end
end
i'm using os events to poll for redstone signals. a front signal means that block was toggled by user, so it will send a rs signal to its neighbors and starts that timer. you need that to let the game process the redstone update. the timer event hits, trigger the blocks own toggle function and disabling rs signals to neighbors. the cool bit is the toggle function itself..all it does is increment state (or resets to 1 if overflowed), digs the current block in front of the turtle, selects a slot in inventory, and places that block in front of turtle.
assuming you start with a black board, all the turtles start with an empty slot 1 (and all selected to slot 1), orange wool in slot 2, magenta wool in slot 3, lime wool in slot 4. now you see how the toggles work...dig block (and retrieve it to previous state), set inventory slot to current state, place block.
its a slow update doing it this way tho. for a moment you can see the turtles before the new blocks get placed...cc must have some steep timing penalties for digging/placing blocks.
the trick now is the input..use a wood button, place it where you want to toggle and press it. the turtles handle the rest. the button will pop off, so it can be reused.
as evil as this is, you can see there's room for more. I'm only using 4 slots on the turtles. hmm.. 16 colors, shall we? not hard to do, just change one line of code, and set up the turtles accordingly, reload the map (you dont want to go rebooting all those turtles by hand...trust me on this
file to play with the turtle version:
https://drive.google.com/open?id=0B2ucBrdZgWgnbVRuenVuLU82c1E
make sure your running a pack for 1.7.10 with computercraft to load that map.