updated
This commit is contained in:
@@ -8,8 +8,7 @@ local function run()
|
|||||||
|
|
||||||
monitor.writeLine("Starting system...")
|
monitor.writeLine("Starting system...")
|
||||||
monitor.writeLine("System started successfully!")
|
monitor.writeLine("System started successfully!")
|
||||||
data.writeValue("computer-name", "Papercut87")
|
computerName = data.getRead("computer-name")
|
||||||
computerName = data.getValue("computer-name")
|
|
||||||
monitor.writeLine("Computer name: " .. computerName)
|
monitor.writeLine("Computer name: " .. computerName)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -87,4 +87,15 @@ local function initialize()
|
|||||||
return false
|
return false
|
||||||
end
|
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