Posted 03 January 2014 - 09:30 PM
In trying to automate a TinkersConstruct foundry through a ComputerCraft program, I have started by attempting to create a t flip flop function that will also display on a monitor the status of active or inactive. For some reason, when running the program, i get an error:
tflip:5: expected string, number
tflip is the name of the program. I am using rednet cables to seperate the redstone signal colors. I have managed to get the program to display the "active" status on the monitor, and output the signal over the correct color, however, it does not disable the signal.
this is just the first part in the larger goal of automating the foundry, with multiple smelteries, and various required redstone signals. Since i just started to learn Lua, i'm attempting this piece by peice.
here's the code as it currently stands:
tflip:5: expected string, number
tflip is the name of the program. I am using rednet cables to seperate the redstone signal colors. I have managed to get the program to display the "active" status on the monitor, and output the signal over the correct color, however, it does not disable the signal.
this is just the first part in the larger goal of automating the foundry, with multiple smelteries, and various required redstone signals. Since i just started to learn Lua, i'm attempting this piece by peice.
here's the code as it currently stands:
os.pullEvent("redstone")
while true do
if redstone.testBundledInput("left", colors.white) then
if redstone.testBundledInput("back", colors.orange) then
redstone.setBundledOutput("back", colors.orange, false)
peripheral.wrap("right").write("inactive")
else
redstone.setBundledOutput("back", colors.orange)
peripheral.wrap("right").write("active")
end
sleep(5)
end
end