Files
smithy-overlay/startup.lua
2026-04-06 22:14:37 -07:00

26 lines
819 B
Lua

local stratumDBlib = require("stratumDBlib")
local meshnetBackend = require("meshnetBackend")
meshnetBackend.setTarget(10)
stratumDBlib.setBackend(meshnetBackend)
print("connecting to database...")
local trans = stratumDBlib.loadTransforms("transforms","stratumDBlib")
local overlay = link.getUpgradeFunctions().overlay
if not overlay then error("failed to find overlay goggles do you have them installed?") end
local function receive()
while true do
local count = trans.getOrderCount()
if count > 0 then
overlay.addOrUpdateTextElement("orderCount","Current Orders: "..tostring(count),1,1,0xFFFFFF,2)
else
overlay.addOrUpdateTextElement("orderCount","",1,1,0xFFFFFF,2)
end
overlay.send()
sleep(10)
end
end
parallel.waitForAny(receive)