парсинг информации из диалога

newgen

Новичок
Автор темы
10
0
всем привет
хотелось бы узнать как парсить информацию из диалога по порядку, то есть сохранять всю информацию в массив для использования в дальнейшем

1718540673518.png
 

qdIbp

Автор темы
Проверенный
1,444
1,186
Lua:
local sampev = require('samp.events')

local tables = {}
function main()
    sampRegisterChatCommand('sd',function()
        if #tables > 0 then
            for i,k in pairs(tables)do
                print(i,k)
            end
        end
    end)
    wait(-1)
end

function sampev.onShowDialog(did, style, title, b1, b2, text)
    if did == 64 then -- свой id dialoga
        for line in string.gmatch(text, '[^\n]+[%d+]%C+') do
            local her = tonumber(string.match(line, '%[(%d+)%]%D+'))
            if her then
                tables[her] = line
            end
        end
    end
end
пупупу, на этом мои полномочия все
 

newgen

Новичок
Автор темы
10
0
Lua:
local sampev = require('samp.events')

local tables = {}
function main()
    sampRegisterChatCommand('sd',function()
        if #tables > 0 then
            for i,k in pairs(tables)do
                print(i,k)
            end
        end
    end)
    wait(-1)
end

function sampev.onShowDialog(did, style, title, b1, b2, text)
    if did == 64 then -- свой id dialoga
        for line in string.gmatch(text, '[^\n]+[%d+]%C+') do
            local her = tonumber(string.match(line, '%[(%d+)%]%D+'))
            if her then
                tables[her] = line
            end
        end
    end
end
пупупу, на этом мои полномочия все
не парсит, но и ошибки не выдает