Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cmp = require("component")
- local gpu = cmp.gpu
- local term = require("term")
- local gui = require("gui")
- local event = require("event")
- local Starts = true
- local sides = require("sides")
- keyboard=require("keyboard")
- gpu.setResolution(150, 40)
- term.clear()
- Reactor=cmp.proxy(cmp.get("1ed"))
- Start=cmp.proxy(cmp.get("7fc"))
- mfe=cmp.proxy(cmp.get("9fb"))
- --Reactor={Reactor=cmp.proxy(cmp.get("1ed")), Start=cmp.proxy(cmp.get("7fc"))}
- --TabComponent={[1]=Reactor}
- maxTemp=8450
- function R1(Start1)
- local rs = Start
- if Start1 == "active" then
- rs.setOutput(sides.up, 15)
- else
- rs.setOutput(sides.up, 0)
- end
- end
- function exitProgram()
- term.clear()
- Starts = false
- term.clear()
- end
- function callback(evID, ...)
- if evID then
- gui.callbackTouch(...)
- end
- end
- term.clear()
- gui.addButton(1, 20, "Выполнить", 0xFF0000, 0x00FF00, true, R1)
- gui.addButton(140, 35, "Выход", 0xFF0000, 0xFF8888, false, exitProgram)
- event.listen("touch", callback)
- while Starts do
- gui.drawUI()
- gpu.setResolution(150,40)
- os.sleep(0.5)
- term.setCursor(1,1)
- local m = mfe
- --local r = Reactor
- --R1={Reactor=cmp.proxy(cmp.get("1ed")), Start=cmp.proxy(cmp.get("7fc"))}
- --TabComponent={[1]=R1}
- --for key=1,5 do
- -- local r = TabComponent[key].Reactor;
- local r = Reactor
- str = "Включен "
- if Start.getOutput(sides.up) == 0 then str = "Выключен" end
- print(" Рeактор Хранилище Температура eU/t Состояние" )
- print(string.format(" %.0f %.0f %.0f %s" , m.getStored(), r.getHeat(), r.getReactorEUOutput(), str))
- end
- --end
- term.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement