:3
This commit is contained in:
25
src/main.lua
25
src/main.lua
@@ -1,11 +1,32 @@
|
||||
-- keycardOS "bootloader", has no access to basalt
|
||||
-- intended for checking for updates, and automatically updating basalt if it is missing
|
||||
local utils = require("utils.lua")
|
||||
local updater = require("updater.lua")
|
||||
|
||||
local mod = {}
|
||||
|
||||
KEYPADOS_VERSION = "4.0"
|
||||
|
||||
--- @class BootloaderLibs
|
||||
--- @field log Logger
|
||||
--- @field updater Updater
|
||||
--- @field notifier Notifier
|
||||
--- @field json JsonParser
|
||||
|
||||
|
||||
--- @class Logger
|
||||
--- @field error fun(...)
|
||||
--- @field warn fun(...)
|
||||
--- @field info fun(...)
|
||||
--- @field debug fun(...)
|
||||
|
||||
--- @class Updater
|
||||
--- @field addEntry fun(path: string, branch: string, url: string)
|
||||
|
||||
--- @class JsonParser
|
||||
--- @field decode fun(s: string): table
|
||||
--- @field encode fun(s: table): string
|
||||
|
||||
--- @class Notifier
|
||||
--- @field notify fun(priority: "1"|"2"|"3"|"4"|"5", body: string)
|
||||
|
||||
---@param blibs BootloaderLibs
|
||||
function mod.main(blibs)
|
||||
|
||||
@@ -2,6 +2,8 @@ local utils = require("utils.lua")
|
||||
local basalt = require("basalt")
|
||||
local config = require("config.lua")
|
||||
local updater = require("updater.lua")
|
||||
local blibs = require("main").blibs;
|
||||
|
||||
--- @type Monitor
|
||||
local monitor = utils.Cast(peripheral.find("monitor"))
|
||||
--- @type drive
|
||||
@@ -38,6 +40,7 @@ local function unlockDoor(ui)
|
||||
|
||||
basalt.debug("test")
|
||||
if ui.pin == config.correctPin then
|
||||
blibs.notifier.notify("5", "Unlocked door :3 love u");
|
||||
ui.enterButton:setBackground(colors.green)
|
||||
ui.pinLabel:setText("Welcome")
|
||||
redstone.setOutput("front", true)
|
||||
|
||||
Reference in New Issue
Block a user