не работает автофарм

Dev_mod

Единомышленник
Участник
Сообщения
19
Розыгрыши
0
Репутация
5
Реакции
6
Баллы
115
Хроники
  1. Chaotic Throne: High Five
Исходники
Присутствуют
Сборка
L2scripts
реализовую автофарм на High Five(апаю пакетку на 464). когда использую автофарм он начинает цеклично отправлять [22:53:38] INFO ExAutoplayDoMacro. цель в таргет берёться но персонаж моба не бьёт. помогите понять в чём проблема
Код:
package l2s.gameserver.network.l2.s2c;

public class ExAutoplayDoMacro extends L2GameServerPacket
{
    public ExAutoplayDoMacro()
    {
        //
    }

    @Override
    protected void writeImpl()
    {
        writeD(276);
    }
}
 
реализовую автофарм на High Five(апаю пакетку на 464). когда использую автофарм он начинает цеклично отправлять [22:53:38] INFO ExAutoplayDoMacro. цель в таргет берёться но персонаж моба не бьёт. помогите понять в чём проблема
Код:
package l2s.gameserver.network.l2.s2c;

public class ExAutoplayDoMacro extends L2GameServerPacket
{
    public ExAutoplayDoMacro()
    {
        //
    }

    @Override
    protected void writeImpl()
    {
        writeD(276);
    }
}
Слот где находится макрос - вот что там шлется.
 
Скорее всего я не правильный айди слота отправляю, верно?
А вы логику автобоя на сервере делали?

Просто автобой после 196 протокола (ну и 166 когда его там на классик добавили) полностью на стороне сервера обрабатывается.
По-этому "нажать кнопку" - недостаточно.
 
L2scripts - если это не заглушка, смотри как было сделано в слитых сорсах на этом форуме, обнова Вангварда была.
А в целом, в любой шаре автофарм - не рабочий (это грубое описание, дефолтную работу он делает, а вот полной логики, там нет).
 
А вы логику автобоя на сервере делали?

Просто автобой после 196 протокола (ну и 166 когда его там на классик добавили) полностью на стороне сервера обрабатывается.
По-этому "нажать кнопку" - недостаточно.
да я реализовал всю логику. основной метод выходит doAutoFarm и вот так он у меня выглядит
Код:
public synchronized void doAutoFarm()
    {
        _onUseLock.lock();
        try {
            if (_owner.isTeleporting() || _owner.isDead()) {
                _farmActivate = false;
                // _farmTask.cancel(false);
                _owner.sendPacket(new ExAutoplaySetting(_owner));

            }
            if (_owner.isMounted() || _owner.isTransformed()) {
                _farmActivate = false;
                _owner.sendPacket(new ExAutoplaySetting(_owner));
                return;
            }
            if (!isFarmActivate()) {
                if (_farmTask != null) {
                    _farmTask.cancel(false);
                    _farmTask = null;
                }
                return;
            }

            if (_farmTask == null) {
                _farmTask = ThreadPoolManager.getInstance().scheduleAtFixedDelay(this::doAutoFarm, 500L, 500L);
            }

            if (_owner.getAI().getIntention() == CtrlIntention.AI_INTENTION_PICK_UP) {
                return;
            }

            GameObject target = _owner.getTarget();
            if (!checkTargetCondition(target, getTargetType())) {
                _owner.setTarget(null);
                target = findAutoFarmTarget();
                if (target != null) {
                    if (target.isItem()) {
                        _owner.getAI().setIntention(CtrlIntention.AI_INTENTION_PICK_UP, target, null);
                        return;
                    }
                    _owner.setTarget(target);
                }
            }

            if ((target == null) || (_owner.isInPeaceZone() && !Config.AUTOFARM_IN_PEACE_ZONE)){
                return;
            }
            if (_owner.isInPeaceZone() && (_owner.getTarget() != null) && (!_owner.getTarget().isMonster())) {
                return;
            }

            if (!_owner.getAutoShortCuts().autoSkillsActive())
            {
                if (!_owner.isMageClass() || _owner.getAutoShortCuts().autoAttackActive())
                {
                    _owner.sendPacket(new ExAutoplayDoMacro());
                }
            }
        }
        finally
        {
            _onUseLock.unlock();
        }
    }
но выходит так что при использования автофарма у меня придметы поднимаються автоматически и таргет работает исправно но атаки не присходит и поэтому я думал что проблема в том что я скидываю клиенту не тот айди слота и попал в тупик
Снимок экрана 2025-06-20 231102.webp
 
Ну так у тебя тут и не вызывается интеншн атаки - потому и не атакует.
Отправка ExAutoPlayDoMacro вобще по сути опциональна - даже без ее отправки должно работать.
Если не ошибаюсь, то ExAutoPlayDoMacro просто говорит что надо запустить с начала макрос в указанном слоте. Чтобы по сути при выборе новой цели атаки попытались отработать команды из макроса начиная с первой, а не с той позиции, где макрос на данный момент находится.
 
Do your AutoUse of buff scrolls, etc, work? Does your autofarm window "activate/toggle" (the animation activates)?

Because it looks like you might not be sending the "ExAutofarmSettings", "ExActivateAutoShortcut()" etc packets, or at least not with the correct Packet IDs/Opcodes.

From the little I know about scripts, I can tell the Autofarm is clearly doing its job - handling targeting and pickup logic.

Attacks are done via the AutoShortcuts. You must send the ExActivateAutoShortcut() packet with the correct page and index under certain conditions.

The most obvious sign, for me, is if your Autofarm does not get "activated" on the client side, as it appears to be the case from your screenshot, which leads me to believe you have an Opcode problem.

Furthermore, they tend to add or remove a packet or two here and there, so you can end up with a bunch of wrong packet IDs.

Most recently I faced an almost identical issue to yours as part of a task given to me by a client. It turned out that they were using the wrong ServerPacketOpcodes Enum, namely, their server was p152/p166 and they had tried upgrading it to p192/228. However, they have copied the Enum from a later protocol version (looked like p362 to me), and as a result, they had many extra Opcos and some missing too, because they had been depreciated somewhere between p192 and p362 or whichever they took the Opcos from.

So, my suggestion for a solution would be for you to verify the integrity of your ServerPacketOpcodes Enum for the protocol version you are adapting your source to.

Here is a sneak-peak. Hope it helps!

1750460791189.webp
 
Последнее редактирование:
Do your AutoUse of buff scrolls, etc, work? Does your autofarm window "activate/toggle" (the animation activates)?

Because it looks like you might not be sending the "ExAutofarmSettings", "ExActivateAutoShortcut()" etc packets, or at least not with the correct Packet IDs/Opcodes.

From the little I know about scripts, I can tell the Autofarm is clearly doing its job - handling targeting and pickup logic.

Attacks are done via the AutoShortcuts. You must send the ExActivateAutoShortcut() packet with the correct page and index under certain conditions.

The most obvious sign, for me, is if your Autofarm does not get "activated" on the client side, as it appears to be the case from your screenshot, which leads me to believe you have an Opcode problem.

Furthermore, they tend to add or remove a packet or two here and there, so you can end up with a bunch of wrong packet IDs.

Most recently I faced an almost identical issue to yours as part of a task given to me by a client. It turned out that they were using the wrong ServerPacketOpcodes Enum, namely, their server was p152/p166 and they had tried upgrading it to p192/228. However, they have copied the Enum from a later protocol version (looked like p362 to me), and as a result, they had many extra Opcos and some missing too, because they had been depreciated somewhere between p192 and p362 or whichever they took the Opcos from.

So, my suggestion for a solution would be for you to verify the integrity of your ServerPacketOpcodes Enum for the protocol version you are adapting your source to.

Here is a sneak-peak. Hope it helps!

Посмотреть вложение 87792
я проверял опкоды и там всё впорядке. при нажатии автофарма анимации не активируеться всё как на фотке.
 
Назад
Сверху