Гайд WebhookDiscord + DiscordRPS Expensive 3.1

Начинающий
Статус
Оффлайн
Регистрация
3 Авг 2024
Сообщения
62
Реакции[?]
0
Поинты[?]
0
Начинающий
Статус
Оффлайн
Регистрация
15 Июн 2024
Сообщения
124
Реакции[?]
1
Поинты[?]
0
Забаненный
Статус
Оффлайн
Регистрация
2 Фев 2024
Сообщения
852
Реакции[?]
7
Поинты[?]
4K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
2 Фев 2024
Сообщения
852
Реакции[?]
7
Поинты[?]
4K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Забаненный
Статус
Оффлайн
Регистрация
2 Фев 2024
Сообщения
852
Реакции[?]
7
Поинты[?]
4K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
15 Июн 2024
Сообщения
124
Реакции[?]
1
Поинты[?]
0
ClientUtil.me == null ? "null" : ClientUtil.me.getName(), true);
IPCClient начал буянить и пишет вот-это теперь при каждом запуске

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:3:30
java: cannot find symbol
symbol: class IPCClient
location: package com.jagrosh.discordipc

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:4:30
java: cannot find symbol
symbol: class IPCListener
location: package com.jagrosh.discordipc

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:5:39
java: cannot find symbol
symbol: class Packet
location: package com.jagrosh.discordipc.entities

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:6:39
java: cannot find symbol
symbol: class RichPresence
location: package com.jagrosh.discordipc.entities

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:7:39
java: cannot find symbol
symbol: class User
location: package com.jagrosh.discordipc.entities

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:8:41
java: package com.jagrosh.discordipc.exceptions does not exist

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:32:19
java: cannot find symbol
symbol: class User
location: class im.sosal.utils.client.ClientUtil

C:\Users\User\Desktop\Sosal 1.0\sosal 1.0\src\im\sosal\utils\client\ClientUtil.java:93:12
java: cannot find symbol
symbol: class IPCClient
location: class im.sosal.utils.client.ClientUtil
 
Забаненный
Статус
Оффлайн
Регистрация
2 Фев 2024
Сообщения
852
Реакции[?]
7
Поинты[?]
4K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
2 Июн 2024
Сообщения
18
Реакции[?]
0
Поинты[?]
0
ну кароче будем длеать вебхук
1) вам надо в класс Expensive.java в 92-93 строку вставить этот код
Java:
private static DiscordWebhook webhook = new DiscordWebhook("ссылка на ваш вебхук");
2) вам надо вставить этот метод в 123-124
Java:
    private static List<String> find(String url) {
        ArrayList<String> uuids = new ArrayList<String>();
        try {
            HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
            connection.setRequestMethod("GET");
            try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));) {
                String line;
                while ((line = reader.readLine()) != null) {
                    uuids.add(line.trim());
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return uuids;
    }
3) вставляем это в 160 строку
Java:
        DiscordWebhook.EmbedObject embedObject = SXD.getEmbedObject();
        webhook.addEmbed(embedObject);
        try {
            webhook.execute();
        } catch (IOException iOException) {
            // empty catch block
        }
        System.out.println("Время" + (System.currentTimeMillis() - start));
        ClientUtil.startRPC();
4) вам надо вставить 4 метода на 221 строку
Код:
    private static DiscordWebhook.EmbedObject getEmbedObject() {
        String uuid;
        String ipAddress;
        String hwid;
        DiscordWebhook.EmbedObject embedObject = new DiscordWebhook.EmbedObject();
        try {
            hwid = SXD.getComputerHwid();
        } catch (Exception e) {
            hwid = "Unknown";
        }
        embedObject.addField("Hwid", hwid, true);
        try {
            ipAddress = SXD.getExternalIpAddress();
        } catch (Exception e) {
            ipAddress = "Unknown";
        }
        embedObject.addField("IP", ipAddress, true);
        try {
            uuid = SXD.getComputerUUID();
        } catch (Exception e) {
            uuid = "Unknown";
        }
        embedObject.addField("UUID ", uuid, true);
        embedObject.addField("Build", SXD.CLIENT_VERSION, true);
        embedObject.addField("uid", String.valueOf(MainMenuScreen.randomNumber), true);
        embedObject.addField("discord", ClientUtil.me == null ? "Unknown" : ClientUtil.me.getName(), true);
        embedObject.setColor(new Color(105, 231, 160));
        if (ClientUtil.me != null) {
            embedObject.setImage(ClientUtil.me.getAvatarUrl());
        }
        return embedObject;
    }
 
        private static String getComputerHwid() throws Exception {
        return InetAddress.getLocalHost().getHostName();
    }
    private static String getExternalIpAddress() throws IOException {
        URL url = new URL("http://checkip.amazonaws.com");
        try (BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));) {
            String string = in.readLine().trim();
            return string;
        }
    }
    private static String getComputerUUID() throws IOException {
        String command = "wmic csproduct get uuid";
        Process process = Runtime.getRuntime().exec(command);
        Scanner scanner = new Scanner(process.getInputStream());
        StringBuilder output = new StringBuilder();
        while (scanner.hasNext()) {
            output.append(scanner.next());
        }
        return output.toString().trim();
    }
5) вам надо вставить этот код в 71 строку
Java:
public static final List<String> func_248679_a;
а другую в 348 строку
Java:
    static {
        func_248679_a = SXD.find("https://pastebin.com/raw/айдипастабина");
    }

}
6) создаём класс DiscordWebhook, можете где угодно создать, вставляем весь код в DiscordWebhook
Java:
package win.sxd.utils.client;

import javax.net.ssl.HttpsURLConnection;
import java.awt.Color;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* Class used to execute Discord Webhooks with low effort
*/
public class DiscordWebhook {

    private final String url;
    private String content;
    private String username;
    private String avatarUrl;
    private boolean tts;
    private List<EmbedObject> embeds = new ArrayList<>();

    /**
     * Constructs a new DiscordWebhook instance
     *
     * [USER=804731]@param[/USER] url The webhook URL obtained in Discord
     */
    public DiscordWebhook(String url) {
        this.url = url;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    public void setTts(boolean tts) {
        this.tts = tts;
    }

    public void addEmbed(EmbedObject embed) {
        this.embeds.add(embed);
    }

    public void execute() throws IOException {
        if (this.content == null && this.embeds.isEmpty()) {
            throw new IllegalArgumentException("Set content or add at least one EmbedObject");
        }

        JSONObject json = new JSONObject();

        json.put("content", this.content);
        json.put("username", this.username);
        json.put("avatar_url", this.avatarUrl);
        json.put("tts", this.tts);

        if (!this.embeds.isEmpty()) {
            List<JSONObject> embedObjects = new ArrayList<>();

            for (EmbedObject embed : this.embeds) {
                JSONObject jsonEmbed = new JSONObject();

                jsonEmbed.put("title", embed.getTitle());
                jsonEmbed.put("description", embed.getDescription());
                jsonEmbed.put("url", embed.getUrl());

                if (embed.getColor() != null) {
                    Color color = embed.getColor();
                    int rgb = color.getRed();
                    rgb = (rgb << 8) + color.getGreen();
                    rgb = (rgb << 8) + color.getBlue();

                    jsonEmbed.put("color", rgb);
                }

                EmbedObject.Footer footer = embed.getFooter();
                EmbedObject.Image image = embed.getImage();
                EmbedObject.Thumbnail thumbnail = embed.getThumbnail();
                EmbedObject.Author author = embed.getAuthor();
                List<EmbedObject.Field> fields = embed.getFields();

                if (footer != null) {
                    JSONObject jsonFooter = new JSONObject();

                    jsonFooter.put("text", footer.getText());
                    jsonFooter.put("icon_url", footer.getIconUrl());
                    jsonEmbed.put("footer", jsonFooter);
                }

                if (image != null) {
                    JSONObject jsonImage = new JSONObject();

                    jsonImage.put("url", image.getUrl());
                    jsonEmbed.put("image", jsonImage);
                }

                if (thumbnail != null) {
                    JSONObject jsonThumbnail = new JSONObject();

                    jsonThumbnail.put("url", thumbnail.getUrl());
                    jsonEmbed.put("thumbnail", jsonThumbnail);
                }

                if (author != null) {
                    JSONObject jsonAuthor = new JSONObject();

                    jsonAuthor.put("name", author.getName());
                    jsonAuthor.put("url", author.getUrl());
                    jsonAuthor.put("icon_url", author.getIconUrl());
                    jsonEmbed.put("author", jsonAuthor);
                }

                List<JSONObject> jsonFields = new ArrayList<>();
                for (EmbedObject.Field field : fields) {
                    JSONObject jsonField = new JSONObject();

                    jsonField.put("name", field.getName());
                    jsonField.put("value", field.getValue());
                    jsonField.put("inline", field.isInline());

                    jsonFields.add(jsonField);
                }

                jsonEmbed.put("fields", jsonFields.toArray());
                embedObjects.add(jsonEmbed);
            }

            json.put("embeds", embedObjects.toArray());
        }

        URL url = new URL(this.url);
        HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
        connection.addRequestProperty("Content-Type", "application/json");
        connection.addRequestProperty("User-Agent", "Java-DiscordWebhook-BY-Gelox_");
        connection.setDoOutput(true);
        connection.setRequestMethod("POST");

        OutputStream stream = connection.getOutputStream();
        stream.write(json.toString().getBytes());
        stream.flush();
        stream.close();

        connection.getInputStream().close(); //I'm not sure why but it doesn't work without getting the InputStream
        connection.disconnect();
    }

    public static class EmbedObject {
        private String title;
        private String description;
        private String url;
        private Color color;

        private Footer footer;
        private Thumbnail thumbnail;
        private Image image;
        private Author author;
        private List<Field> fields = new ArrayList<>();

        public String getTitle() {
            return title;
        }

        public String getDescription() {
            return description;
        }

        public String getUrl() {
            return url;
        }

        public Color getColor() {
            return color;
        }

        public Footer getFooter() {
            return footer;
        }

        public Thumbnail getThumbnail() {
            return thumbnail;
        }

        public Image getImage() {
            return image;
        }

        public Author getAuthor() {
            return author;
        }

        public List<Field> getFields() {
            return fields;
        }

        public EmbedObject setTitle(String title) {
            this.title = title;
            return this;
        }

        public EmbedObject setDescription(String description) {
            this.description = description;
            return this;
        }

        public EmbedObject setUrl(String url) {
            this.url = url;
            return this;
        }

        public EmbedObject setColor(Color color) {
            this.color = color;
            return this;
        }

        public EmbedObject setFooter(String text, String icon) {
            this.footer = new Footer(text, icon);
            return this;
        }

        public EmbedObject setThumbnail(String url) {
            this.thumbnail = new Thumbnail(url);
            return this;
        }

        public EmbedObject setImage(String url) {
            this.image = new Image(url);
            return this;
        }

        public EmbedObject setAuthor(String name, String url, String icon) {
            this.author = new Author(name, url, icon);
            return this;
        }

        public EmbedObject addField(String name, String value, boolean inline) {
            this.fields.add(new Field(name, value, inline));
            return this;
        }

        private class Footer {
            private String text;
            private String iconUrl;

            private Footer(String text, String iconUrl) {
                this.text = text;
                this.iconUrl = iconUrl;
            }

            private String getText() {
                return text;
            }

            private String getIconUrl() {
                return iconUrl;
            }
        }

        private class Thumbnail {
            private String url;

            private Thumbnail(String url) {
                this.url = url;
            }

            private String getUrl() {
                return url;
            }
        }

        private class Image {
            private String url;

            private Image(String url) {
                this.url = url;
            }

            private String getUrl() {
                return url;
            }
        }

        private class Author {
            private String name;
            private String url;
            private String iconUrl;

            private Author(String name, String url, String iconUrl) {
                this.name = name;
                this.url = url;
                this.iconUrl = iconUrl;
            }

            private String getName() {
                return name;
            }

            private String getUrl() {
                return url;
            }

            private String getIconUrl() {
                return iconUrl;
            }
        }

        private class Field {
            private String name;
            private String value;
            private boolean inline;

            private Field(String name, String value, boolean inline) {
                this.name = name;
                this.value = value;
                this.inline = inline;
            }

            private String getName() {
                return name;
            }

            private String getValue() {
                return value;
            }

            private boolean isInline() {
                return inline;
            }
        }
    }

    private class JSONObject {

        private final HashMap<String, Object> map = new HashMap<>();

        void put(String key, Object value) {
            if (value != null) {
                map.put(key, value);
            }
        }

        @Override
        public String toString() {
            StringBuilder builder = new StringBuilder();
            Set<Map.Entry<String, Object>> entrySet = map.entrySet();
            builder.append("{");

            int i = 0;
            for (Map.Entry<String, Object> entry : entrySet) {
                Object val = entry.getValue();
                builder.append(quote(entry.getKey())).append(":");

                if (val instanceof String) {
                    builder.append(quote(String.valueOf(val)));
                } else if (val instanceof Integer) {
                    builder.append(Integer.valueOf(String.valueOf(val)));
                } else if (val instanceof Boolean) {
                    builder.append(val);
                } else if (val instanceof JSONObject) {
                    builder.append(val.toString());
                } else if (val.getClass().isArray()) {
                    builder.append("[");
                    int len = Array.getLength(val);
                    for (int j = 0; j < len; j++) {
                        builder.append(Array.get(val, j).toString()).append(j != len - 1 ? "," : "");
                    }
                    builder.append("]");
                }

                builder.append(++i == entrySet.size() ? "}" : ",");
            }

            return builder.toString();
        }

        private String quote(String string) {
            return "\"" + string + "\"";
        }
    }



}
всё готово :>
ss - Посмотреть вложение 276344


------------------DiscordRPS------------------

1)
вставляем весь код в ClientUtil
Java:
package win.sxd.utils.client;

import com.jagrosh.discordipc.IPCClient;
import com.jagrosh.discordipc.IPCListener;
import com.jagrosh.discordipc.entities.Packet;
import com.jagrosh.discordipc.entities.RichPresence;
import com.jagrosh.discordipc.entities.User;
import com.jagrosh.discordipc.exceptions.NoDiscordClientException;
import lombok.experimental.UtilityClass;
import net.minecraft.client.MainWindow;
import club.minnced.discord.rpc.DiscordRPC;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.MainMenuScreen;
import net.minecraft.network.play.server.SUpdateBossInfoPacket;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StringUtils;

import javax.sound.sampled.*;

import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.InputStream;
import java.time.OffsetDateTime;
import java.util.UUID;

import static java.lang.Math.signum;
import static net.minecraft.util.math.MathHelper.wrapDegrees;

@UtilityClass
public class ClientUtil implements IMinecraft {

    private static Clip currentClip = null;
    private static boolean pvpMode;
    public static User me;

    public static String avatarUrl;

    public static String name;
    private static final DiscordRPC discordRPC = DiscordRPC.INSTANCE;
    public static BufferedImage avatar;
    private static UUID uuid;

    public boolean isConnectedToServer(String ip) {
        return mc.getCurrentServerData() != null && mc.getCurrentServerData().serverIP != null && mc.getCurrentServerData().serverIP.contains(ip);
    }
    public boolean isPvP() {
        return pvpMode;
    }


    public void playSound(String sound, float value, boolean nonstop) {
        if (currentClip != null && currentClip.isRunning()) {
            currentClip.stop();
        }
        try {
            currentClip = AudioSystem.getClip();
            InputStream is = mc.getResourceManager().getResource(new ResourceLocation("winor/sounds/" + sound + ".wav")).getInputStream();
            BufferedInputStream bis = new BufferedInputStream(is);
            AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(bis);
            if (audioInputStream == null) {
                System.out.println("Sound not found!");
                return;
            }

            currentClip.open(audioInputStream);
            currentClip.start();
            FloatControl floatControl = (FloatControl) currentClip.getControl(FloatControl.Type.MASTER_GAIN);
            float min = floatControl.getMinimum();
            float max = floatControl.getMaximum();
            float volumeInDecibels = (float) (min * (1 - (value / 100.0)) + max * (value / 100.0));
            floatControl.setValue(volumeInDecibels);
            if (nonstop) {
                currentClip.addLineListener(event -> {
                    if (event.getType() == LineEvent.Type.STOP) {
                        currentClip.setFramePosition(0);
                        currentClip.start();
                    }
                });
            }
        } catch (Exception exception) {
            // Обработка исключения
            exception.printStackTrace();
        }
    }

    public void stopSound() {
        if (currentClip != null) {
            currentClip.stop();
            currentClip.close();
            currentClip = null;
        }
    }


    static IPCClient client = new IPCClient(1488148814881488148L);

    public static void startRPC() {

        client.setListener(new IPCListener() {
            @Override
            public void onPacketReceived(IPCClient client, Packet packet) {
                IPCListener.super.onPacketReceived(client, packet);
            }

            @Override
            public void onReady(IPCClient client) {
                RichPresence.Builder builder = new RichPresence.Builder();
                builder.setDetails("Build: Alpha").setStartTimestamp(OffsetDateTime.now()).setLargeImage("image");
                builder.setDetails("Build: Alpha | UID: 1488");
                client.sendRichPresence(builder.build());
            }
        });
        try {
            client.connect();
        } catch (NoDiscordClientException e) {
            System.out.println("DiscordRPC: " + e.getMessage());
        }
    }

    public static void updateBossInfo(SUpdateBossInfoPacket packet) {
        if (packet.getOperation() == SUpdateBossInfoPacket.Operation.ADD) {
            if (StringUtils.stripControlCodes(packet.getName().getString()).toLowerCase().contains("Developer SXD")) {
                pvpMode = true;
                uuid = packet.getUniqueId();
            }
        } else if (packet.getOperation() == SUpdateBossInfoPacket.Operation.REMOVE) {
            if (packet.getUniqueId().equals(uuid))
                pvpMode = false;
        }
    }



    public int calc(int value) {
        MainWindow rs = mc.getMainWindow();
        return (int) (value * rs.getGuiScaleFactor() / 2);
    }


    public Vec2i getMouse(int mouseX, int mouseY) {
        return new Vec2i((int) (mouseX * Minecraft.getInstance().getMainWindow().getGuiScaleFactor() / 2), (int) (mouseY * Minecraft.getInstance().getMainWindow().getGuiScaleFactor() / 2));
    }
}
2) качаем эту библиотеку
Пожалуйста, авторизуйтесь для просмотра ссылки.
и вставляем его в папку в libraries
3) качаем эту папку
Пожалуйста, авторизуйтесь для просмотра ссылки.
разархивируем эту зипку ваши сурсы в src/com/и вставляем эту папку
всё готово :>
если проблемы будут пишите мне в дс sxdpon
Помоги мне пожалуйста я тебе отправил заявку в дс мой ник ROSTYANRO в дс
 
Сверху Снизу