This commit is contained in:
2025-06-14 12:13:04 -04:00
parent 81d53398f5
commit 8e19deb701
4 changed files with 43 additions and 31 deletions

10
kernel.lua Normal file
View File

@@ -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 }

View File

@@ -1,33 +1,30 @@
local function run() local function run()
local monitor = peripheral.wrap("top") print("Running main loop")
local modem = peripheral.wrap("back") -- local monitor = peripheral.wrap("top")
print(monitor) -- local modem = peripheral.wrap("back")
monitor.clear() -- print(monitor)
monitor.setTextScale(1) -- monitor.clear()
local maxWidth, maxHeight = monitor.getSize() -- monitor.setTextScale(1)
local y = 1 -- local maxWidth, maxHeight = monitor.getSize()
monitor.setCursorPos(1, y) -- local y = 1
local init = "Initalizing stream...." -- monitor.setCursorPos(1, y)
monitor.write(init) -- local init = "Initalizing stream...."
print(init) -- monitor.write(init)
y = y+1 -- print(init)
modem.open(80) -- y = y+1
-- modem.open(80)
while true do -- while true do
local _, _, _, _, message = os.pullEvent("modem_message") -- local _, _, _, _, message = os.pullEvent("modem_message")
monitor.setCursorPos(1, y) -- monitor.setCursorPos(1, y)
print(message) -- print(message)
--monitor.write(message) -- monitor.write(message)
monitor.write("Test") -- y=y+1
-- local cursorX, cursorY = monitor.getCursorPos() -- if(y > maxHeight) then
-- monitor.write(cursorY) -- y=maxHeight
-- print(cursorX) -- monitor.scroll(1)
y=y+1 -- end
if(y > maxHeight) then -- end
y=maxHeight
monitor.scroll(1)
end
end
end end
return { run = run } return { run = run }

View File

@@ -1,5 +1,7 @@
shell.execute("rm", "main.lua") local kernel = require('kernal')
shell.execute("wget", "https://git.astrocore.space/root/NovaCorpLLC/raw/branch/main/main.lua") kernal.addDriver("temperature_monitor")
kernal.addDriver("main")
sleep(5) sleep(5)
local main = require("main") local main = require("main")
main.run() main.run()

3
temperature_monitor.lua Normal file
View File

@@ -0,0 +1,3 @@
local reactor = peripheral.find("fissionReactorLogicAdapter")
local modem = peripheral.wrap("back")