Взятие 1 сообщения

7 СМЕРТНЫХ ГРЕХОВ

Известный
Автор темы
515
159
Версия MoonLoader
.026-beta
Как сделать что бы брал 1 репорт? А не считывало пару штук потом оно заходит за челом в репорт
и делает вот такое
1681400421025.png
LUA:
function main()
  repeat wait(100) until isSampAvailable()
  --хуйня
  while true do wait(0)
    if state == 2 then
      wait(800)
      sampAddChatMessage("Нажал ЕСК", -1)
        setVirtualKeyDown(VK_ESCAPE, true)
        wait(150)
        setVirtualKeyDown(VK_ESCAPE, false)
      state = 3
    end
    if repnokd[0] or repskd[0] and state == 3 then
      wait(flovfromrecon[0]*1000)
      sampSendChat("/reoff")
      state = 1
    end
  end
end

local forfind = {
  [1] = "%[Жалоба%] от (.*)%[(%d+)%]:%{......%} .*%. Уже %d+ жалоб%!%!%!",
  [2] = "%[Жалоба%] от %[(%d+)%](.*)%[(%d+)%]:%{......%} .*%. Уже %d+ жалоб%!%!%!",
  [3] = "%[Жалоба%] от (.*)%[(%d+)%]: %{......%}(.*)%. Уже %{......%}(%d+)%{......%} жалоб!!!"
}

function sampev.onServerMessage(color, text)
  if repnokd[0] or repskd[0] then
    for k, v in pairs(forfind) do
        if string.match(text, v) and state == 1 then
            if repnokd[0] then
                sampAddChatMessage(text, 0xFF6046)
            end
            lua_thread.create(function()
                if repskd[0] then
                  wait(flovskd[0]*60000)
                end
                if k == 1 then
                    nick, id = text:match(forfind[1])
                elseif k == 2 then
                    serv, nick, id = text:match(forfind[2])
                elseif k == 3 then
                    nick, id, msg, kolvo  = text:match(forfind[3])
                end
                sampSendChat('/ot')
            end)
        end
    end
  end
end


function sampev.onShowDialog(id, style, title, button1, button2, text)
  if repnokd[0] or repskd[0] then
    if text:find("Жалоба%/Вопрос от:.*%[%d+%]") then
        nicks, ides = text:match("Жалоба%/Вопрос от:(.*)%[(%d+)%]")
        sampSendDialogResponse(id,1,nil, reportMSG[math.random(1, 3)])
        sampSendChat('/re '..ides)
        state = 2
      return false
    end
  end
end
 
Решение

Loocking

Известный
1,372
468