local player = require("player") local DIFICULTIES = { ["Easy"] = 11, ["Medium"] = 13, ["Hard"] = 15 } local RARITIES = { ["Adult"] = 11, ["Large"] = 12, ["Rare"] = 13, ["Epic"] = 14, ["Legendary"] = 15, } local targetDificulty = DIFICULTIES["Medium"] local targetRarity = RARITIES["Legendary"] local questQueue = {} local commandSent = false local tickCounter = 0 local CLICK_DELAY = 11 -- Задержка между действиями (~1 сек) -- Ваш рабочий детект сообщений registerMessageEvent(function(text, overlay, json) if not overlay then local clean = text:gsub("§.", "") if clean:find("QUESTS »") then local questNumberStr = string.match(clean, "Quest #(%d+)") if questNumberStr then local questId = tonumber(questNumberStr) if questId then -- Добавляем в очередь. Каждый квест проходит 4 шага кликов table.insert(questQueue, { id = questId, step = 1 }) commandSent = false print("Квест #" .. questId .. " добавлен в очередь.") end end end end end) registerClientTick(function() -- Не работаем, если не закинута удочка (если вам это нужно) -- if not player.fishHook then return end local title = player.inventory.getChestTitle() -- 1. Если меню не открыто — отправляем команду if not title or not title:find("§f픹") then if not commandSent and player.fishHook ~= nil then player.sendCommand("/quest") commandSent = true print("Открываю меню /quest") end tickCounter = 0 return end -- 2. Таймер задержки между кликами tickCounter = tickCounter + 1 if tickCounter < CLICK_DELAY then return end tickCounter = 0 if #questQueue > 0 then local current = questQueue[1] if current and current.id then local questSlot = 11 + current.id -- 3. Логика пошаговых кликов if current.step == 1 then -- Первый клик: Забираем награду (Claim) player.inventory.leftClick(questSlot) print("Шаг 1: Забираю награду квеста #" .. current.id) current.step = 2 elseif current.step == 2 then -- Второй клик: Нажимаем на пустой слот квеста, чтобы начать выбор параметров player.inventory.leftClick(questSlot) print("Шаг 2: Открываю настройку квеста #" .. current.id) current.step = 3 elseif current.step == 3 then -- Третий клик: Выбор сложности player.inventory.leftClick(targetDificulty) print("Шаг 3: Выбор сложности (" .. targetDificulty .. ")") current.step = 4 elseif current.step == 4 then -- Четвертый клик: Выбор редкости player.inventory.leftClick(targetRarity) print("Шаг 4: Выбор редкости (" .. targetRarity .. ")") -- Квест полностью настроен, удаляем из очереди table.remove(questQueue, 1) end else table.remove(questQueue, 1) end elseif #questQueue == 0 and commandSent then print("Все задачи выполнены. Закрываю меню.") player.inventory.leftClick(40) -- Клик в пустоту или по кнопке закрытия player.inventory.closeScreen() end end)