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

Часть функционала TriggerBot Relake 1.21.10

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
6 Июл 2024
Сообщения
200
Реакции
8
Выберите загрузчик игры
  1. Fabric
Простой TriggerBot под Relake 1.21.10
TriggerBot:
Expand Collapse Copy
package idk.relake.modules.impl;

import idk.relake.modules.Module;
import idk.relake.ui.settings.impl.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.mob.Monster;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

public final class TriggerBot extends Module {

    private final MinecraftClient mc = MinecraftClient.getInstance();

    private Checkbox enabled;
    private Slider range;
    private Slider minCPS;
    private Slider maxCPS;
    private Slider hitChance;
    private MultiSelectBox targets;
    private Checkbox weaponOnly;
    private Checkbox smartDelay;
    private SelectBox hitboxMode;
    private Checkbox onlyInJump;
    private Checkbox onlyCrits;

    private long lastAttackTime = 0;
    private long currentDelay = 0;

    public TriggerBot() {
        super("Combat", "TriggerBot");
    }

    @Override
    public void onSetup() {
        this.enabled = new Checkbox("TriggerBot", "легит ансофт ебашить да да ").setEnabled(false);

        this.range = new Slider("Радиус", "Радиус атаки")
                .setRange(3.0f, 6.0f).setStep(0.1f).setCurrent(3.0f);

        this.minCPS = new Slider("Минимум КПС", "Минимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(8);

        this.maxCPS = new Slider("Максимум КПС", "Максимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(12);

        this.hitChance = new Slider("Шанс Ударить", "Шанс ударить (%)")
                .setRange(0, 100).setStep(1).setCurrent(100);

        this.targets = new MultiSelectBox("Таргеты", "Выберить что ебашить")
                .addModes(
                        new MultiSelectBox.Mode("Players", true),
                        new MultiSelectBox.Mode("Invisible Players", true),
                        new MultiSelectBox.Mode("Naked Players", true),
                        new MultiSelectBox.Mode("Hostile Mobs", false),
                        new MultiSelectBox.Mode("Passive Mobs", false)
                );

        this.weaponOnly = new Checkbox("Только Оружие", "").setEnabled(false);
        this.smartDelay = new Checkbox("Умная Задержка", "").setEnabled(true);

        this.onlyInJump = new Checkbox("Только в прыжке", "").setEnabled(false);
        this.onlyCrits = new Checkbox("Только Криты", "").setEnabled(false);

        this.hitboxMode = new SelectBox("Hitbox", "Hitbox check mode")
                .addModes("Crosshair", "Range")
                .setCurrentMode("Crosshair");

        Checkbox advancedSettings = new Checkbox("Advanced", "Advanced settings").setEnabled(true)
                .addSubSettings(
                        this.weaponOnly,
                        this.smartDelay,
                        this.onlyInJump,
                        this.onlyCrits,
                        this.hitboxMode
                );

        this.register(
                this.enabled,
                this.range,
                this.minCPS,
                this.maxCPS,
                this.hitChance,
                this.targets,
                advancedSettings
        );
    }

    @Override
    public void onTick() {
        if (!this.enabled.isEnabled()) return;
        if (mc.player == null || mc.world == null) return;
        if (mc.currentScreen != null) return;

        if (this.weaponOnly.isEnabled() && !isWeapon(mc.player.getMainHandStack())) return;

        if (this.onlyInJump.isEnabled() && mc.player.isOnGround()) return;
        if (this.onlyCrits.isEnabled() && !canCrit()) return;

        Entity target = getTarget();
        if (target == null) return;

        if (shouldAttack()) {
            attack(target);
        }
    }

    private boolean canCrit() {
        if (mc.player == null) return false;
        if (mc.player.getVelocity().y >= 0) return false;
        if (mc.player.isOnGround()) return false;
        if (mc.player.isTouchingWater()) return false;
        if (mc.player.isInLava()) return false;
        if (mc.player.isClimbing()) return false;
        if (mc.player.hasBlindnessEffect()) return false;
        if (mc.player.hasVehicle()) return false;
        if (mc.player.isFlyingVehicle()) return false;
        return true;
    }
    private boolean isWeapon(ItemStack stack) {
        if (stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0) return false;
        if (stack.getMaxDamage() > 0) return true;
        String id = stack.getItem().toString().toLowerCase();
        return id.contains("sword") || id.contains("axe") || id.contains("mace") || id.contains("trident");
    }

    private Entity getTarget() {
        if (this.hitboxMode.getCurrentMode().equals("Crosshair")) {
            return getCrosshairTarget();
        } else {
            return getRangeTarget();
        }
    }

    private Entity getCrosshairTarget() {
        if (mc.crosshairTarget == null) return null;
        if (mc.crosshairTarget.getType() != HitResult.Type.ENTITY) return null;

        Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity();
        if (!isValidTarget(entity)) return null;

        double maxRange = this.range.getCurrent();
        if (mc.player.squaredDistanceTo(entity) > maxRange * maxRange) return null;

        return entity;
    }

    private Entity getRangeTarget() {
        Entity closest = null;
        double closestDist = Double.MAX_VALUE;
        double maxRange = this.range.getCurrent();

        for (Entity entity : mc.world.getEntities()) {
            if (!isValidTarget(entity)) continue;

            double dist = mc.player.squaredDistanceTo(entity);
            if (dist > maxRange * maxRange) continue;

            if (dist < closestDist) {
                closest = entity;
                closestDist = dist;
            }
        }

        return closest;
    }

    private boolean isValidTarget(Entity entity) {
        if (entity == null) return false;
        if (entity == mc.player) return false;
        if (!(entity instanceof LivingEntity living)) return false;
        if (!living.isAlive()) return false;
        if (living.getHealth() <= 0) return false;

        if (entity instanceof PlayerEntity player) {
            if (!this.targets.isEnabled("Players")) return false;
            if (player.isInvisible() && !this.targets.isEnabled("Invisible Players")) return false;
            if (isNaked(player) && !this.targets.isEnabled("Naked Players")) return false;
            return true;
        }

        if (entity instanceof Monster || entity instanceof HostileEntity) {
            return this.targets.isEnabled("Hostile Mobs");
        }

        if (entity instanceof PassiveEntity) {
            return this.targets.isEnabled("Passive Mobs");
        }

        return false;
    }

    private boolean isNaked(PlayerEntity player) {
        return isStackEmpty(player.getEquippedStack(EquipmentSlot.HEAD))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.CHEST))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.LEGS))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.FEET));
    }

    private boolean isStackEmpty(ItemStack stack) {
        return stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0;
    }
    private boolean shouldAttack() {
        long now = System.currentTimeMillis();

        if (this.smartDelay.isEnabled()) {
            return mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
        }

        if (now - lastAttackTime < currentDelay) return false;

        if (this.hitChance.getCurrent() < 100) {
            if (Math.random() * 100 > this.hitChance.getCurrent()) {
                recalculateDelay();
                lastAttackTime = now;
                return false;
            }
        }

        return true;
    }

    private void recalculateDelay() {
        float min = this.minCPS.getCurrent();
        float max = this.maxCPS.getCurrent();
        if (min > max) { float t = min; min = max; max = t; }
        float cps = min + (float) Math.random() * (max - min);
        if (cps <= 0) cps = 1;
        this.currentDelay = (long) (1000.0f / cps);
    }
    private void attack(Entity target) {
        if (mc.interactionManager == null) return;

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);

        lastAttackTime = System.currentTimeMillis();
        recalculateDelay();
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Ужас... Только в прыжке - if (this.onlyInJump.isEnabled() && mc.player.isOnGround()) return; , а потом только криты - private boolean canCrit() {
if (mc.player == null) return false;
if (mc.player.getVelocity().y >= 0) return false;
if (mc.player.isOnGround()) return false;

черт меня побери...
 
Простой TriggerBot под Relake 1.21.10
TriggerBot:
Expand Collapse Copy
package idk.relake.modules.impl;

import idk.relake.modules.Module;
import idk.relake.ui.settings.impl.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.mob.Monster;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

public final class TriggerBot extends Module {

    private final MinecraftClient mc = MinecraftClient.getInstance();

    private Checkbox enabled;
    private Slider range;
    private Slider minCPS;
    private Slider maxCPS;
    private Slider hitChance;
    private MultiSelectBox targets;
    private Checkbox weaponOnly;
    private Checkbox smartDelay;
    private SelectBox hitboxMode;
    private Checkbox onlyInJump;
    private Checkbox onlyCrits;

    private long lastAttackTime = 0;
    private long currentDelay = 0;

    public TriggerBot() {
        super("Combat", "TriggerBot");
    }

    @Override
    public void onSetup() {
        this.enabled = new Checkbox("TriggerBot", "легит ансофт ебашить да да ").setEnabled(false);

        this.range = new Slider("Радиус", "Радиус атаки")
                .setRange(3.0f, 6.0f).setStep(0.1f).setCurrent(3.0f);

        this.minCPS = new Slider("Минимум КПС", "Минимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(8);

        this.maxCPS = new Slider("Максимум КПС", "Максимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(12);

        this.hitChance = new Slider("Шанс Ударить", "Шанс ударить (%)")
                .setRange(0, 100).setStep(1).setCurrent(100);

        this.targets = new MultiSelectBox("Таргеты", "Выберить что ебашить")
                .addModes(
                        new MultiSelectBox.Mode("Players", true),
                        new MultiSelectBox.Mode("Invisible Players", true),
                        new MultiSelectBox.Mode("Naked Players", true),
                        new MultiSelectBox.Mode("Hostile Mobs", false),
                        new MultiSelectBox.Mode("Passive Mobs", false)
                );

        this.weaponOnly = new Checkbox("Только Оружие", "").setEnabled(false);
        this.smartDelay = new Checkbox("Умная Задержка", "").setEnabled(true);

        this.onlyInJump = new Checkbox("Только в прыжке", "").setEnabled(false);
        this.onlyCrits = new Checkbox("Только Криты", "").setEnabled(false);

        this.hitboxMode = new SelectBox("Hitbox", "Hitbox check mode")
                .addModes("Crosshair", "Range")
                .setCurrentMode("Crosshair");

        Checkbox advancedSettings = new Checkbox("Advanced", "Advanced settings").setEnabled(true)
                .addSubSettings(
                        this.weaponOnly,
                        this.smartDelay,
                        this.onlyInJump,
                        this.onlyCrits,
                        this.hitboxMode
                );

        this.register(
                this.enabled,
                this.range,
                this.minCPS,
                this.maxCPS,
                this.hitChance,
                this.targets,
                advancedSettings
        );
    }

    @Override
    public void onTick() {
        if (!this.enabled.isEnabled()) return;
        if (mc.player == null || mc.world == null) return;
        if (mc.currentScreen != null) return;

        if (this.weaponOnly.isEnabled() && !isWeapon(mc.player.getMainHandStack())) return;

        if (this.onlyInJump.isEnabled() && mc.player.isOnGround()) return;
        if (this.onlyCrits.isEnabled() && !canCrit()) return;

        Entity target = getTarget();
        if (target == null) return;

        if (shouldAttack()) {
            attack(target);
        }
    }

    private boolean canCrit() {
        if (mc.player == null) return false;
        if (mc.player.getVelocity().y >= 0) return false;
        if (mc.player.isOnGround()) return false;
        if (mc.player.isTouchingWater()) return false;
        if (mc.player.isInLava()) return false;
        if (mc.player.isClimbing()) return false;
        if (mc.player.hasBlindnessEffect()) return false;
        if (mc.player.hasVehicle()) return false;
        if (mc.player.isFlyingVehicle()) return false;
        return true;
    }
    private boolean isWeapon(ItemStack stack) {
        if (stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0) return false;
        if (stack.getMaxDamage() > 0) return true;
        String id = stack.getItem().toString().toLowerCase();
        return id.contains("sword") || id.contains("axe") || id.contains("mace") || id.contains("trident");
    }

    private Entity getTarget() {
        if (this.hitboxMode.getCurrentMode().equals("Crosshair")) {
            return getCrosshairTarget();
        } else {
            return getRangeTarget();
        }
    }

    private Entity getCrosshairTarget() {
        if (mc.crosshairTarget == null) return null;
        if (mc.crosshairTarget.getType() != HitResult.Type.ENTITY) return null;

        Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity();
        if (!isValidTarget(entity)) return null;

        double maxRange = this.range.getCurrent();
        if (mc.player.squaredDistanceTo(entity) > maxRange * maxRange) return null;

        return entity;
    }

    private Entity getRangeTarget() {
        Entity closest = null;
        double closestDist = Double.MAX_VALUE;
        double maxRange = this.range.getCurrent();

        for (Entity entity : mc.world.getEntities()) {
            if (!isValidTarget(entity)) continue;

            double dist = mc.player.squaredDistanceTo(entity);
            if (dist > maxRange * maxRange) continue;

            if (dist < closestDist) {
                closest = entity;
                closestDist = dist;
            }
        }

        return closest;
    }

    private boolean isValidTarget(Entity entity) {
        if (entity == null) return false;
        if (entity == mc.player) return false;
        if (!(entity instanceof LivingEntity living)) return false;
        if (!living.isAlive()) return false;
        if (living.getHealth() <= 0) return false;

        if (entity instanceof PlayerEntity player) {
            if (!this.targets.isEnabled("Players")) return false;
            if (player.isInvisible() && !this.targets.isEnabled("Invisible Players")) return false;
            if (isNaked(player) && !this.targets.isEnabled("Naked Players")) return false;
            return true;
        }

        if (entity instanceof Monster || entity instanceof HostileEntity) {
            return this.targets.isEnabled("Hostile Mobs");
        }

        if (entity instanceof PassiveEntity) {
            return this.targets.isEnabled("Passive Mobs");
        }

        return false;
    }

    private boolean isNaked(PlayerEntity player) {
        return isStackEmpty(player.getEquippedStack(EquipmentSlot.HEAD))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.CHEST))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.LEGS))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.FEET));
    }

    private boolean isStackEmpty(ItemStack stack) {
        return stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0;
    }
    private boolean shouldAttack() {
        long now = System.currentTimeMillis();

        if (this.smartDelay.isEnabled()) {
            return mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
        }

        if (now - lastAttackTime < currentDelay) return false;

        if (this.hitChance.getCurrent() < 100) {
            if (Math.random() * 100 > this.hitChance.getCurrent()) {
                recalculateDelay();
                lastAttackTime = now;
                return false;
            }
        }

        return true;
    }

    private void recalculateDelay() {
        float min = this.minCPS.getCurrent();
        float max = this.maxCPS.getCurrent();
        if (min > max) { float t = min; min = max; max = t; }
        float cps = min + (float) Math.random() * (max - min);
        if (cps <= 0) cps = 1;
        this.currentDelay = (long) (1000.0f / cps);
    }
    private void attack(Entity target) {
        if (mc.interactionManager == null) return;

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);

        lastAttackTime = System.currentTimeMillis();
        recalculateDelay();
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
вопрос нахуя кпс шанс ударить и радиус выбор моба игрока и тд достаточно
 
Простой TriggerBot под Relake 1.21.10
TriggerBot:
Expand Collapse Copy
package idk.relake.modules.impl;

import idk.relake.modules.Module;
import idk.relake.ui.settings.impl.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.mob.Monster;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

public final class TriggerBot extends Module {

    private final MinecraftClient mc = MinecraftClient.getInstance();

    private Checkbox enabled;
    private Slider range;
    private Slider minCPS;
    private Slider maxCPS;
    private Slider hitChance;
    private MultiSelectBox targets;
    private Checkbox weaponOnly;
    private Checkbox smartDelay;
    private SelectBox hitboxMode;
    private Checkbox onlyInJump;
    private Checkbox onlyCrits;

    private long lastAttackTime = 0;
    private long currentDelay = 0;

    public TriggerBot() {
        super("Combat", "TriggerBot");
    }

    @Override
    public void onSetup() {
        this.enabled = new Checkbox("TriggerBot", "легит ансофт ебашить да да ").setEnabled(false);

        this.range = new Slider("Радиус", "Радиус атаки")
                .setRange(3.0f, 6.0f).setStep(0.1f).setCurrent(3.0f);

        this.minCPS = new Slider("Минимум КПС", "Минимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(8);

        this.maxCPS = new Slider("Максимум КПС", "Максимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(12);

        this.hitChance = new Slider("Шанс Ударить", "Шанс ударить (%)")
                .setRange(0, 100).setStep(1).setCurrent(100);

        this.targets = new MultiSelectBox("Таргеты", "Выберить что ебашить")
                .addModes(
                        new MultiSelectBox.Mode("Players", true),
                        new MultiSelectBox.Mode("Invisible Players", true),
                        new MultiSelectBox.Mode("Naked Players", true),
                        new MultiSelectBox.Mode("Hostile Mobs", false),
                        new MultiSelectBox.Mode("Passive Mobs", false)
                );

        this.weaponOnly = new Checkbox("Только Оружие", "").setEnabled(false);
        this.smartDelay = new Checkbox("Умная Задержка", "").setEnabled(true);

        this.onlyInJump = new Checkbox("Только в прыжке", "").setEnabled(false);
        this.onlyCrits = new Checkbox("Только Криты", "").setEnabled(false);

        this.hitboxMode = new SelectBox("Hitbox", "Hitbox check mode")
                .addModes("Crosshair", "Range")
                .setCurrentMode("Crosshair");

        Checkbox advancedSettings = new Checkbox("Advanced", "Advanced settings").setEnabled(true)
                .addSubSettings(
                        this.weaponOnly,
                        this.smartDelay,
                        this.onlyInJump,
                        this.onlyCrits,
                        this.hitboxMode
                );

        this.register(
                this.enabled,
                this.range,
                this.minCPS,
                this.maxCPS,
                this.hitChance,
                this.targets,
                advancedSettings
        );
    }

    @Override
    public void onTick() {
        if (!this.enabled.isEnabled()) return;
        if (mc.player == null || mc.world == null) return;
        if (mc.currentScreen != null) return;

        if (this.weaponOnly.isEnabled() && !isWeapon(mc.player.getMainHandStack())) return;

        if (this.onlyInJump.isEnabled() && mc.player.isOnGround()) return;
        if (this.onlyCrits.isEnabled() && !canCrit()) return;

        Entity target = getTarget();
        if (target == null) return;

        if (shouldAttack()) {
            attack(target);
        }
    }

    private boolean canCrit() {
        if (mc.player == null) return false;
        if (mc.player.getVelocity().y >= 0) return false;
        if (mc.player.isOnGround()) return false;
        if (mc.player.isTouchingWater()) return false;
        if (mc.player.isInLava()) return false;
        if (mc.player.isClimbing()) return false;
        if (mc.player.hasBlindnessEffect()) return false;
        if (mc.player.hasVehicle()) return false;
        if (mc.player.isFlyingVehicle()) return false;
        return true;
    }
    private boolean isWeapon(ItemStack stack) {
        if (stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0) return false;
        if (stack.getMaxDamage() > 0) return true;
        String id = stack.getItem().toString().toLowerCase();
        return id.contains("sword") || id.contains("axe") || id.contains("mace") || id.contains("trident");
    }

    private Entity getTarget() {
        if (this.hitboxMode.getCurrentMode().equals("Crosshair")) {
            return getCrosshairTarget();
        } else {
            return getRangeTarget();
        }
    }

    private Entity getCrosshairTarget() {
        if (mc.crosshairTarget == null) return null;
        if (mc.crosshairTarget.getType() != HitResult.Type.ENTITY) return null;

        Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity();
        if (!isValidTarget(entity)) return null;

        double maxRange = this.range.getCurrent();
        if (mc.player.squaredDistanceTo(entity) > maxRange * maxRange) return null;

        return entity;
    }

    private Entity getRangeTarget() {
        Entity closest = null;
        double closestDist = Double.MAX_VALUE;
        double maxRange = this.range.getCurrent();

        for (Entity entity : mc.world.getEntities()) {
            if (!isValidTarget(entity)) continue;

            double dist = mc.player.squaredDistanceTo(entity);
            if (dist > maxRange * maxRange) continue;

            if (dist < closestDist) {
                closest = entity;
                closestDist = dist;
            }
        }

        return closest;
    }

    private boolean isValidTarget(Entity entity) {
        if (entity == null) return false;
        if (entity == mc.player) return false;
        if (!(entity instanceof LivingEntity living)) return false;
        if (!living.isAlive()) return false;
        if (living.getHealth() <= 0) return false;

        if (entity instanceof PlayerEntity player) {
            if (!this.targets.isEnabled("Players")) return false;
            if (player.isInvisible() && !this.targets.isEnabled("Invisible Players")) return false;
            if (isNaked(player) && !this.targets.isEnabled("Naked Players")) return false;
            return true;
        }

        if (entity instanceof Monster || entity instanceof HostileEntity) {
            return this.targets.isEnabled("Hostile Mobs");
        }

        if (entity instanceof PassiveEntity) {
            return this.targets.isEnabled("Passive Mobs");
        }

        return false;
    }

    private boolean isNaked(PlayerEntity player) {
        return isStackEmpty(player.getEquippedStack(EquipmentSlot.HEAD))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.CHEST))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.LEGS))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.FEET));
    }

    private boolean isStackEmpty(ItemStack stack) {
        return stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0;
    }
    private boolean shouldAttack() {
        long now = System.currentTimeMillis();

        if (this.smartDelay.isEnabled()) {
            return mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
        }

        if (now - lastAttackTime < currentDelay) return false;

        if (this.hitChance.getCurrent() < 100) {
            if (Math.random() * 100 > this.hitChance.getCurrent()) {
                recalculateDelay();
                lastAttackTime = now;
                return false;
            }
        }

        return true;
    }

    private void recalculateDelay() {
        float min = this.minCPS.getCurrent();
        float max = this.maxCPS.getCurrent();
        if (min > max) { float t = min; min = max; max = t; }
        float cps = min + (float) Math.random() * (max - min);
        if (cps <= 0) cps = 1;
        this.currentDelay = (long) (1000.0f / cps);
    }
    private void attack(Entity target) {
        if (mc.interactionManager == null) return;

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);

        lastAttackTime = System.currentTimeMillis();
        recalculateDelay();
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
Первая половина кода - сеттинги(нахуя их тут так много, и какой нахуй кпс в тригер боте), вторая половина - говнокод, ну это блять просто пиздец. Каких 247 строк, тригер делается строк в 80 максимум, /del
 
Первая половина кода - сеттинги(нахуя их тут так много, и какой нахуй кпс в тригер боте), вторая половина - говнокод, ну это блять просто пиздец. Каких 247 строк, тригер делается строк в 80 максимум, /del
Так это ИИшка банально взять то что половина сеттингов на ру а остальное на англ к примеру выбор таргетов на англ какого то хуя
 
Простой TriggerBot под Relake 1.21.10
TriggerBot:
Expand Collapse Copy
package idk.relake.modules.impl;

import idk.relake.modules.Module;
import idk.relake.ui.settings.impl.*;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.HostileEntity;
import net.minecraft.entity.mob.Monster;
import net.minecraft.entity.passive.PassiveEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;

public final class TriggerBot extends Module {

    private final MinecraftClient mc = MinecraftClient.getInstance();

    private Checkbox enabled;
    private Slider range;
    private Slider minCPS;
    private Slider maxCPS;
    private Slider hitChance;
    private MultiSelectBox targets;
    private Checkbox weaponOnly;
    private Checkbox smartDelay;
    private SelectBox hitboxMode;
    private Checkbox onlyInJump;
    private Checkbox onlyCrits;

    private long lastAttackTime = 0;
    private long currentDelay = 0;

    public TriggerBot() {
        super("Combat", "TriggerBot");
    }

    @Override
    public void onSetup() {
        this.enabled = new Checkbox("TriggerBot", "легит ансофт ебашить да да ").setEnabled(false);

        this.range = new Slider("Радиус", "Радиус атаки")
                .setRange(3.0f, 6.0f).setStep(0.1f).setCurrent(3.0f);

        this.minCPS = new Slider("Минимум КПС", "Минимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(8);

        this.maxCPS = new Slider("Максимум КПС", "Максимум Кликов в секунду")
                .setRange(1, 20).setStep(1).setCurrent(12);

        this.hitChance = new Slider("Шанс Ударить", "Шанс ударить (%)")
                .setRange(0, 100).setStep(1).setCurrent(100);

        this.targets = new MultiSelectBox("Таргеты", "Выберить что ебашить")
                .addModes(
                        new MultiSelectBox.Mode("Players", true),
                        new MultiSelectBox.Mode("Invisible Players", true),
                        new MultiSelectBox.Mode("Naked Players", true),
                        new MultiSelectBox.Mode("Hostile Mobs", false),
                        new MultiSelectBox.Mode("Passive Mobs", false)
                );

        this.weaponOnly = new Checkbox("Только Оружие", "").setEnabled(false);
        this.smartDelay = new Checkbox("Умная Задержка", "").setEnabled(true);

        this.onlyInJump = new Checkbox("Только в прыжке", "").setEnabled(false);
        this.onlyCrits = new Checkbox("Только Криты", "").setEnabled(false);

        this.hitboxMode = new SelectBox("Hitbox", "Hitbox check mode")
                .addModes("Crosshair", "Range")
                .setCurrentMode("Crosshair");

        Checkbox advancedSettings = new Checkbox("Advanced", "Advanced settings").setEnabled(true)
                .addSubSettings(
                        this.weaponOnly,
                        this.smartDelay,
                        this.onlyInJump,
                        this.onlyCrits,
                        this.hitboxMode
                );

        this.register(
                this.enabled,
                this.range,
                this.minCPS,
                this.maxCPS,
                this.hitChance,
                this.targets,
                advancedSettings
        );
    }

    @Override
    public void onTick() {
        if (!this.enabled.isEnabled()) return;
        if (mc.player == null || mc.world == null) return;
        if (mc.currentScreen != null) return;

        if (this.weaponOnly.isEnabled() && !isWeapon(mc.player.getMainHandStack())) return;

        if (this.onlyInJump.isEnabled() && mc.player.isOnGround()) return;
        if (this.onlyCrits.isEnabled() && !canCrit()) return;

        Entity target = getTarget();
        if (target == null) return;

        if (shouldAttack()) {
            attack(target);
        }
    }

    private boolean canCrit() {
        if (mc.player == null) return false;
        if (mc.player.getVelocity().y >= 0) return false;
        if (mc.player.isOnGround()) return false;
        if (mc.player.isTouchingWater()) return false;
        if (mc.player.isInLava()) return false;
        if (mc.player.isClimbing()) return false;
        if (mc.player.hasBlindnessEffect()) return false;
        if (mc.player.hasVehicle()) return false;
        if (mc.player.isFlyingVehicle()) return false;
        return true;
    }
    private boolean isWeapon(ItemStack stack) {
        if (stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0) return false;
        if (stack.getMaxDamage() > 0) return true;
        String id = stack.getItem().toString().toLowerCase();
        return id.contains("sword") || id.contains("axe") || id.contains("mace") || id.contains("trident");
    }

    private Entity getTarget() {
        if (this.hitboxMode.getCurrentMode().equals("Crosshair")) {
            return getCrosshairTarget();
        } else {
            return getRangeTarget();
        }
    }

    private Entity getCrosshairTarget() {
        if (mc.crosshairTarget == null) return null;
        if (mc.crosshairTarget.getType() != HitResult.Type.ENTITY) return null;

        Entity entity = ((EntityHitResult) mc.crosshairTarget).getEntity();
        if (!isValidTarget(entity)) return null;

        double maxRange = this.range.getCurrent();
        if (mc.player.squaredDistanceTo(entity) > maxRange * maxRange) return null;

        return entity;
    }

    private Entity getRangeTarget() {
        Entity closest = null;
        double closestDist = Double.MAX_VALUE;
        double maxRange = this.range.getCurrent();

        for (Entity entity : mc.world.getEntities()) {
            if (!isValidTarget(entity)) continue;

            double dist = mc.player.squaredDistanceTo(entity);
            if (dist > maxRange * maxRange) continue;

            if (dist < closestDist) {
                closest = entity;
                closestDist = dist;
            }
        }

        return closest;
    }

    private boolean isValidTarget(Entity entity) {
        if (entity == null) return false;
        if (entity == mc.player) return false;
        if (!(entity instanceof LivingEntity living)) return false;
        if (!living.isAlive()) return false;
        if (living.getHealth() <= 0) return false;

        if (entity instanceof PlayerEntity player) {
            if (!this.targets.isEnabled("Players")) return false;
            if (player.isInvisible() && !this.targets.isEnabled("Invisible Players")) return false;
            if (isNaked(player) && !this.targets.isEnabled("Naked Players")) return false;
            return true;
        }

        if (entity instanceof Monster || entity instanceof HostileEntity) {
            return this.targets.isEnabled("Hostile Mobs");
        }

        if (entity instanceof PassiveEntity) {
            return this.targets.isEnabled("Passive Mobs");
        }

        return false;
    }

    private boolean isNaked(PlayerEntity player) {
        return isStackEmpty(player.getEquippedStack(EquipmentSlot.HEAD))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.CHEST))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.LEGS))
                && isStackEmpty(player.getEquippedStack(EquipmentSlot.FEET));
    }

    private boolean isStackEmpty(ItemStack stack) {
        return stack == null || stack == ItemStack.EMPTY || stack.getCount() <= 0;
    }
    private boolean shouldAttack() {
        long now = System.currentTimeMillis();

        if (this.smartDelay.isEnabled()) {
            return mc.player.getAttackCooldownProgress(0.0f) >= 1.0f;
        }

        if (now - lastAttackTime < currentDelay) return false;

        if (this.hitChance.getCurrent() < 100) {
            if (Math.random() * 100 > this.hitChance.getCurrent()) {
                recalculateDelay();
                lastAttackTime = now;
                return false;
            }
        }

        return true;
    }

    private void recalculateDelay() {
        float min = this.minCPS.getCurrent();
        float max = this.maxCPS.getCurrent();
        if (min > max) { float t = min; min = max; max = t; }
        float cps = min + (float) Math.random() * (max - min);
        if (cps <= 0) cps = 1;
        this.currentDelay = (long) (1000.0f / cps);
    }
    private void attack(Entity target) {
        if (mc.interactionManager == null) return;

        mc.interactionManager.attackEntity(mc.player, target);
        mc.player.swingHand(Hand.MAIN_HAND);

        lastAttackTime = System.currentTimeMillis();
        recalculateDelay();
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
фуу релейк 1.21.10 калл!
 
Назад
Сверху Снизу