-- Config start local COUGHT_DELAY_MIN = 1 -- Minimum delay before cought local COUGHT_DELAY_MAX = 2 -- Maximum delay before cought local ABILITY_DELAY = 27 -- Delay before pressing the ability local HORIZONTAL_RANGE = 4.25 -- Максимальное горизонтальное расстояние local VERTICAL_RANGE = 4.5 -- Максимальное вертикальное расстояние local RELEASE_DELAY_MIN = 1 -- Delay before pushing up local RELEASE_DELAY_MAX = 2 -- Delay before pushing up local ENTITY_CHECK_DELAY = 4 -- Delay the next check that the entity is nearby local ENTITY_SPAWN_DELAY = 15 -- Delay in checking that the entity has appeared local PREFIX = "§7[§6Hypixel Cry§7]" -- Chat prefix local MODE = "NoAbility" -- "OneShot", "Normal", "NoAbility", "SoulWhip" local BLACKLISTED_CREATURES_FOR_ABILITY = { "Titanoboa", -- Добавьте сюда другие названия сущностей, которые должны останавливать скрипт } -- Config end local inv = require("inventory_utils") local player = require("player") local world = require("world") local FISHGROD_SLOT = 0 local ABILITY_SLOT = 1 local state = { tick = 0, phase = "idle", -- "idle", "pressing", "pressed", "ability", "releasing" targetEntity = {} } local caught = 0 local abilities = 0 local killed = 0 local PRESS_DELAY = 1 local RELEASE_DELAY = 1 local macroStartTime = nil -- Время начала работы макроса на точке local totalMacroTime = 0 -- Общее время работы макроса macroStartTime = os.time() local started = false local scriptStopped = false local clockEmojis = { "🕐", "🕑", "🕒", "🕓", "🕔", "🕕", "🕖", "🕗", "🕘", "🕙", "🕚", "🕛" } local emojiIndex = 1 local emojiChangeDelay = 10 -- количество тиков между сменой эмодзи local emojiTick = 0 function animateClockEmoji() emojiTick = emojiTick + 1 if emojiTick >= emojiChangeDelay then emojiTick = 0 emojiIndex = emojiIndex + 1 if emojiIndex > #clockEmojis then emojiIndex = 1 end end return clockEmojis[emojiIndex] end register2DRenderer(function(context) local scale = context.getWindowScale() -- Поиск слотов local rod_item = inv.findItemInHotbar("ROD") if rod_item then FISHGROD_SLOT = rod_item end local ability_item = inv.findItemInHotbar("YETI_SWORD") if not ability_item then ability_item = inv.findItemInHotbar("HYPERION") end ABILITY_SLOT = ability_item -- Старт таймера, если не держим удочку или способность if player.input.getSelectedSlot() ~= rod_item and player.input.getSelectedSlot() ~= ability_item then macroStartTime = os.time() return end -- Сообщение об остановке скрипта if scriptStopped then local stopText = "§cSCRIPT STOPPED - Blacklisted creature detected!" local w = context.getTextWidth(stopText) context.renderText(scale.width - w / 2, scale.height / 2, stopText, 0, 0, 0, 0, true, 1) return end -- Считаем время работы local elapsed = totalMacroTime if macroStartTime then elapsed = elapsed + (os.time() - macroStartTime) end -- Статус local status = "" if state.phase == "spawn_chech" or state.phase == "ability" then status = "⚔" end -- Формат времени local hours = math.floor(elapsed / 3600) local minutes = math.floor((elapsed % 3600) / 60) local seconds = elapsed % 60 local timeStr = string.format("%02d:%02d:%02d", hours, minutes, seconds) if hours == 0 then timeStr = string.format("%02d:%02d", minutes, seconds) if minutes == 0 then timeStr = string.format("%02d", seconds) end end -- Тексты local titleText = "§9AFK Fishing " .. status local timeText = "§f" .. animateClockEmoji() .. " " .. timeStr local caughtText = "§b" .. caught local killedText = "§c⚔ " .. killed local abilitiesText = "§6" .. abilities -- Предметы local rod = player.inventory.getStack(rod_item) local ability = ability_item and player.inventory.getStack(ability_item) or nil -- Размеры local titleWidth = context.getTextWidth(titleText) local timeWidth = context.getTextWidth(timeText) local caughtWidth = context.getTextWidth(caughtText) local killedWidth = context.getTextWidth(killedText) local abilitiesWidth = context.getTextWidth(abilitiesText) local itemSize = 16 * 0.7 local spacing = 4 -- Вычисляем totalWidth local totalWidth = itemSize + spacing + caughtWidth if MODE ~= "OneShot" and MODE ~= "NoAbility" and ability then totalWidth = totalWidth + spacing + killedWidth end if ability and MODE ~= "NoAbility" and MODE ~= "SoulReaper" then totalWidth = totalWidth + spacing + itemSize + spacing + abilitiesWidth end -- Центрирование local startX = (scale.width - totalWidth) / 2 local centerY = scale.height / 2 local centerXTitle = (scale.width - titleWidth) / 2 local centerYTitle = centerY - 27 local centerXTime = (scale.width - timeWidth) / 2 local centerYTime = centerY + 15 -- Рендер заголовка context.renderText(centerXTitle, centerYTitle, titleText, 0, 0, 0, 255, true, 1) -- Рендер статистики local currentX = startX local statsY = centerY - 15 -- Удочка + поймано context.renderItemStack(currentX + 2, statsY - 2, rod, 0.7) currentX = currentX + itemSize + spacing context.renderText(currentX, statsY, caughtText, 0, 0, 0, 255, true, 1) currentX = currentX + caughtWidth + spacing -- Убийства (только если есть ability и не OneShot) if MODE ~= "OneShot" and MODE ~= "NoAbility" and ability then context.renderText(currentX, statsY, killedText, 0, 0, 0, 255, true, 1) currentX = currentX + killedWidth + spacing end -- Предмет способности (если есть) if ability and MODE ~= "NoAbility" then context.renderItemStack(currentX, statsY - 2, ability, 0.7) currentX = currentX + itemSize + spacing -- Текст способности context.renderText(currentX, statsY, abilitiesText, 0, 0, 0, 255, true, 1) end -- Рендер времени context.renderText(centerXTime, centerYTime, timeText, 0, 0, 0, 255, true, 1) end) local trackedEntities = {} local function isEntityInRange(entity) if not entity then return false end local playerPos = player.getPos() if not playerPos then return false end -- Получаем координаты игрока и сущности local px, py, pz = playerPos.x, playerPos.y, playerPos.z local ex, ey, ez = entity.x, entity.y, entity.z -- Вычисляем горизонтальное расстояние (игнорируя высоту) local horizontalDistance = math.sqrt((px - ex) ^ 2 + (pz - ez) ^ 2) -- Вычисляем вертикальное расстояние (разница по высоте) local verticalDistance = math.abs(py - ey) -- Проверяем оба условия local isHorizontalInRange = horizontalDistance <= HORIZONTAL_RANGE local isVerticalInRange = verticalDistance <= VERTICAL_RANGE return isHorizontalInRange and isVerticalInRange, horizontalDistance, verticalDistance end -- Функция для проверки наличия чернокованных сущностей local function hasBlacklistedCreature() local entities = world.getEntities() for index, entity in ipairs(entities) do if entity ~= nil then local entityName = entity.display_name if entityName then -- Проверяем каждое название из черного списка for _, blacklistedName in ipairs(BLACKLISTED_CREATURES_FOR_ABILITY) do if string.find(entityName, blacklistedName) then local isInRange = isEntityInRange(entity) if isInRange then return true, entityName, blacklistedName end end end end end end return false, nil, nil end -- Функция для проверки наличия нужной сущности поблизости local function hasTargetEntityNearby() local eyePos = player.getEyePosition() local entities = world.getEntities() local currentEntities = {} local foundAny = false -- Собираем все текущие сущности for index, entity in ipairs(entities) do if entity ~= nil then local entityName = entity.name if isEntityInRange(entity) and entity.uuid ~= player.entity.uuid and entity.type ~= "entity.minecraft.experience_orb" and entity.type ~= "entity.minecraft.fishing_bobber" and entity.type ~= "entity.minecraft.item" and entity.type ~= "entity.minecraft.falling_block" and entity.type ~= "entity.minecraft.bat" then if entity.type ~= "entity.minecraft.armor_stand" then --player.addMessage(entity.type) end if entity.type == "entity.minecraft.squid" or entity.type == "entity.minecraft.zombie" or entity.type == "entity.minecraft.skeleton" or entity.type == "entity.minecraft.silverfish" or entity.type == "entity.minecraft.guardian" or entity.type == "entity.minecraft.witch" or entity.type == "entity.minecraft.rabbit" or entity.type == "entity.minecraft.iron_golem" or entity.type == "entity.minecraft.ocelot" or entity.type == "entity.minecraft.chicken" or entity.type == "entity.minecraft.slime" or entity.type == "entity.minecraft.cow" or entity.type == "entity.minecraft.mooshroom" then --currentEntities[entity.uuid] = true foundAny = true -- Если это новая сущность, добавляем в отслеживаемые if not trackedEntities[entity.uuid] then --trackedEntities[entity.uuid] = true end elseif entityName and string.find(entityName, "Lv") then currentEntities[entity.uuid] = true foundAny = true -- Если это новая сущность, добавляем в отслеживаемые if not trackedEntities[entity.uuid] then trackedEntities[entity.uuid] = true end end end end end -- Проверяем, какие сущности исчезли (были убиты) for uuid, _ in pairs(trackedEntities) do if not currentEntities[uuid] then -- Сущность исчезла - увеличиваем счетчик убитых killed = killed + 1 trackedEntities[uuid] = nil -- Удаляем из отслеживаемых end end -- Очищаем trackedEntities от сущностей, которые больше не существуют for uuid, _ in pairs(trackedEntities) do if not currentEntities[uuid] then trackedEntities[uuid] = nil end end return foundAny end local function safe_random(min_val, max_val, name) if min_val > max_val then min_val, max_val = max_val, min_val end return math.random(min_val, max_val) end registerClientTickPre(function() if not scriptStopped then local hasBlacklisted, entityName, blacklistedName = hasBlacklistedCreature() if hasBlacklisted then scriptStopped = true player.addMessage(PREFIX .. " §cSCRIPT STOPPED! Detected blacklisted creature: " .. " §c(Matched: §e" .. blacklistedName .. "§c)") player.addMessage(PREFIX .. " §cPlease kill the creature and restart the script manually.") return end end if player.fishHook == nil and not started then player.input.setSelectedSlot(FISHGROD_SLOT) player.input.silentUse(FISHGROD_SLOT) started = true elseif player.fishHook then started = true end if player.inventory.isAnyScreenOpened() then return end local entities = world.getEntities() local foundTarget = false -- Поиск целевой entity (рыболовной) for index, entity in ipairs(entities) do if entity ~= nil then local entityName = entity.name if entityName and (string.find(entityName, "!!!") or string.find(entityName, "ǃǃǃ") or string.find(entityName, "ꜝꜝꜝ")) and (state.targetEntity.uuid ~= entity.uuid) then foundTarget = true if state.phase == "idle" then state.targetEntity = entity state.phase = "pressing" state.tick = 0 if COUGHT_DELAY_MIN > COUGHT_DELAY_MAX then error("COUGHT_DELAY_MIN (" .. COUGHT_DELAY_MIN .. ") не может быть больше COUGHT_DELAY_MAX (" .. COUGHT_DELAY_MAX .. ")") end if RELEASE_DELAY_MIN > RELEASE_DELAY_MAX then error("RELEASE_DELAY_MIN (" .. RELEASE_DELAY_MIN .. ") не может быть больше RELEASE_DELAY_MAX (" .. RELEASE_DELAY_MAX .. ")") end PRESS_DELAY = safe_random(COUGHT_DELAY_MIN, COUGHT_DELAY_MAX) RELEASE_DELAY = safe_random(RELEASE_DELAY_MIN, RELEASE_DELAY_MAX) end break end end end -- Обработка состояний if state.phase == "pressing" then player.input.setSelectedSlot(FISHGROD_SLOT) state.tick = state.tick + 1 if state.tick >= PRESS_DELAY then player.input.silentUse(FISHGROD_SLOT) if MODE == "OneShot" and ABILITY_SLOT then player.input.silentUse(ABILITY_SLOT) caught = caught + 1 abilities = abilities + 1 state.phase = "releasing" state.tick = 0 elseif MODE == "NoAbility" or MODE == "SoulWhip" then state.phase = "releasing" state.tick = 0 caught = caught + 1 else caught = caught + 1 state.phase = "pressed" state.tick = 0 end end elseif state.phase == "pressed" then state.tick = state.tick + 1 local hasLvEntity = hasTargetEntityNearby() if hasLvEntity or state.tick >= ENTITY_SPAWN_DELAY then state.tick = 0 if ABILITY_SLOT then state.phase = "ability" else state.phase = "releasing" end end elseif state.phase == "ability" then state.tick = state.tick + 1 -- Задержка перед проверкой сущности if state.tick <= ENTITY_CHECK_DELAY then return end -- Проверяем наличие сущности с "Lv" поблизости local hasLvEntity = hasTargetEntityNearby() if hasLvEntity then player.input.setSelectedSlot(ABILITY_SLOT) -- Вычисляем тики после задержки local ticksAfterDelay = state.tick - ENTITY_CHECK_DELAY -- Первая проверка после задержки - используем сразу if ticksAfterDelay == 1 then player.input.silentUse(ABILITY_SLOT) abilities = abilities + 1 player.addMessage(PREFIX .. " §cUsed ability immediately - §3Sea Creature §centity nearby") state.tick = ENTITY_CHECK_DELAY + 2 else if ticksAfterDelay >= ABILITY_DELAY then player.input.silentUse(ABILITY_SLOT) abilities = abilities + 1 player.addMessage(PREFIX .. " §cUsed ability after delay - §3Sea Creature §centity nearby") state.tick = ENTITY_CHECK_DELAY + 2 end end else player.addMessage(PREFIX .. " §cNo §3Sea Creature §centity nearby, skipping damage ability") state.tick = 0 state.phase = "releasing" end elseif state.phase == "releasing" then state.tick = state.tick + 1 if state.tick >= RELEASE_DELAY then state.phase = "killing" state.tick = 0 end elseif state.phase == "killing" then if MODE == "SoulWhip" and caught % 10 == 0 then local status = player.input.setSelectedSlot(1) state.tick = state.tick + 1 if state.tick >= 25 then player.input.setSelectedSlot(FISHGROD_SLOT) player.input.silentUse(FISHGROD_SLOT) state.phase = "idle" state.tick = 0 else local status = player.input.silentUse(2) end else player.input.setSelectedSlot(FISHGROD_SLOT) player.input.silentUse(FISHGROD_SLOT) state.phase = "idle" state.tick = 0 end end end) return "loaded"