updated
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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 }
|
||||
Reference in New Issue
Block a user