I'm about to write a program to automaticly control my 2 "BigReactors"-reactors. To do so, I've decided to start with the programming of the information-monitor-muliblocks. One for each reactor. To find again everything I need for it, when my server get crashed or deleted, I want to write both, the monitores and reactors, in one methode. And heres comes the issue:
The first monitor-multiblock works perctly fine. The second stays blank.
I've connected the computer via wires to the Monitores.
Cause I'm no pro in lua I don't know how to fix it. I've tried out several things but nothig worked
--Program to control reactors --and its monitores -------------Monitorsettings-------------------- ---MonitorLeft lsSide = "monitor_0" screenX = 1 function pts(out) screenX = screenX + 1 peripheral.call(lsSide, "write", out) peripheral.call(lsSide, "setCursorPos",1,screenX) end function ptc() screenX = 1 peripheral.call(lsSide,"clear") peripheral.call(lsSide,"setCursorPos",1,screenX) end peripheral.call(lsSide,"setTextScale",3) local reactor1 = peripheral.wrap("BigReactors-Reactor_2") while true do ptc() pts(" Reactor 1 \n") local Running = reactor1.getActive() if Running==true then pts("Status :\n".. "online") else pts("Status :\n".. "offline") end pts("RF/t :\n"..reactor1.getEnergyProducedLastTick()) local eStored = reactor1.getEnergyStored()/1000 pts("Loaded :\n"..eStored) pts("MB/t :\n"..reactor1.getFuelConsumedLastTick()) os.sleep(1) end --EndOfMonitorLeft ---MonitorRight rsSide = "monitor_1" screenX = 1 function pts(out) screenX = screenX + 1 peripheral.call(rsSide, "write", out) peripheral.call(rsSide, "setCursorPos",1,screenX) end function ptc() screenX = 1 peripheral.call(rsSide,"clear") peripheral.call(rsSide,"setCursorPos",1,screenX) end peripheral.call(rsSide,"setTextScale",3) local reactor2 = peripheral.wrap("BigReactors-Reactor_3") while true do ptc() pts(" Reactor 2 \n") local Running = reactor2.getActive() if Running==true then pts("Status :\n".. "online") else pts("Status :\n".. "offline") end pts("RF/t :\n"..reactor2.getEnergyProducedLastTick()) local eStored = reactor2.getEnergyStored()/1000 pts("Loaded :\n"..eStored) pts("MB/t :\n"..reactor2.getFuelConsumedLastTick()) os.sleep(1) end --EndOfMonitorRight --------------------------------------------------- --------------Reaktorcontrol---------------------- ---------------------------------------------------
I guess the problem might be the
function pts(out) screenX = screenX + 1 peripheral.call(rsSide, "write", out) peripheral.call(rsSide, "setCursorPos",1,screenX) end function ptc() screenX = 1 peripheral.call(rsSide,"clear") peripheral.call(rsSide,"setCursorPos",1,screenX) end
part of the --MonitorRight section, but I'm not sure about it
It would be nice if you could help me out a bit
Thanks a lot
oh, btw: For a better view, here you have the link to my Pastebinpost (premonition: it contains german words)
Edited by Hocico, 22 May 2017 - 11:20 PM.