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

Часть функционала AutoSell FT SP mb RW mcp litka.beta

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
17 Июл 2024
Сообщения
258
Реакции
3
Выберите загрузчик игры
  1. Vanilla
  2. Прочие моды
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
    
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
        
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
            
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
 
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
спс, спащю в литку
 
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
нахуя людям макросы,хуета /del
 
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
бесполезно лучшее бы сделал так чтобы писало /ah search смотрел более выгодную и цену и уже продавало
 
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
Прикольно +rep но я ушел в ансофт!!
 
Корм, прикрутил туда парсер и к авто фишу подключил, в целом удобно :summyrose:

1772822226907.png
1772822228603.png
 
блин хотел такое добавить но не получаеться(
У рича с 1.21.11 можно взять парсер и прикрутить его к командам. к примеру .autosell parse 90(это процент от найденного минимума) После этого он сам спарсит цены и выставит их :0
 
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
и зачем слиать людям гпт код, я не пойму?
 
Последнее редактирование:
видел эту функцию в кряке дельты ну сделал вроде нормальная 1 минус не берет с инвентаря работает на всех блоках предметах надо просто найти название по типу diamond_pickaxe можно настроить скорость и включить логи ну это спасибо чату лгбт что добавил это ещё он сам выключаеться если нету места на ах
Пожалуйста, авторизуйтесь для просмотра ссылки.

Код:
Expand Collapse Copy
package client.main.module.impl.misc;

import client.main.module.api.Category;
import client.main.module.api.Module;
import client.main.module.api.ModuleRegister;
import client.main.module.settings.impl.StringSetting;
import client.main.module.settings.impl.BooleanSetting;
import client.main.other.litkautil.StopWatch;
import client.events.EventPacket;
import com.google.common.eventbus.Subscribe;
import net.minecraft.network.play.server.SChatPacket;
import net.minecraft.item.ItemStack;

@ModuleRegister(name = "AutoSell", type = Category.Misc, desc = "Автоматически продает указанный предмет")
public class AutoSell extends Module {

    private final StringSetting itemName = new StringSetting("Предмет", "", "Часть названия для поиска");
    private final StringSetting price = new StringSetting("Цена", "", "Цена в монетах");
    private final BooleanSetting logChat = new BooleanSetting("Логи в чат", false);
    private final client.main.module.settings.impl.SliderSetting sellDelay =
            new client.main.module.settings.impl.SliderSetting("Задержка продаж (ms)", 1000f, 200f, 5000f, 100f);
   
    private String lastSoldKey = "";
    private int scanIndex = 0;
    private final StopWatch sellTimer = new StopWatch();

    public AutoSell() {
        addSettings(itemName, price, logChat, sellDelay);
    }

    @Override
    public boolean onEnable() {
        super.onEnable();
        lastSoldKey = "";
        scanIndex = 0;
        if (mc.player == null) {
            return false;
        }
        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty()) {
            print("Укажите название предмета");
        }
        if (pr.isEmpty()) {
            print("Укажите цену");
        }
        sellTimer.reset();
        return false;
    }

    @Subscribe
    private void onUpdate(client.events.EventUpdate e) {
        if (mc.player == null) return;

        String itemQuery = itemName.get().trim().toLowerCase();
        String pr = price.get().trim();
        if (itemQuery.isEmpty() || pr.isEmpty()) {
            return;
        }
        ItemStack held = mc.player.getHeldItemMainhand();
        if (held == null || held.isEmpty()) {
            lastSoldKey = "";
        }
       
        if (held != null && !held.isEmpty()) {
            String heldKey = held.getItem().getTranslationKey().toLowerCase();
            if ((heldKey.contains(itemQuery) || held.getItem().toString().toLowerCase().contains(itemQuery))
                    && !heldKey.equals(lastSoldKey)) {
                mc.player.sendChatMessage("/ah sell " + pr);
                lastSoldKey = heldKey;
                if (logChat.get()) {
                    print("Предмет " + heldKey + " выставлен за " + pr + " (в руке)");
                }
                sellTimer.reset();
                return;
            }
        }

        if (!sellTimer.isReached((long) sellDelay.get().intValue())) {
            return;
        }
        sellTimer.reset();

        int total = mc.player.inventory.mainInventory.size();
        int found = -1;
        String foundKey = null;
        for (int i = 0; i < total; i++) {
            int idx = (scanIndex + i) % total;
            ItemStack s = mc.player.inventory.mainInventory.get(idx);
            if (s == null || s.isEmpty()) continue;
            String key = s.getItem().getTranslationKey().toLowerCase();
            if (key.contains(itemQuery) || s.getItem().toString().toLowerCase().contains(itemQuery)) {
                found = idx;
                foundKey = key;
                break;
            }
        }
        if (found != -1 && foundKey != null) {
            ItemStack heldNow = mc.player.getHeldItemMainhand();
            if (heldNow != null && !heldNow.isEmpty()) {
                String heldKey = heldNow.getItem().getTranslationKey().toLowerCase();
                if (heldKey.equals(lastSoldKey) && heldKey.equals(foundKey)) {
                    scanIndex = (found + 1) % total;
                    return;
                }
            }
           
            if (found < 9) {
                mc.player.inventory.currentItem = found;
                if (logChat.get()) print("Переключаюсь на слот " + found + " (хотбар)");
            } else {
                client.util.player.InventoryUtil.moveItem(found, 0, true);
                mc.player.inventory.currentItem = 0;
                if (logChat.get()) print("Перемещаю предмет из слота " + found + " в хотбар");
            }
            scanIndex = (found + 1) % total;
            return;
        }
        scanIndex = (scanIndex + total) % total;
    }

    @Override
    public boolean onDisable() {
        lastSoldKey = "";
        scanIndex = 0;
        return super.onDisable();
    }

    @Subscribe
    public void onPacket(EventPacket e) {
        if (!e.isReceive() || !(e.getPacket() instanceof SChatPacket chat)) return;
        String msg = net.minecraft.util.text.TextFormatting.getTextWithoutFormattingCodes(chat.getChatComponent().getString()).toLowerCase();
        if (msg.contains("освободите хранилище") || msg.contains("уберите предметы с продажи")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§c[AutoSell] Отключаюсь: " + msg), mc.player.getUniqueID());
            setenabled(false, false);
        } else if (msg.contains("используете команду слишком часто") || msg.contains("слишком часто")) {
            if (mc.player != null) mc.player.sendMessage(new net.minecraft.util.text.StringTextComponent("§e[AutoSell] Слишком часто, попробую ещё раз"), mc.player.getUniqueID());
            lastSoldKey = "";
            sellTimer.reset();
        }
    }
}
хуйня гпт бруух
 
Назад
Сверху Снизу