This commit is contained in:
2025-12-12 13:37:48 -05:00
parent 9278662552
commit 0822432ba8
2 changed files with 13 additions and 3 deletions

View File

@@ -8,8 +8,7 @@ local function run()
monitor.writeLine("Starting system...")
monitor.writeLine("System started successfully!")
data.writeValue("computer-name", "Papercut87")
computerName = data.getValue("computer-name")
computerName = data.getRead("computer-name")
monitor.writeLine("Computer name: " .. computerName)
end

View File

@@ -87,4 +87,15 @@ local function initialize()
return false
end
return { getValue = getValue, updateValue = updateValue, writeValue = writeValue, initialize = initialize }
local function getRead(key)
local value = getValue(key)
if value then
return value
end
print("Enter value for " .. key .. ":")
local input = read()
writeValue(key, input)
return input
end
return { getValue = getValue, updateValue = updateValue, writeValue = writeValue, initialize = initialize, getRead = getRead }