Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Remote Wireless Big Reactor Control(monitor) by Disappearer
- -- This program need a wireless modem,advanced computer
- -- and at least 4 monitors to view informations normally.
- -- If you have different setup than one shown on screens
- -- edit these four variables below.
- rednet.open("right") -- side of wireless modem
- local mon = peripheral.wrap("top") -- side or name of monitor
- local dataprotocol = "data" -- data protocol
- local powerprotocol = "power" -- power protocol
- local monx ,mony = mon.getSize()
- function printdata()
- local id, mes, pro = rednet.receive(dataprotocol)
- term.redirect(mon)
- term.clear()
- mon.setTextScale(0.5)
- term.setCursorPos(1,1)
- if mes == false then
- write("STATUS: ")
- mon.setBackgroundColour(colors.red)
- write("ERROR")
- mon.setBackgroundColour(colors.black)
- print()
- print()
- print("Something is wrong with program or reactor setup")
- print("Press Ctrl+T to terminate program")
- else
- write("STATUS: ")
- if mes.active == true then
- mon.setBackgroundColour(colors.lime)
- write("ACTIVE")
- elseif mes.active == false then
- mon.setBackgroundColour(colors.yellow)
- write("NOT ACTIVE")
- end
- mon.setBackgroundColour(colors.black)
- print()
- print()
- print("Rods Level: " .. 100-tostring(mes.rodlevel) .." %")
- print("Energy Production: " .. math.floor(mes.energylasttick,0) .. " RF/t")
- print("Energy Stored: " .. mes.energystored .. " RF")
- print()
- print("Fuel: " .. mes.fuelamount .. "/" .. mes.fuelmax .. " mB")
- print("Fuel Usage: " .. math.ceil(mes.fueleatlasttick*100)/100 .. " mB/t")
- print("Fuel Temperature: " .. math.floor(mes.fueltemp,1) .. " C")
- print("Fuel Reactivity: " .. math.floor(mes.fuelreact,1) .. " %")
- print("Waste: " .. mes.wasteamount .. " mB")
- print()
- print("Casing Temperature:" .. math.floor(mes.casingtemp,1) .. " C")
- print()
- mon.setBackgroundColour(colors.orange)
- write("POWER ")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write(" RODS LEVEL ")
- print()
- mon.setBackgroundColour(colors.orange)
- write("SWITCH")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write("|<")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write("<<")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write("<")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write(">")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write(">>")
- mon.setBackgroundColour(colors.black)
- write(" ")
- mon.setBackgroundColour(colors.gray)
- write(">|")
- mon.setBackgroundColour(colors.black)
- end
- sleep(0.11)
- end
- function sendpower()
- local event, par1, tx, ty = os.pullEvent()
- if event == "monitor_touch" then
- if tx == 8 or tx == 9 and ty == 16 then
- rednet.broadcast("zero",powerprotocol)
- elseif tx == 11 or tx == 12 and ty == 16 then
- rednet.broadcast("minusten",powerprotocol)
- elseif tx == 14 and ty == 16 then
- rednet.broadcast("minus",powerprotocol)
- elseif tx == 17 and ty == 16 then
- rednet.broadcast("plus",powerprotocol)
- elseif tx == 19 or tx == 20 and ty == 16 then
- rednet.broadcast("plusten",powerprotocol)
- elseif tx == 22 or tx == 24 and ty == 16 then
- rednet.broadcast("sto",powerprotocol)
- elseif tx<7 and ty == 15 or tx<7 and ty == 16 then
- rednet.broadcast("poweron",powerprotocol)
- end
- end
- end
- while true do
- parallel.waitForAny(printdata,sendpower)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement