Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала AutoLes умный | monoton ready.

совет тебе нам, иногда на /warp les появляется баганные деревья, их ломаешь они в скорборде прибавляются НО в чат не пишется что они сломаются через сколько-то там раз, найди его, ещё больше фармить будешь.
тот режим который ты сделал, твой фаст, короче не совсем такой как у меня, но ты очень близко.

я за 1-1.5 часа с фаст режимом вот сток поднял
Посмотреть вложение 327107

я тут посчитал
циферки прикинул
вышло 35 часов
это невозможно
я не волшебник
 
ну тип я стою а оно меня в блок кидает и я не могу ходить пока дерево не вырастит
так же оно не понятно что ламает, надо бы добавить "визуализацию" ломания, ну тип оно то ворк и +200 в секунду , то прост стоит на месте и даже если бегать то ему пох
У меня такая фигня, что я стою и просто ничего не ломается (функция включена) с фастом то же самое и даже при включенной визуализации
 
У меня такая фигня, что я стою и просто ничего не ломается (функция включена) с фастом то же самое и даже при включенной визуализации
у тебя какая база?
ты юзал мое решение или ориг без фаста?
 
я тут посчитал
циферки прикинул
вышло 35 часов
это невозможно
я не волшебник
это реально анрил
я получаю в секунду по 40монет
40 на 60 (минута)
2400
2400 на 60 (час)
113к
113 максимум это если я с железного на 4 эффективностЬ
незеритовый на эфф 5 будет максимум в час фармить 250к в час
ну плять не выходит тут 5 лямов
чзх
 
Последнее редактирование:
у тебя какая база?
ты юзал мое решение или ориг без фаста?
база mcp 1.16.5
взял ориг немного переписав под свою базу (взял утилиты из ориг базы монотона) и добавил твоё решение отдельным методом
сейчас ещё кое-что переписал, буду пробывать...
 
база mcp 1.16.5
взял ориг немного переписав под свою базу (взял утилиты из ориг базы монотона) и добавил твоё решение отдельным методом
сейчас ещё кое-что переписал, буду пробывать...
ну хз тогда
у меня все гуд
по 100 монет в секунду с незера 5эфф
 
ты не кидал нифига, у меня с незер топором выходит примерно 25к за 10минут без фаста.
фаст я не ебу как сделать
мало
у меня от 60 до 100 в секунду у тебя 40 если 25к на 600 поделить
 
Привет форум. Я еще не видел чтобы сливали подобную функцию, буду первым. Умный AutoLes который фармит, сдает, переводит.

Пожалуйста, авторизуйтесь для просмотра ссылки.


Fast я не дам так как он ну слишком много добывает за секунду.
AutoLes:
Expand Collapse Copy
package monoton.module.impl.player;

import java.util.Comparator;
import java.util.List;
import monoton.control.events.client.Event;
import monoton.control.events.player.EventUpdate;
import monoton.module.TypeList;
import monoton.module.api.Annotation;
import monoton.module.api.Module;
import monoton.module.settings.Setting;
import monoton.module.settings.imp.BooleanOption;
import monoton.module.settings.imp.ModeSetting;
import monoton.module.settings.imp.SliderSetting;
import monoton.module.settings.imp.TextSetting;
import monoton.utils.IMinecraft;
import monoton.utils.other.StopWatch;
import monoton.utils.world.WorldUtils;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.network.play.client.CPlayerDiggingPacket;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;

@Annotation(
        name = "AutoLes",
        type = TypeList.Player,
        desc = "Автоматически ломает брёвна в радиусе 4 блоков"
)
public class AutoLes extends Module implements IMinecraft {
    private BlockPos targetPos;
    private static final double MAX_RANGE = 4.0D;
    private static final double MAX_RANGE_SQ = 16.0D;

    private final ModeSetting breakMode = new ModeSetting("Режим", "Default", "Default");
    private final SliderSetting packetsPerSecond = new SliderSetting("Пакетов/сек", 20.0f, 1.0f, 100.0f, 1.0f)
            .setVisible(() -> breakMode.is("Fast"));
    private final SliderSetting breakRadius = new SliderSetting("Радиус", 4.0f, 1.0f, 6.0f, 0.5f);

    BooleanOption swing = new BooleanOption("Махать рукой", true);

    BooleanOption autoWood = new BooleanOption("Авто-сдача", true);

    BooleanOption autoPay = new BooleanOption("AutoPay", false);

    TextSetting namePay = new TextSetting("Ник для перевода", "name").setVisible(() -> autoPay.get());

    SliderSetting valuePay = new SliderSetting("Кол-во монет для перевода", 1000, 500, 25000,1000).setVisible(() -> autoPay.get());

    SliderSetting timer = new SliderSetting("Расписание/c", 20, 1, 60, 1).setVisible(() -> autoPay.get());

    private final StopWatch sellTimer = new StopWatch();
    private final StopWatch payTimer = new StopWatch();
    private final StopWatch breakTimer = new StopWatch();
    private final StopWatch packetTimer = new StopWatch();
    private int packetsSent = 0;
    private long lastBreakTime = 0;

    public AutoLes() {
        addSettings(breakMode, packetsPerSecond, breakRadius, swing, autoPay, autoWood, namePay, valuePay, timer);
    }

    public boolean onEvent(Event event) {
        if (event instanceof EventUpdate) {
            this.updateNuker();
            this.autoSell();
            this.autoPay();
        }
        return false;
    }

    public void autoSell() {
        if (autoWood.get() && sellTimer.hasPassed(timer.getValue().intValue() * 500)) {
            mc.player.sendChatMessage("/sellwood");
            sellTimer.reset();
        }
    }

    public void autoPay() {
        if (autoPay.get() && payTimer.hasPassed((timer.getValue().intValue() * 500) + 200)) {
            mc.player.sendChatMessage("/pay " + namePay.get() + " " + valuePay.getValue().intValue());
            payTimer.reset();
        }
    }

    private void updateNuker() {
        if (mc.player == null || mc.world == null) {
            targetPos = null;
            packetsSent = 0;
            return;
        }

        if (targetPos != null &&
                (!isLog(targetPos) || !isInRange(targetPos) || !isVisible(targetPos))) {
            targetPos = null;
        }

        if (targetPos != null) {
            breakBlock();
        } else {
            findAndBreakNewTarget();
        }
    }

    private void findAndBreakNewTarget() {
        BlockPos playerPos = mc.player.getPosition();

        int radius = (int) breakRadius.getValue().floatValue();
        BlockPos from = playerPos.add(-radius, -radius, -radius);
        BlockPos to = playerPos.add(radius, radius, radius);

        List<BlockPos> blocks = WorldUtils.Blocks.getAllInBox(from, to);

        targetPos = blocks.stream()
                .filter(this::isLog)
                .filter(this::isInRange)
                .filter(this::isVisible)
                .min(Comparator.comparing(pos ->
                        mc.player.getDistanceSq(Vector3d.copyCentered(pos))
                ))
                .orElse(null);

        if (targetPos != null) {
            breakBlock();
        }
    }

    private void breakBlock() {
        if (targetPos == null) return;

        if (breakMode.is("Default")) {
            if (breakTimer.hasPassed(3)) {
                mc.playerController.spoofInstantDig(targetPos, Direction.UP);
                mc.playerController.onPlayerDestroyBlock(targetPos);
                if (swing.get()){
                mc.player.swingArm(Hand.MAIN_HAND);
                }
                breakTimer.reset();
                lastBreakTime = System.currentTimeMillis();
            }
        }
    }

    private boolean isInRange(BlockPos pos) {
        if (mc.player == null) return false;

        double distanceSq = mc.player.getDistanceSq(
                pos.getX() + 0.5,
                pos.getY() + 0.5,
                pos.getZ() + 0.5
        );

        return distanceSq <= MAX_RANGE_SQ;
    }

    private boolean isVisible(BlockPos pos) {
        if (mc.world == null || mc.player == null) return false;

        return true;
    }

    private boolean isLog(BlockPos pos) {
        if (mc.world == null) return false;

        BlockState state = mc.world.getBlockState(pos);
        return state.isIn(BlockTags.LOGS);
    }

    @Override
    public void onDisable() {
        targetPos = null;
        packetsSent = 0;
        super.onDisable();
    }
}

Вот еще код чтобы визуально блок после поломки оставался на стороне клиента


Visualization:
Expand Collapse Copy
package monoton.module.impl.misc;

import monoton.control.events.client.Event;
import monoton.control.events.packet.EventPacket;
import monoton.control.events.player.EventUpdate;
import monoton.module.TypeList;
import monoton.module.api.Annotation;
import monoton.module.api.Module;
import net.minecraft.block.BlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.network.play.client.CPlayerDiggingPacket;
import net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket;
import net.minecraft.network.play.server.SChangeBlockPacket;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

@Annotation(
name = "Visualization",
type = TypeList.Misc,
desc = "Визуализация блоков на клиенте"
)
public class Visualization extends Module {

private final Set<BlockPos> protectedBlocks = new HashSet<>();
private final Map<BlockPos, BlockState> preservedBlocks = new HashMap<>();
private final Map<BlockPos, Long> lastUpdateTime = new HashMap<>();

@Override
    public boolean onEvent(Event event) {
if (event instanceof EventPacket) {
            handlePacket((EventPacket) event);
 return false;
        }

if (event instanceof EventUpdate) {
            updateVisualization();
 return false;
        }

 return false;
    }

private void handlePacket(EventPacket event) {
if (mc.player == null || mc.world == null) return;

 if (event.isSend()) {
            handleSendPacket(event);
} else if (event.isReceive()) {
            handleReceivePacket(event);
        }
    }

private void handleSendPacket(EventPacket event) {
if (event.getPacket() instanceof CPlayerDiggingPacket) {
            CPlayerDiggingPacket packet = (CPlayerDiggingPacket) event.getPacket();
            BlockPos pos = packet.getPosition();

if (packet.getAction() == CPlayerDiggingPacket.Action.STOP_DESTROY_BLOCK) {
                handleBlockBreak(pos);
} else if (packet.getAction() == CPlayerDiggingPacket.Action.START_DESTROY_BLOCK) {
                handleStartBreaking(pos);
            }
} else if (event.getPacket() instanceof CPlayerTryUseItemOnBlockPacket) {
            CPlayerTryUseItemOnBlockPacket packet = (CPlayerTryUseItemOnBlockPacket) event.getPacket();
            BlockRayTraceResult hitResult = packet.func_218794_c();
            BlockPos placementPos = hitResult.getPos().offset(hitResult.getFace());

            Hand hand = packet.getHand();
if (hand != null && mc.player.getHeldItem(hand).getItem() instanceof net.minecraft.item.BlockItem) {
if (!protectedBlocks.contains(placementPos)) {
 protectedBlocks.add(placementPos);
 preservedBlocks.remove(placementPos);
 lastUpdateTime.remove(placementPos);
                }
            }
        }
    }

private void handleBlockBreak(BlockPos brokenPos) {
if (!preservedBlocks.containsKey(brokenPos)) {
BlockState currentState = mc.world.getBlockState(brokenPos);
if (currentState != null && !currentState.isAir()) {
 preservedBlocks.put(brokenPos, currentState);
lastUpdateTime.put(brokenPos, System.currentTimeMillis());

                Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
((ClientWorld) mc.world).setBlockState(brokenPos, currentState, 0);
                    }
                });
            }
        }
    }

private void handleStartBreaking(BlockPos breakingPos) {
BlockState state = mc.world.getBlockState(breakingPos);
if (state != null && !state.isAir()) {
float miningSpeed = mc.player.getDigSpeed(state);
float hardness = state.getBlockHardness(mc.world, breakingPos);

if (hardness >= 0 && miningSpeed / hardness >= 30) {
 preservedBlocks.put(breakingPos, state);
lastUpdateTime.put(breakingPos, System.currentTimeMillis());

                Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
((ClientWorld) mc.world).setBlockState(breakingPos, state, 0);
                    }
                });
            }
        }
    }

private void handleReceivePacket(EventPacket event) {
if (event.getPacket() instanceof SChangeBlockPacket) {
            SChangeBlockPacket packet = (SChangeBlockPacket) event.getPacket();
            BlockPos pos = packet.getPos();
            BlockState serverState = packet.getState();

if (serverState == null) return;

if (preservedBlocks.containsKey(pos)) {
                handlePreservedBlockUpdate(event, pos, serverState);
} else if (protectedBlocks.contains(pos)) {
                handleProtectedBlockUpdate(event, pos, serverState);
            }
        }
    }

private void handlePreservedBlockUpdate(EventPacket event, BlockPos pos, BlockState serverState) {
 if (serverState.isAir()) {
            event.cancel();
BlockState savedState = preservedBlocks.get(pos);
if (savedState != null && !savedState.isAir()) {
                Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
((ClientWorld) mc.world).setBlockState(pos, savedState, 0);
                    }
                });
            }
} else {
BlockState savedState = preservedBlocks.get(pos);
if (savedState != null && !serverState.equals(savedState)) {
                event.cancel();
 if (!savedState.isAir()) {
                    Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
((ClientWorld) mc.world).setBlockState(pos, savedState, 0);
                        }
                    });
                }
            }
        }
    }

private void handleProtectedBlockUpdate(EventPacket event, BlockPos pos, BlockState serverState) {
 if (serverState.isAir()) {
            event.cancel();
            Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
ClientWorld clientWorld = (ClientWorld) mc.world;
BlockState currentState = clientWorld.getBlockState(pos);
if (currentState != null && !currentState.isAir()) {
clientWorld.setBlockState(pos, currentState, 0);
                    }
                }
            });
} else if (!serverState.isAir()) {
            event.cancel();
            Minecraft.getInstance().execute(() -> {
if (mc.world != null && mc.world instanceof ClientWorld) {
ClientWorld clientWorld = (ClientWorld) mc.world;
BlockState currentState = clientWorld.getBlockState(pos);
if (currentState != null) {
clientWorld.setBlockState(pos, currentState, 0);
                    }
                }
            });
        }
    }

private void updateVisualization() {
if (mc.player == null || mc.world == null) return;
if (!(mc.world instanceof ClientWorld)) return;

ClientWorld clientWorld = (ClientWorld) mc.world;
long currentTime = System.currentTimeMillis();

        for (Map.Entry<BlockPos, BlockState> entry : preservedBlocks.entrySet()) {
            BlockPos pos = entry.getKey();
            BlockState savedState = entry.getValue();

if (pos == null || savedState == null) continue;

            BlockState currentClientState = clientWorld.getBlockState(pos);
if (currentClientState == null || !currentClientState.equals(savedState)) {
clientWorld.setBlockState(pos, savedState, 0);
if (currentClientState != null && !currentClientState.isAir()) {
 lastUpdateTime.put(pos, currentTime);
                }
            }

            for (Direction direction : Direction.values()) {
if (direction == null) continue;

                BlockPos neighborPos = pos.offset(direction);
if (preservedBlocks.containsKey(neighborPos)) {
BlockState neighborSavedState = preservedBlocks.get(neighborPos);
                    BlockState neighborCurrentState = clientWorld.getBlockState(neighborPos);
if (neighborCurrentState != null && neighborSavedState != null &&
                            !neighborCurrentState.equals(neighborSavedState)) {
clientWorld.setBlockState(neighborPos, neighborSavedState, 0);
                    }
                }
            }
        }

        Set<BlockPos> toRemove = new HashSet<>();
for (Map.Entry<BlockPos, Long> entry : lastUpdateTime.entrySet()) {
            BlockPos pos = entry.getKey();
            Long timestamp = entry.getValue();

if (pos == null || timestamp == null) continue;

if (currentTime - timestamp > 300000) { // 5 минут
                BlockState serverState = clientWorld.getBlockState(pos);
BlockState savedState = preservedBlocks.get(pos);

if (serverState == null || serverState.isAir() ||
(savedState != null && !serverState.equals(savedState))) {
                    toRemove.add(pos);
                }
            }
        }

 for (BlockPos pos : toRemove) {
if (pos != null) {
 preservedBlocks.remove(pos);
 lastUpdateTime.remove(pos);
            }
        }
    }

@Override
    public void onEnable() {
 protectedBlocks.clear();
 preservedBlocks.clear();
 lastUpdateTime.clear();
 super.onEnable();
    }

@Override
    public void onDisable() {
 super.onDisable();

 protectedBlocks.clear();

        Minecraft.getInstance().execute(() -> {
if (mc.world instanceof ClientWorld) {
ClientWorld clientWorld = (ClientWorld) mc.world;
for (BlockPos pos : preservedBlocks.keySet()) {
if (pos != null) {
clientWorld.setBlockState(pos, net.minecraft.block.Blocks.AIR.getDefaultState(), 0);
                    }
                }
            }
        });

 preservedBlocks.clear();
 lastUpdateTime.clear();
    }
}

upd visualization нормальный закинул, прошлый крашал.
так на видео ты ничего не делаешь
 
Ну а я хз как сделать его быстрее, ты же с фастом, а я дефом
так еще на 1.21.4 перенёс
да там разницы нет
у меня фабрик (т.е yarn) и 1.21.11
там смотри во первых над сделать фукнцию которая будет блок не удалять для клиента (для дерева которое не ломается)
потом юзать ту фукнцию которую я скинул просто вызывать ее вечно, у меня стоит на 35 в секунду
 
Последнее редактирование:
Назад
Сверху Снизу