This commit is contained in:
2026-05-05 17:41:22 -04:00
parent 57f83bd56b
commit 875edb891a
4 changed files with 254 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
local diskDrive = peripheral.find("drive")
local monitor = require("monitor-driver")
local function getFilePath()
if diskDrive and diskDrive.isDiskPresent() then
local path = diskDrive.getMountPath()
@@ -75,9 +75,10 @@ local function writeValue(key, value)
end
local function initialize()
monitor.writeLine("Initializing Data Storage...")
local monitor = peripheral.find("monitor")
if monitor then monitor.write("Initializing Data Storage...") end
if diskDrive and diskDrive.isDiskPresent() then
monitor.writeLine("Disk detected. Initializing data storage.")
if monitor then monitor.write("Disk detected. Initializing data storage.") end
local path = getFilePath()
if path and not fs.exists(path) then
saveData({})