From 34fe5021a317521a46b976898234516454d9f639 Mon Sep 17 00:00:00 2001 From: xomf Date: Sat, 17 Aug 2024 22:47:56 +0000 Subject: [PATCH] Update src/boot.lua --- src/boot.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/boot.lua b/src/boot.lua index 5923967..31be6ae 100644 --- a/src/boot.lua +++ b/src/boot.lua @@ -1,6 +1,29 @@ -- keycardOS "bootloader", has no access to basalt -- intended for checking for updates, and automatically updating basalt if it is missing +LAST_USED = os.time() + +local function checkForUpdate() + current_time = os.time() + difference = math.abs(current_time - LAST_USED) + print("Checking for update... difference: " .. tostring(difference)) + --its been considerable time since the keypad was interacted with, therefore it's time to force an update down the users throat (microsoft moment) + if difference > .5 then + + --logic for updating + + end + +end + +function updateChecker() + + while true do + checkForUpdate() + sleep(1) + end + +end local function boot() KEYPADOS_VERSION = "3.0"