level monitor monitor lever lever monitor monitor monitor lever
Each of those four levers I've succesfully wired to the rotary macerator, induction furnace et. all on the right wall. I could easily just use signs and check, but I think it would be cooler if I had monitors that said whether the machine was on. Therefore behind the monitors I've got a computer (behind the left one).
For the first monitor pair, the computer has an inverted redstone input from the top and a normal redstone input from its left. This is the code I've put together for that computer(as startup). It's in a loop because I want it to react to redstone changes, if that's not necessary to have it update, please tell me.
monitor.peripheral.wrap("front")
monitor.setTextScale(0.5)
while true do
monitor.write("Left side: Rotary Macerator")
monitor.write("Right side: Induction Furnace")
if redstone.getInput("top")==false then
monitor.write("Induction Furnace: OFF")
end
if redstone.getInput("top")==true then
monitor.write("Induction Furnace: ON")
end
if redstone.getInput("left")==true then
monitor.write("Rotary Macerator: OFF")
end
if redstone.getInput("left")==false then
monitor.write("Rotary Macerator: ON")
end
sleep(10)
monitor.clear()
end
Now, this runs without errors. However, there are two problems.
1. It prints everything on one long line. I tried adding \n to the end of each line in the if statements, as well as to the beginning of each line, but it still prints on one long line and replaces the \n with a ?.
2. After waiting a bit as it should with sleep(10), it clears the screen and nothing else pops up.
So how do I fix these two?