- 101
- 24
- Версия MoonLoader
- .026-beta
Lua:
local mainIni = inicfg.load({
other = {
test = {'asd','dsa'}
}
}, 'CosyHelper')
imgui.InputText(u8'testbuffertext', testbuffer)
if imgui.Button(u8'add') then
table.insert(mainIni.other.test,testbuffer.v)
inicfg.save(mainIni, "CosyHelper.ini")
for k,v in pairs(mainIni.other.test) do
print(v)
end
end
Пример:
Lua:
local mainIni = inicfg.load({
other = {
test = {'asd','dsa'}
}
}, 'CosyHelper')
table.insert(mainIni.other.test, 'gre')
inicfg.save(mainIni, "CosyHelper.ini")
-- restart script
table.insert(mainIni.other.test, 'aqwe')
-- crash
При выполнении этого куска кода при перезапуске скрипта и попытке воспроизвести этот же кусок кода происходит следующая ошибка:
bad argument #1 to 'insert' (table expected, got string).
В чем проблема и как исправить?