/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/lua/lua-515-172-008/main.lua
26 строк
549 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
local ConfigCache = {} function ConfigCache.load(filename) if ConfigCache.Data then return ConfigCache.Data end local file = io.open(filename, "r") if not file then return {} end local config = {} for line in file:lines() do local key, value = string.match(line, "(%w+)=(.*)") if key then config[key] = tonumber(value) or value end end file:close() ConfigCache.Data = config return config end local cfg = ConfigCache.load("config.txt")