- Версия MoonLoader
- .026-beta
Я для себя хочу сделать парсер игроков в орге чтоб находить нужные мне ранги, спарсить одну страницу я могу, но как это же сделать с остальными?
Вид диалога
Мой код:
Вид диалога

Lua:
local se = require "samp.events"
local file = io.open("ranks.txt", "w")
function split(str, delim, plain)
local tokens, pos, plain = {}, 1, not (plain == false) --[[ delimiter is plain text by default ]]
repeat
local npos, epos = string.find(str, delim, pos, plain)
table.insert(tokens, string.sub(str, pos, npos and npos - 1))
pos = epos and epos + 1
until not pos
return tokens
end
function hasNeededRank(str)
return string.match(str, "[78]") ~= nil
end
function se.onShowDialog(id, style, title, button1, button2, text)
if id == 567 then
local arr = split(text,"\n")
for _, str in ipairs(arr) do
if hasNeededRank(str) then
file:write(str.. "\n")
end
end
file:close()
end
end