You cant use,
local match = rs.getBundledInput("left") with…. if colors.test(match, colors.white ) == true thenYou want match to just == the side.
colors.test is used to test colors not redstone signals. So for it to work you would need some stuff like this in your code…
Spoiler
c = colors.combine( c , colors.red )
if colors.test( c , colors.white ) == true then
rs.setBundledOutput("back", colors.black )
else
print ("its not 16")
end
which would return its not 16
or
c = colors.combine( c , colors.white)
if colors.test( c , colors.white ) == true then
rs.setBundledOutput("back", colors.black )
else
print ("its not 16")
end
which would turn black onI've tested this and it works.. Assuming your are checking to see if white is on the code should be something like..
local match = ("left")
if rs.testBundledInput(match, colors.white ) == true then
rs.setBundledOutput("back", colors.black )
else
print ("its not 16")
end
And to improve some i would do something like this, which will allow you to turn it on and off without affected any of the other signals you are sending out the back. To turn it off you just need to add a colors.subtract section.
local match = ("left")
c = colors.combine( c )
if rs.testBundledInput(match, colors.white ) == true then
c = colors.combine( c , colors.black )
rs.setBundledOutput("back", c )
else
print ("its not 16")
end
I fixed several errors in your factory scripting as well, here it is.. The main menu is huge I would make it smaller..
Spoiler
Factory
--credit for the main menu build goes to Casper7526
--I ripped most of his tutorial code apart to do most of this.
--Mind the fact that this is a personal build and will request help if needed.
--I never used LUA before =p
--Current Version: Alpha.0 (Uncompleted Build)
--This program is ment to be run inside minecraft with the CC(ComputerCraft)
--mod. Outside of that this program does nothing.
--All feedback and switches are activated using the Laser mod for minecraft.
--along with Eloraam's RedPower2 mod for minecraft
function mainmenu()
while true do
term.clear()
term.setCursorPos(1,1)
print "-------------------------------------------------"
print "| Factory Master Computer Alpha 1 |"
print "| Foreman: Ridous |"
print "-------------------------------------------------"
print "| 1. Engines |"
print "| 2. Cooling |"
print "| 3. Re-fuel |"
print "| 4. Quarry |"
print "| 5. Bedrock Breaker |"
print "| 6. Pumps |"
print "| 7. Genorators |"
print "| 8. Anti-Creeper System |"
print "| 9. Factory Self-Destruct |"
print "| 0. Clock-out |"
print "| |"
print "| |"
print "| |"
print "-------------------------------------------------"
-- currently Bedrock Breaker is just the name for my
-- cobble genorator which can output 15 stacks in 60
-- seconds.
event, param1, param2, param3 = os.pullEvent()
if event == "char" and param1 == "0" then break end
if event == "char" and param1 == "1" then Engines() end
if event == "char" and param1 == "2" then Cooling() end
if event == "char" and param1 == "3" then Refuel() end
if event == "char" and param1 == "4" then Quarry() end
if event == "char" and param1 == "5" then BedrockBreaker() end
if event == "char" and param1 == "6" then Pumps() end
if event == "char" and param1 == "7" then Gens() end
if event == "char" and param1 == "8" then LaserDefecne() end
if event == "char" and param1 == "9" then SlefDestruct() end
end
end
function Engines()
while true do
term.clear()
term.setCursorPos(1,1)
shell.run( EngineData , onoff , match , gas75 , level , water , heatc )
-- above shell run will run EngineData and will send the variables for
-- onoff, match, gas75, level, water, and heatc
print "-------------------------------------------------"
print "| Factory Master Computer Alpha 1 |"
print "| Foreman: Ridous |"
print "-------------------------------------------------"
print "| Engines |"
print "| |"
print ("| Currently "..onoff.." |")
print "| |"
print ("| Current Number "..match.." |")
print ("| Full Tank? "..gas75.." |")
print ("| Water Level "..level.." |")
print ("| Cooling System? "..water.." |")
print ("| Heat Level "..heatc.." |")
print "| |"
print "| Turn off/on? [Y] [N] |"
print "| |"
print "| |"
print "-------------------------------------------------"
event, param1, param2, param3 = os.pullEvent()
if event == "char" and param1 == "y" then
shell.run( EngineData , switch )
mainmenu()
end
if event == "char" and param1 == "n" then mainmenu() end
-- pressing "y" will run the switch function in EngineData to make it
-- turn off if its already on or turn it on if it was off and then send
-- you back to the main menu. Pressing "n" will just send you back to
-- to the main menu.
end
end
function Cooling()
while true do
term.clear()
term.setCursorPos(1,1)
shell.run( CoolingData, onoff , match , reser , level )
-- above shell run will run CoolingData and will send the variables for
-- onoff, match, reser, and level
print "-------------------------------------------------"
print "| Factory Master Computer Alpha 1 |"
print "| Foreman: Ridous |"
print "-------------------------------------------------"
print "| Cooling |"
print "| |"
print ("| Currently "..onoff.." |")
print ("| |")
print ("| Current Number "..match.." |")
print ("| Full Reserves? "..reser.." |")
print ("| Heat Level "..level.." |")
print "| |"
print "| |"
print "| |"
print ("| Turn off/on? [Y] [N] |")
print "| |"
print "| |"
print "-------------------------------------------------"
event, param1, param2, param3 = os.pullEvent()
if event == "char" and param1 == "y" then
shell.run( CoolingData , switch )
mainmenu()
end
if event == "char" and param1 == "n" then mainmenu()
end
end
end
mainmenu()