From 8e19deb701e858f6e271601cc687a26404fe2ed4 Mon Sep 17 00:00:00 2001 From: itzmarkoni Date: Sat, 14 Jun 2025 12:13:04 -0400 Subject: [PATCH] updated --- kernel.lua | 10 ++++++++ main.lua | 53 +++++++++++++++++++---------------------- startup.lua | 8 ++++--- temperature_monitor.lua | 3 +++ 4 files changed, 43 insertions(+), 31 deletions(-) create mode 100644 kernel.lua create mode 100644 temperature_monitor.lua diff --git a/kernel.lua b/kernel.lua new file mode 100644 index 0000000..4edeee7 --- /dev/null +++ b/kernel.lua @@ -0,0 +1,10 @@ +local function addDriver(fileName) + local extension = ".lua" + local fullFile = fileName .. extension + shell.execute("rm", fullFile) + local baseRoute = "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/" + shell.execute("wget", baseRoute .. fullFile) + sleep(1) +end + +return { addDriver = addDriver } \ No newline at end of file diff --git a/main.lua b/main.lua index 2caf91b..2c28d06 100644 --- a/main.lua +++ b/main.lua @@ -1,33 +1,30 @@ local function run() - local monitor = peripheral.wrap("top") - local modem = peripheral.wrap("back") - print(monitor) - monitor.clear() - monitor.setTextScale(1) - local maxWidth, maxHeight = monitor.getSize() - local y = 1 - monitor.setCursorPos(1, y) - local init = "Initalizing stream...." - monitor.write(init) - print(init) - y = y+1 - modem.open(80) + print("Running main loop") + -- local monitor = peripheral.wrap("top") + -- local modem = peripheral.wrap("back") + -- print(monitor) + -- monitor.clear() + -- monitor.setTextScale(1) + -- local maxWidth, maxHeight = monitor.getSize() + -- local y = 1 + -- monitor.setCursorPos(1, y) + -- local init = "Initalizing stream...." + -- monitor.write(init) + -- print(init) + -- y = y+1 + -- modem.open(80) - while true do - local _, _, _, _, message = os.pullEvent("modem_message") - monitor.setCursorPos(1, y) - print(message) - --monitor.write(message) - monitor.write("Test") - -- local cursorX, cursorY = monitor.getCursorPos() - -- monitor.write(cursorY) - -- print(cursorX) - y=y+1 - if(y > maxHeight) then - y=maxHeight - monitor.scroll(1) - end - end + -- while true do + -- local _, _, _, _, message = os.pullEvent("modem_message") + -- monitor.setCursorPos(1, y) + -- print(message) + -- monitor.write(message) + -- y=y+1 + -- if(y > maxHeight) then + -- y=maxHeight + -- monitor.scroll(1) + -- end + -- end end return { run = run } \ No newline at end of file diff --git a/startup.lua b/startup.lua index c9bfd45..b0596b0 100644 --- a/startup.lua +++ b/startup.lua @@ -1,5 +1,7 @@ -shell.execute("rm", "main.lua") -shell.execute("wget", "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/main.lua") +local kernel = require('kernal') +kernal.addDriver("temperature_monitor") +kernal.addDriver("main") sleep(5) + local main = require("main") -main.run() +main.run() \ No newline at end of file diff --git a/temperature_monitor.lua b/temperature_monitor.lua new file mode 100644 index 0000000..f14be3f --- /dev/null +++ b/temperature_monitor.lua @@ -0,0 +1,3 @@ +local reactor = peripheral.find("fissionReactorLogicAdapter") +local modem = peripheral.wrap("back") +