поиск

Neil_

Активный
Автор темы
196
27
Версия MoonLoader
Другое
Как возвращать сообщения?
Lua:
function sampev.onServerMessage(color, text)
    if string.find(text, 'UnitVkBot') and string.find(text, '%[.....%]') and color == (-2686721) then
        lua_thread.create(function()
            local captcha = text:match('%[.....%]'):gsub('%p', '')
            wait(math.random(1200, 2500))
            sampSendChat('/vr ' .. captcha)
        end)
    end
end

капчу ищет, но само сообщение из капчей убирает, через sampaddchatmessage я знаю что можно, но как-то по другому более правильно может можно?
 
Решение
попробуй
Lua:
function sampev.onServerMessage(color, text)
    if string.find(text, 'UnitVkBot') and string.find(text, '%[.....%]') and color == (-2686721) then
        lua_thread.create(function()
            local captcha = text:match('%[.....%]'):gsub('%p', '')
            wait(math.random(1200, 2500))
            sampSendChat('/vr ' .. captcha)
        end)
        return {color, text}
    end
end

yung milonov

Известный
974
474
попробуй
Lua:
function sampev.onServerMessage(color, text)
    if string.find(text, 'UnitVkBot') and string.find(text, '%[.....%]') and color == (-2686721) then
        lua_thread.create(function()
            local captcha = text:match('%[.....%]'):gsub('%p', '')
            wait(math.random(1200, 2500))
            sampSendChat('/vr ' .. captcha)
        end)
        return {color, text}
    end
end
 
  • Нравится
Реакции: why ega