Added two configs, bed spam delay, "only sniper config". Also renamed some configs to have a better meaning. Added auto detect cookie so it can start everywhere
This commit is contained in:
parent
0c66d91239
commit
62ab1729fa
13 changed files with 166 additions and 325 deletions
|
@ -98,7 +98,7 @@ main {
|
||||||
I:AuctionHouseDelay=9
|
I:AuctionHouseDelay=9
|
||||||
B:GUI=true
|
B:GUI=true
|
||||||
I:GUI_COLOR=-65536
|
I:GUI_COLOR=-65536
|
||||||
I:ProfitPercentage=400
|
I:MinimumProfitPercentage=400
|
||||||
I:ReconnectDelay=20
|
I:ReconnectDelay=20
|
||||||
B:SendMessageToWebhook=true
|
B:SendMessageToWebhook=true
|
||||||
S:Webhook=Paste your webhook here
|
S:Webhook=Paste your webhook here
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
mod_name = Lilase
|
mod_name = Lilase
|
||||||
mod_id = lilase
|
mod_id = lilase
|
||||||
mod_version = 1.0.25
|
mod_version = 1.0.26
|
||||||
|
|
||||||
essential.defaults.loom=0
|
essential.defaults.loom=0
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@ import cc.polyfrost.oneconfig.events.EventManager;
|
||||||
import cc.polyfrost.oneconfig.events.event.InitializationEvent;
|
import cc.polyfrost.oneconfig.events.event.InitializationEvent;
|
||||||
import cc.polyfrost.oneconfig.libs.eventbus.Subscribe;
|
import cc.polyfrost.oneconfig.libs.eventbus.Subscribe;
|
||||||
import me.night0721.lilase.events.SniperFlipperEvents;
|
import me.night0721.lilase.events.SniperFlipperEvents;
|
||||||
import me.night0721.lilase.features.ah.AHConfig;
|
import me.night0721.lilase.config.AHConfig;
|
||||||
import me.night0721.lilase.features.ah.AuctionHouse;
|
import me.night0721.lilase.features.sniper.AuctionHouse;
|
||||||
|
import me.night0721.lilase.gui.ImageRenderer;
|
||||||
import me.night0721.lilase.utils.Clock;
|
import me.night0721.lilase.utils.Clock;
|
||||||
import me.night0721.lilase.utils.ConfigUtils;
|
import me.night0721.lilase.config.ConfigUtils;
|
||||||
import me.night0721.lilase.utils.KeyBindingManager;
|
import me.night0721.lilase.utils.KeyBindingManager;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiDisconnected;
|
import net.minecraft.client.gui.GuiDisconnected;
|
||||||
|
@ -23,14 +24,14 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static me.night0721.lilase.features.ah.AHConfig.AUCTION_HOUSE_DELAY;
|
import static me.night0721.lilase.config.AHConfig.AUCTION_HOUSE_DELAY;
|
||||||
import static me.night0721.lilase.features.ah.AHConfig.RECONNECT_DELAY;
|
import static me.night0721.lilase.config.AHConfig.RECONNECT_DELAY;
|
||||||
|
|
||||||
@Mod(modid = Lilase.MODID, name = Lilase.MOD_NAME, version = Lilase.VERSION, acceptedMinecraftVersions = "[1.8.9]")
|
@Mod(modid = Lilase.MODID, name = Lilase.MOD_NAME, version = Lilase.VERSION, acceptedMinecraftVersions = "[1.8.9]")
|
||||||
public class Lilase {
|
public class Lilase {
|
||||||
public static final String MOD_NAME = "Lilase";
|
public static final String MOD_NAME = "Lilase";
|
||||||
public static final String MODID = "Lilase";
|
public static final String MODID = "Lilase";
|
||||||
public static final String VERSION = "1.0.25";
|
public static final String VERSION = "1.0.26";
|
||||||
public static final Minecraft mc = Minecraft.getMinecraft();
|
public static final Minecraft mc = Minecraft.getMinecraft();
|
||||||
public static AuctionHouse auctionHouse;
|
public static AuctionHouse auctionHouse;
|
||||||
public static AHConfig config;
|
public static AHConfig config;
|
||||||
|
@ -39,13 +40,13 @@ public class Lilase {
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void init(FMLInitializationEvent event) {
|
public void init(FMLInitializationEvent event) {
|
||||||
|
ConfigUtils.register();
|
||||||
KeyBindingManager keyBindingManager = new KeyBindingManager();
|
KeyBindingManager keyBindingManager = new KeyBindingManager();
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
MinecraftForge.EVENT_BUS.register(keyBindingManager);
|
MinecraftForge.EVENT_BUS.register(keyBindingManager);
|
||||||
MinecraftForge.EVENT_BUS.register(new SniperFlipperEvents());
|
MinecraftForge.EVENT_BUS.register(new SniperFlipperEvents());
|
||||||
// MinecraftForge.EVENT_BUS.register(new ImageRenderer());
|
MinecraftForge.EVENT_BUS.register(new ImageRenderer());
|
||||||
EventManager.INSTANCE.register(this);
|
EventManager.INSTANCE.register(this);
|
||||||
ConfigUtils.register();
|
|
||||||
auctionHouse = new AuctionHouse();
|
auctionHouse = new AuctionHouse();
|
||||||
keyBindingManager.registerKeyBindings();
|
keyBindingManager.registerKeyBindings();
|
||||||
}
|
}
|
||||||
|
|
88
src/main/java/me/night0721/lilase/config/AHConfig.java
Normal file
88
src/main/java/me/night0721/lilase/config/AHConfig.java
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
package me.night0721.lilase.config;
|
||||||
|
|
||||||
|
import cc.polyfrost.oneconfig.config.Config;
|
||||||
|
import cc.polyfrost.oneconfig.config.annotations.Number;
|
||||||
|
import cc.polyfrost.oneconfig.config.annotations.*;
|
||||||
|
import cc.polyfrost.oneconfig.config.core.OneColor;
|
||||||
|
import cc.polyfrost.oneconfig.config.data.Mod;
|
||||||
|
import cc.polyfrost.oneconfig.config.data.ModType;
|
||||||
|
import me.night0721.lilase.utils.Utils;
|
||||||
|
|
||||||
|
public class AHConfig extends Config {
|
||||||
|
public AHConfig() {
|
||||||
|
super(new Mod("Lilase", ModType.UTIL_QOL), "lilase.json");
|
||||||
|
initialize();
|
||||||
|
addListener("SEND_MESSAGE", () -> ConfigUtils.writeBooleanConfig("main", "SendMessageToWebhook", AHConfig.SEND_MESSAGE));
|
||||||
|
addListener("WEBHOOK", () -> ConfigUtils.writeStringConfig("main", "Webhook", AHConfig.WEBHOOK));
|
||||||
|
addListener("RECONNECT_DELAY", () -> ConfigUtils.writeIntConfig("main", "ReconnectDelay", Math.round(AHConfig.RECONNECT_DELAY)));
|
||||||
|
addListener("AUCTION_HOUSE_DELAY", () -> ConfigUtils.writeIntConfig("main", "AuctionHouseDelay", Math.round(AHConfig.AUCTION_HOUSE_DELAY)));
|
||||||
|
addListener("BED_SPAM", () -> ConfigUtils.writeBooleanConfig("main", "BedSpam", AHConfig.BED_SPAM));
|
||||||
|
addListener("BED_SPAM_DELAY", () -> ConfigUtils.writeIntConfig("main", "BedSpamDelay", Math.round(AHConfig.BED_SPAM_DELAY)));
|
||||||
|
addListener("ONLY_SNIPER", () -> ConfigUtils.writeBooleanConfig("main", "OnlySniper", AHConfig.ONLY_SNIPER));
|
||||||
|
addListener("CHECK_PERCENTAGE", () -> ConfigUtils.writeBooleanConfig("main", "checkProfitPercentageBeforeBuy", AHConfig.CHECK_PERCENTAGE));
|
||||||
|
addListener("MINIMUM_PROFIT_PERCENTAGE", () -> ConfigUtils.writeIntConfig("main", "MinimumProfitPercentage", Math.round(AHConfig.MINIMUM_PROFIT_PERCENTAGE)));
|
||||||
|
addListener("GUI", () -> ConfigUtils.writeBooleanConfig("main", "GUI", AHConfig.GUI));
|
||||||
|
addListener("GUI_COLOR", () -> ConfigUtils.writeIntConfig("main", "GUI_COLOR", AHConfig.GUI_COLOR.getRGB()));
|
||||||
|
addListener("ITEM_1_NAME", () -> ConfigUtils.writeStringConfig("item1", "Name", AHConfig.ITEM_1_NAME));
|
||||||
|
addListener("ITEM_1_TYPE", () -> ConfigUtils.writeStringConfig("item1", "Type", AHConfig.ITEM_1_TYPE));
|
||||||
|
addListener("ITEM_1_PRICE", () -> ConfigUtils.writeIntConfig("item1", "Price", Math.round(AHConfig.ITEM_1_PRICE)));
|
||||||
|
addListener("ITEM_1_TIER", () -> ConfigUtils.writeStringConfig("item1", "Tier", AHConfig.ITEM_1_TIER));
|
||||||
|
addDependency("WEBHOOK", "SEND_MESSAGE");
|
||||||
|
addDependency("PROFIT_PERCENTAGE", "CHECK_PERCENTAGE");
|
||||||
|
addDependency("GUI_COLOR", "GUI");
|
||||||
|
addDependency("ITEM_1_NAME", "addItem", () -> ConfigUtils.getString("item1", "Name").equals(""));
|
||||||
|
addDependency("ITEM_1_TYPE", "addItem", () -> ConfigUtils.getString("item1", "Type").equals(""));
|
||||||
|
addDependency("ITEM_1_PRICE", "addItem", () -> ConfigUtils.getString("item1", "Price").equals(""));
|
||||||
|
addDependency("ITEM_1_TIER", "addItem", () -> ConfigUtils.getString("item1", "Tier").equals(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Slider(name = "Time per fetch (seconds)", min = 5, max = 15, step = 1, category = "Auction House", subcategory = "Sniper", description = "Time between each fetch of the auction house, the faster the fetch, the more likely you will snipe the item")
|
||||||
|
public static int AUCTION_HOUSE_DELAY = 8;
|
||||||
|
|
||||||
|
@Switch(name = "Bed Spam & Skip Confirm", category = "Auction House", subcategory = "Sniper", description = "Spam the bed to buy the item just after the grace period ends and skips the confirmation of buying the item")
|
||||||
|
public static boolean BED_SPAM = true;
|
||||||
|
|
||||||
|
@Slider(name = "Bed Spam Delay (ms)", min = 50, max = 500, step = 50, category = "Auction House", subcategory = "Sniper", description = "Delay between each bed spam")
|
||||||
|
public static int BED_SPAM_DELAY = 100;
|
||||||
|
|
||||||
|
@Switch(name = "Only Sniper", category = "Auction House", subcategory = "Sniper", description = "Only snipe items, stop auto resell")
|
||||||
|
public static boolean ONLY_SNIPER = false;
|
||||||
|
|
||||||
|
@Button(name = "Add Item", text = "Click to add an item to snipe", subcategory = "Items", category = "Auction House")
|
||||||
|
public static void addItem() {
|
||||||
|
Utils.debugLog("[AHConfig] Add Item Button Clicked");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Text(name = "Discord Webhook", placeholder = "URL", category = "Auction House", subcategory = "Webhook", description = "Discord webhook to send messages to")
|
||||||
|
public static String WEBHOOK = "";
|
||||||
|
|
||||||
|
@Switch(name = "Send message to webhook", category = "Auction House", subcategory = "Webhook", description = "Send a message to the webhook when an item is bought")
|
||||||
|
public static boolean SEND_MESSAGE = true;
|
||||||
|
|
||||||
|
@Number(name = "Reconnect Delay", min = 5, max = 20, category = "Failsafe", description = "Delay between each reconnect attempt to the server")
|
||||||
|
public static int RECONNECT_DELAY = 20;
|
||||||
|
|
||||||
|
@Switch(name = "Check Profit Percentage Before Buying", category = "Flipper", description = "Check the profit percentage before buying the item, if the profit percentage is too low, it will not buy the item")
|
||||||
|
public static boolean CHECK_PERCENTAGE = false;
|
||||||
|
|
||||||
|
@Number(name = "Minimum Profit Percentage", min = 100, max = 5000, step = 50, category = "Flipper", description = "Profit percentage to check before buying the item, if the profit percentage is too low, it will not buy the item")
|
||||||
|
public static int MINIMUM_PROFIT_PERCENTAGE = 400;
|
||||||
|
|
||||||
|
@Checkbox(name = "GUI", category = "GUI", description = "Enable the GUI")
|
||||||
|
public static boolean GUI = true;
|
||||||
|
|
||||||
|
@Color(name = "GUI Color", category = "GUI")
|
||||||
|
public static OneColor GUI_COLOR = new OneColor(0, 49, 83);
|
||||||
|
|
||||||
|
@Text(name = "Item 1 Name", placeholder = "Item Name")
|
||||||
|
public static String ITEM_1_NAME = " ";
|
||||||
|
|
||||||
|
@Text(name = "Item 1 Type", placeholder = "Item Type")
|
||||||
|
public static String ITEM_1_TYPE = "ANY";
|
||||||
|
|
||||||
|
@Number(name = "Item 1 Price", min = 1, max = 1000000000)
|
||||||
|
public static int ITEM_1_PRICE = 1;
|
||||||
|
|
||||||
|
@Text(name = "Item 1 Tier", placeholder = "Item Tier")
|
||||||
|
public static String ITEM_1_TIER = "ANY";
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package me.night0721.lilase.utils;
|
package me.night0721.lilase.config;
|
||||||
|
|
||||||
|
import me.night0721.lilase.utils.Utils;
|
||||||
import net.minecraftforge.common.config.ConfigCategory;
|
import net.minecraftforge.common.config.ConfigCategory;
|
||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
|
|
||||||
|
@ -26,8 +27,12 @@ public class ConfigUtils {
|
||||||
if (hasNoKey("main", "Webhook")) writeStringConfig("main", "Webhook", "");
|
if (hasNoKey("main", "Webhook")) writeStringConfig("main", "Webhook", "");
|
||||||
if (hasNoKey("main", "ReconnectDelay")) writeIntConfig("main", "ReconnectDelay", 20);
|
if (hasNoKey("main", "ReconnectDelay")) writeIntConfig("main", "ReconnectDelay", 20);
|
||||||
if (hasNoKey("main", "AuctionHouseDelay")) writeIntConfig("main", "AuctionHouseDelay", 8);
|
if (hasNoKey("main", "AuctionHouseDelay")) writeIntConfig("main", "AuctionHouseDelay", 8);
|
||||||
if (hasNoKey("main", "checkProfitPercentageBeforeBuy")) writeBooleanConfig("main", "checkProfitPercentageBeforeBuy", false);
|
if (hasNoKey("main", "BedSpam")) writeBooleanConfig("main", "BedSpam", true);
|
||||||
if (hasNoKey("main", "ProfitPercentage")) writeIntConfig("main", "ProfitPercentage", 400); //400%
|
if (hasNoKey("main", "BedSpamDelay")) writeIntConfig("main", "BedSpamDelay", 100);
|
||||||
|
if (hasNoKey("main", "OnlySniper")) writeBooleanConfig("main", "OnlySniper", false);
|
||||||
|
if (hasNoKey("main", "checkProfitPercentageBeforeBuy"))
|
||||||
|
writeBooleanConfig("main", "checkProfitPercentageBeforeBuy", false);
|
||||||
|
if (hasNoKey("main", "MinimumProfitPercentage")) writeIntConfig("main", "MinimumProfitPercentage", 400); //400%
|
||||||
if (hasNoKey("main", "GUI")) writeBooleanConfig("main", "GUI", true);
|
if (hasNoKey("main", "GUI")) writeBooleanConfig("main", "GUI", true);
|
||||||
if (hasNoKey("main", "GUI_COLOR")) writeIntConfig("main", "GUI_COLOR", 0x003153);
|
if (hasNoKey("main", "GUI_COLOR")) writeIntConfig("main", "GUI_COLOR", 0x003153);
|
||||||
for (int i = 1; i <= 3; i++) {
|
for (int i = 1; i <= 3; i++) {
|
|
@ -1,9 +1,10 @@
|
||||||
package me.night0721.lilase.events;
|
package me.night0721.lilase.events;
|
||||||
|
|
||||||
import me.night0721.lilase.Lilase;
|
import me.night0721.lilase.Lilase;
|
||||||
import me.night0721.lilase.features.ah.AHConfig;
|
import me.night0721.lilase.config.AHConfig;
|
||||||
import me.night0721.lilase.features.flip.Flipper;
|
import me.night0721.lilase.config.ConfigUtils;
|
||||||
import me.night0721.lilase.features.flip.FlipperState;
|
import me.night0721.lilase.features.flipper.Flipper;
|
||||||
|
import me.night0721.lilase.features.flipper.FlipperState;
|
||||||
import me.night0721.lilase.gui.TextRenderer;
|
import me.night0721.lilase.gui.TextRenderer;
|
||||||
import me.night0721.lilase.utils.*;
|
import me.night0721.lilase.utils.*;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -30,11 +31,11 @@ import java.util.TimeZone;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static me.night0721.lilase.features.ah.AHConfig.GUI_COLOR;
|
import static me.night0721.lilase.config.AHConfig.GUI_COLOR;
|
||||||
import static me.night0721.lilase.features.ah.AHConfig.SEND_MESSAGE;
|
import static me.night0721.lilase.config.AHConfig.SEND_MESSAGE;
|
||||||
import static me.night0721.lilase.features.ah.AuctionHouse.flipper;
|
import static me.night0721.lilase.features.flipper.Flipper.rotation;
|
||||||
import static me.night0721.lilase.features.flip.Flipper.rotation;
|
import static me.night0721.lilase.features.flipper.FlipperState.START;
|
||||||
import static me.night0721.lilase.features.flip.FlipperState.START;
|
import static me.night0721.lilase.features.sniper.AuctionHouse.flipper;
|
||||||
import static me.night0721.lilase.utils.PlayerUtils.sendPacketWithoutEvent;
|
import static me.night0721.lilase.utils.PlayerUtils.sendPacketWithoutEvent;
|
||||||
|
|
||||||
public class SniperFlipperEvents {
|
public class SniperFlipperEvents {
|
||||||
|
@ -42,6 +43,7 @@ public class SniperFlipperEvents {
|
||||||
private int price;
|
private int price;
|
||||||
private boolean buying = false;
|
private boolean buying = false;
|
||||||
private boolean bought = false;
|
private boolean bought = false;
|
||||||
|
private final Clock clock = new Clock();
|
||||||
private final Pattern auctionSoldPattern = Pattern.compile("^(.*?) bought (.*?) for ([\\d,]+) coins CLICK$");
|
private final Pattern auctionSoldPattern = Pattern.compile("^(.*?) bought (.*?) for ([\\d,]+) coins CLICK$");
|
||||||
private final Pattern boughtPattern = Pattern.compile("You purchased (\\w+(?:\\s+\\w+)*) for ([\\d,]+)\\s*(\\w+)!");
|
private final Pattern boughtPattern = Pattern.compile("You purchased (\\w+(?:\\s+\\w+)*) for ([\\d,]+)\\s*(\\w+)!");
|
||||||
private final Pattern boughtPattern2 = Pattern.compile("You claimed (.+?) from (.+?)'s auction!");
|
private final Pattern boughtPattern2 = Pattern.compile("You claimed (.+?) from (.+?)'s auction!");
|
||||||
|
@ -82,7 +84,7 @@ public class SniperFlipperEvents {
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
flipper.sellItem();
|
if (!AHConfig.ONLY_SNIPER) flipper.sellItem();
|
||||||
}).start();
|
}).start();
|
||||||
} else if (message.equals("Your starting bid must be at least 10 coins!")) {
|
} else if (message.equals("Your starting bid must be at least 10 coins!")) {
|
||||||
InventoryUtils.clickOpenContainerSlot(13);
|
InventoryUtils.clickOpenContainerSlot(13);
|
||||||
|
@ -202,18 +204,30 @@ public class SniperFlipperEvents {
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
public void onInventoryRendering(GuiScreenEvent.BackgroundDrawnEvent event) {
|
public void onInventoryRendering(GuiScreenEvent.BackgroundDrawnEvent event) {
|
||||||
String windowName = InventoryUtils.getInventoryName();
|
String windowName = InventoryUtils.getInventoryName();
|
||||||
if ("BIN Auction View".equals(windowName)) {
|
|
||||||
ItemStack is = InventoryUtils.getStackInOpenContainerSlot(31);
|
|
||||||
if (is != null && (is.getItem() == Items.gold_nugget || (AHConfig.BED_SPAM && is.getItem() == Items.bed))) {
|
|
||||||
buying = true;
|
|
||||||
windowId = Lilase.mc.thePlayer.openContainer.windowId;
|
|
||||||
Lilase.mc.playerController.windowClick(windowId, 31, 0, 0, Lilase.mc.thePlayer);
|
|
||||||
} else if (is != null && is.getItem() == Items.potato) {
|
|
||||||
buying = false;
|
|
||||||
Lilase.mc.thePlayer.closeScreen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (AHConfig.BED_SPAM) {
|
if (AHConfig.BED_SPAM) {
|
||||||
|
if ("BIN Auction View".equals(windowName)) {
|
||||||
|
ItemStack is = InventoryUtils.getStackInOpenContainerSlot(31);
|
||||||
|
if (is != null) {
|
||||||
|
buying = true;
|
||||||
|
windowId = Lilase.mc.thePlayer.openContainer.windowId;
|
||||||
|
if (is.getItem() == Items.bed && clock.passed()) {
|
||||||
|
Lilase.mc.playerController.windowClick(windowId, 31, 0, 0, Lilase.mc.thePlayer);
|
||||||
|
clock.schedule(AHConfig.BED_SPAM_DELAY);
|
||||||
|
} else if (is.getItem() == Items.gold_nugget)
|
||||||
|
Lilase.mc.playerController.windowClick(windowId, 31, 0, 0, Lilase.mc.thePlayer);
|
||||||
|
else if (is.getItem() == Items.potato) {
|
||||||
|
buying = false;
|
||||||
|
Lilase.mc.thePlayer.closeScreen();
|
||||||
|
} else {
|
||||||
|
buying = false;
|
||||||
|
Lilase.mc.thePlayer.closeScreen();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
System.out.println("Not gonna happen");
|
||||||
|
buying = false;
|
||||||
|
Lilase.mc.thePlayer.closeScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (buying && "Confirm Purchase".equals(windowName)) {
|
if (buying && "Confirm Purchase".equals(windowName)) {
|
||||||
Lilase.mc.playerController.windowClick(windowId + 1, 11, 0, 0, Lilase.mc.thePlayer);
|
Lilase.mc.playerController.windowClick(windowId + 1, 11, 0, 0, Lilase.mc.thePlayer);
|
||||||
buying = false;
|
buying = false;
|
||||||
|
@ -221,6 +235,7 @@ public class SniperFlipperEvents {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onPacketReceive(PacketReceivedEvent event) {
|
public void onPacketReceive(PacketReceivedEvent event) {
|
||||||
if (event.packet instanceof S33PacketUpdateSign && Utils.checkInHub() && Flipper.state.equals(START)) {
|
if (event.packet instanceof S33PacketUpdateSign && Utils.checkInHub() && Flipper.state.equals(START)) {
|
||||||
|
|
|
@ -1,268 +0,0 @@
|
||||||
package me.night0721.lilase.features.ah;
|
|
||||||
|
|
||||||
import cc.polyfrost.oneconfig.config.Config;
|
|
||||||
import cc.polyfrost.oneconfig.config.annotations.Number;
|
|
||||||
import cc.polyfrost.oneconfig.config.annotations.*;
|
|
||||||
import cc.polyfrost.oneconfig.config.core.OneColor;
|
|
||||||
import cc.polyfrost.oneconfig.config.data.Mod;
|
|
||||||
import cc.polyfrost.oneconfig.config.data.ModType;
|
|
||||||
import me.night0721.lilase.utils.ConfigUtils;
|
|
||||||
import me.night0721.lilase.utils.Utils;
|
|
||||||
|
|
||||||
public class AHConfig extends Config {
|
|
||||||
public AHConfig() {
|
|
||||||
super(new Mod("Lilase", ModType.UTIL_QOL), "lilase.json");
|
|
||||||
initialize();
|
|
||||||
addListener("SEND_MESSAGE", () -> ConfigUtils.writeBooleanConfig("main", "SendMessageToWebhook", AHConfig.SEND_MESSAGE));
|
|
||||||
addListener("WEBHOOK", () -> ConfigUtils.writeStringConfig("main", "Webhook", AHConfig.WEBHOOK));
|
|
||||||
addListener("RECONNECT_DELAY", () -> ConfigUtils.writeIntConfig("main", "ReconnectDelay", Math.round(AHConfig.RECONNECT_DELAY)));
|
|
||||||
addListener("AUCTION_HOUSE_DELAY", () -> ConfigUtils.writeIntConfig("main", "AuctionHouseDelay", Math.round(AHConfig.AUCTION_HOUSE_DELAY)));
|
|
||||||
addListener("CHECK_PERCENTAGE", () -> ConfigUtils.writeBooleanConfig("main", "checkProfitPercentageBeforeBuy", AHConfig.CHECK_PERCENTAGE));
|
|
||||||
addListener("PROFIT_PERCENTAGE", () -> ConfigUtils.writeIntConfig("main", "ProfitPercentage", Math.round(AHConfig.PROFIT_PERCENTAGE)));
|
|
||||||
addListener("GUI", () -> ConfigUtils.writeBooleanConfig("main", "GUI", AHConfig.GUI));
|
|
||||||
addListener("GUI_COLOR", () -> ConfigUtils.writeIntConfig("main", "GUI_COLOR", AHConfig.GUI_COLOR.getRGB()));
|
|
||||||
addListener("CRABBY_COLOR", () -> ConfigUtils.writeIntConfig("main", "CRABBY_COLOR", AHConfig.CRABBY_COLOR));
|
|
||||||
addListener("ITEM_1_NAME", () -> ConfigUtils.writeStringConfig("item1", "Name", AHConfig.ITEM_1_NAME));
|
|
||||||
addListener("ITEM_1_TYPE", () -> ConfigUtils.writeStringConfig("item1", "Type", AHConfig.ITEM_1_TYPE));
|
|
||||||
addListener("ITEM_1_PRICE", () -> ConfigUtils.writeIntConfig("item1", "Price", Math.round(AHConfig.ITEM_1_PRICE)));
|
|
||||||
addListener("ITEM_1_TIER", () -> ConfigUtils.writeStringConfig("item1", "Tier", AHConfig.ITEM_1_TIER));
|
|
||||||
addListener("ITEM_2_NAME", () -> ConfigUtils.writeStringConfig("item2", "Name", AHConfig.ITEM_2_NAME));
|
|
||||||
addListener("ITEM_2_TYPE", () -> ConfigUtils.writeStringConfig("item2", "Type", AHConfig.ITEM_2_TYPE));
|
|
||||||
addListener("ITEM_2_PRICE", () -> ConfigUtils.writeIntConfig("item2", "Price", Math.round(AHConfig.ITEM_2_PRICE)));
|
|
||||||
addListener("ITEM_2_TIER", () -> ConfigUtils.writeStringConfig("item2", "Tier", AHConfig.ITEM_2_TIER));
|
|
||||||
addListener("ITEM_3_NAME", () -> ConfigUtils.writeStringConfig("item3", "Name", AHConfig.ITEM_3_NAME));
|
|
||||||
addListener("ITEM_3_TYPE", () -> ConfigUtils.writeStringConfig("item3", "Type", AHConfig.ITEM_3_TYPE));
|
|
||||||
addListener("ITEM_3_PRICE", () -> ConfigUtils.writeIntConfig("item3", "Price", Math.round(AHConfig.ITEM_3_PRICE)));
|
|
||||||
addListener("ITEM_3_TIER", () -> ConfigUtils.writeStringConfig("item3", "Tier", AHConfig.ITEM_3_TIER));
|
|
||||||
addListener("ITEM_4_NAME", () -> ConfigUtils.writeStringConfig("item4", "Name", AHConfig.ITEM_4_NAME));
|
|
||||||
addListener("ITEM_4_TYPE", () -> ConfigUtils.writeStringConfig("item4", "Type", AHConfig.ITEM_4_TYPE));
|
|
||||||
addListener("ITEM_4_PRICE", () -> ConfigUtils.writeIntConfig("item4", "Price", Math.round(AHConfig.ITEM_4_PRICE)));
|
|
||||||
addListener("ITEM_4_TIER", () -> ConfigUtils.writeStringConfig("item4", "Tier", AHConfig.ITEM_4_TIER));
|
|
||||||
addListener("ITEM_5_NAME", () -> ConfigUtils.writeStringConfig("item5", "Name", AHConfig.ITEM_5_NAME));
|
|
||||||
addListener("ITEM_5_TYPE", () -> ConfigUtils.writeStringConfig("item5", "Type", AHConfig.ITEM_5_TYPE));
|
|
||||||
addListener("ITEM_5_PRICE", () -> ConfigUtils.writeIntConfig("item5", "Price", Math.round(AHConfig.ITEM_5_PRICE)));
|
|
||||||
addListener("ITEM_5_TIER", () -> ConfigUtils.writeStringConfig("item5", "Tier", AHConfig.ITEM_5_TIER));
|
|
||||||
addListener("ITEM_6_NAME", () -> ConfigUtils.writeStringConfig("item6", "Name", AHConfig.ITEM_6_NAME));
|
|
||||||
addListener("ITEM_6_TYPE", () -> ConfigUtils.writeStringConfig("item6", "Type", AHConfig.ITEM_6_TYPE));
|
|
||||||
addListener("ITEM_6_PRICE", () -> ConfigUtils.writeIntConfig("item6", "Price", Math.round(AHConfig.ITEM_6_PRICE)));
|
|
||||||
addListener("ITEM_6_TIER", () -> ConfigUtils.writeStringConfig("item6", "Tier", AHConfig.ITEM_6_TIER));
|
|
||||||
addListener("ITEM_7_NAME", () -> ConfigUtils.writeStringConfig("item7", "Name", AHConfig.ITEM_7_NAME));
|
|
||||||
addListener("ITEM_7_TYPE", () -> ConfigUtils.writeStringConfig("item7", "Type", AHConfig.ITEM_7_TYPE));
|
|
||||||
addListener("ITEM_7_PRICE", () -> ConfigUtils.writeIntConfig("item7", "Price", Math.round(AHConfig.ITEM_7_PRICE)));
|
|
||||||
addListener("ITEM_7_TIER", () -> ConfigUtils.writeStringConfig("item7", "Tier", AHConfig.ITEM_7_TIER));
|
|
||||||
addListener("ITEM_8_NAME", () -> ConfigUtils.writeStringConfig("item8", "Name", AHConfig.ITEM_8_NAME));
|
|
||||||
addListener("ITEM_8_TYPE", () -> ConfigUtils.writeStringConfig("item8", "Type", AHConfig.ITEM_8_TYPE));
|
|
||||||
addListener("ITEM_8_PRICE", () -> ConfigUtils.writeIntConfig("item8", "Price", Math.round(AHConfig.ITEM_8_PRICE)));
|
|
||||||
addListener("ITEM_8_TIER", () -> ConfigUtils.writeStringConfig("item8", "Tier", AHConfig.ITEM_8_TIER));
|
|
||||||
addListener("ITEM_9_NAME", () -> ConfigUtils.writeStringConfig("item9", "Name", AHConfig.ITEM_9_NAME));
|
|
||||||
addListener("ITEM_9_TYPE", () -> ConfigUtils.writeStringConfig("item9", "Type", AHConfig.ITEM_9_TYPE));
|
|
||||||
addListener("ITEM_9_PRICE", () -> ConfigUtils.writeIntConfig("item9", "Price", Math.round(AHConfig.ITEM_9_PRICE)));
|
|
||||||
addListener("ITEM_9_TIER", () -> ConfigUtils.writeStringConfig("item9", "Tier", AHConfig.ITEM_9_TIER));
|
|
||||||
addListener("ITEM_10_NAME", () -> ConfigUtils.writeStringConfig("item10", "Name", AHConfig.ITEM_10_NAME));
|
|
||||||
addListener("ITEM_10_TYPE", () -> ConfigUtils.writeStringConfig("item10", "Type", AHConfig.ITEM_10_TYPE));
|
|
||||||
addListener("ITEM_10_PRICE", () -> ConfigUtils.writeIntConfig("item10", "Price", Math.round(AHConfig.ITEM_10_PRICE)));
|
|
||||||
addListener("ITEM_10_TIER", () -> ConfigUtils.writeStringConfig("item10", "Tier", AHConfig.ITEM_10_TIER));
|
|
||||||
addDependency("WEBHOOK", "SEND_MESSAGE");
|
|
||||||
addDependency("PROFIT_PERCENTAGE", "CHECK_PERCENTAGE");
|
|
||||||
addDependency("GUI_COLOR", "GUI");
|
|
||||||
addDependency("ITEM_1_NAME", "addItem", () -> ConfigUtils.getString("item1", "Name").equals(""));
|
|
||||||
addDependency("ITEM_1_TYPE", "addItem", () -> ConfigUtils.getString("item1", "Type").equals(""));
|
|
||||||
addDependency("ITEM_1_PRICE", "addItem", () -> ConfigUtils.getString("item1", "Price").equals(""));
|
|
||||||
addDependency("ITEM_1_TIER", "addItem", () -> ConfigUtils.getString("item1", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_2_NAME", "addItem", () -> ConfigUtils.getString("item2", "Name").equals(""));
|
|
||||||
addDependency("ITEM_2_TYPE", "addItem", () -> ConfigUtils.getString("item2", "Type").equals(""));
|
|
||||||
addDependency("ITEM_2_PRICE", "addItem", () -> ConfigUtils.getString("item2", "Price").equals(""));
|
|
||||||
addDependency("ITEM_2_TIER", "addItem", () -> ConfigUtils.getString("item2", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_3_NAME", "addItem", () -> ConfigUtils.getString("item3", "Name").equals(""));
|
|
||||||
addDependency("ITEM_3_TYPE", "addItem", () -> ConfigUtils.getString("item3", "Type").equals(""));
|
|
||||||
addDependency("ITEM_3_PRICE", "addItem", () -> ConfigUtils.getString("item3", "Price").equals(""));
|
|
||||||
addDependency("ITEM_3_TIER", "addItem", () -> ConfigUtils.getString("item3", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_4_NAME", "addItem", () -> ConfigUtils.getString("item4", "Name").equals(""));
|
|
||||||
addDependency("ITEM_4_TYPE", "addItem", () -> ConfigUtils.getString("item4", "Type").equals(""));
|
|
||||||
addDependency("ITEM_4_PRICE", "addItem", () -> ConfigUtils.getString("item4", "Price").equals(""));
|
|
||||||
addDependency("ITEM_4_TIER", "addItem", () -> ConfigUtils.getString("item4", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_5_NAME", "addItem", () -> !ConfigUtils.getString("item5", "Name").equals(""));
|
|
||||||
addDependency("ITEM_5_TYPE", "addItem", () -> !ConfigUtils.getString("item5", "Type").equals(""));
|
|
||||||
addDependency("ITEM_5_PRICE", "addItem", () -> !ConfigUtils.getString("item5", "Price").equals(""));
|
|
||||||
addDependency("ITEM_5_TIER", "addItem", () -> !ConfigUtils.getString("item5", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_6_NAME", "addItem", () -> !ConfigUtils.getString("item6", "Name").equals(""));
|
|
||||||
addDependency("ITEM_6_TYPE", "addItem", () -> !ConfigUtils.getString("item6", "Type").equals(""));
|
|
||||||
addDependency("ITEM_6_PRICE", "addItem", () -> !ConfigUtils.getString("item6", "Price").equals(""));
|
|
||||||
addDependency("ITEM_6_TIER", "addItem", () -> !ConfigUtils.getString("item6", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_7_NAME", "addItem", () -> !ConfigUtils.getString("item7", "Name").equals(""));
|
|
||||||
addDependency("ITEM_7_TYPE", "addItem", () -> !ConfigUtils.getString("item7", "Type").equals(""));
|
|
||||||
addDependency("ITEM_7_PRICE", "addItem", () -> !ConfigUtils.getString("item7", "Price").equals(""));
|
|
||||||
addDependency("ITEM_7_TIER", "addItem", () -> !ConfigUtils.getString("item7", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_8_NAME", "addItem", () -> !ConfigUtils.getString("item8", "Name").equals(""));
|
|
||||||
addDependency("ITEM_8_TYPE", "addItem", () -> !ConfigUtils.getString("item8", "Type").equals(""));
|
|
||||||
addDependency("ITEM_8_PRICE", "addItem", () -> !ConfigUtils.getString("item8", "Price").equals(""));
|
|
||||||
addDependency("ITEM_8_TIER", "addItem", () -> !ConfigUtils.getString("item8", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_9_NAME", "addItem", () -> !ConfigUtils.getString("item9", "Name").equals(""));
|
|
||||||
addDependency("ITEM_9_TYPE", "addItem", () -> !ConfigUtils.getString("item9", "Type").equals(""));
|
|
||||||
addDependency("ITEM_9_PRICE", "addItem", () -> !ConfigUtils.getString("item9", "Price").equals(""));
|
|
||||||
addDependency("ITEM_9_TIER", "addItem", () -> !ConfigUtils.getString("item9", "Tier").equals(""));
|
|
||||||
addDependency("ITEM_10_NAME", "addItem", () -> !ConfigUtils.getString("item10", "Name").equals(""));
|
|
||||||
addDependency("ITEM_10_TYPE", "addItem", () -> !ConfigUtils.getString("item10", "Type").equals(""));
|
|
||||||
addDependency("ITEM_10_PRICE", "addItem", () -> !ConfigUtils.getString("item10", "Price").equals(""));
|
|
||||||
addDependency("ITEM_10_TIER", "addItem", () -> !ConfigUtils.getString("item10", "Tier").equals(""));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Slider(name = "Time per fetch (seconds)", min = 5, max = 15, step = 1, category = "Auction House", subcategory = "Sniper", description = "Time between each fetch of the auction house, the faster the fetch, the more likely you will snipe the item")
|
|
||||||
public static int AUCTION_HOUSE_DELAY = 8;
|
|
||||||
|
|
||||||
@Switch(name = "Bed Spam & Skip Confirm", category = "Auction House", subcategory = "Sniper", description = "Spam the bed to buy the item just after the grace period ends and skips the confirmation of buying the item")
|
|
||||||
public static boolean BED_SPAM = true;
|
|
||||||
|
|
||||||
@Button(name = "Add Item", text = "Click to add an item to snipe", subcategory = "Items", category = "Auction House")
|
|
||||||
public static void addItem() {
|
|
||||||
Utils.debugLog("[AHConfig] Add Item Button Clicked");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Dropdown(name = "Remove Item", category = "Auction House", subcategory = "Items", description = "Remove an item from the snipe list", options = {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"})
|
|
||||||
public static int value = 0;
|
|
||||||
|
|
||||||
@Text(name = "Discord Webhook", placeholder = "URL", category = "Auction House", subcategory = "Webhook", description = "Discord webhook to send messages to")
|
|
||||||
public static String WEBHOOK = "";
|
|
||||||
|
|
||||||
@Switch(name = "Send message to webhook", category = "Auction House", subcategory = "Webhook", description = "Send a message to the webhook when an item is bought")
|
|
||||||
public static boolean SEND_MESSAGE = true;
|
|
||||||
|
|
||||||
@Number(name = "Reconnect Delay", min = 5, max = 20, category = "Failsafe", description = "Delay between each reconnect attempt to the server")
|
|
||||||
public static int RECONNECT_DELAY = 20;
|
|
||||||
|
|
||||||
@Switch(name = "Check Profit Percentage Before Buying", category = "Flipper", description = "Check the profit percentage before buying the item, if the profit percentage is too low, it will not buy the item")
|
|
||||||
public static boolean CHECK_PERCENTAGE = false;
|
|
||||||
|
|
||||||
@Number(name = "ProfitPercentage", min = 100, max = 5000, step = 50, category = "Flipper", description = "Profit percentage to check before buying the item, if the profit percentage is too low, it will not buy the item")
|
|
||||||
public static int PROFIT_PERCENTAGE = 400;
|
|
||||||
|
|
||||||
@Checkbox(name = "GUI", category = "GUI", description = "Enable the GUI")
|
|
||||||
public static boolean GUI = true;
|
|
||||||
|
|
||||||
@Color(name = "GUI Color", category = "GUI")
|
|
||||||
public static OneColor GUI_COLOR = new OneColor(0, 49, 83);
|
|
||||||
|
|
||||||
@Number(name = "Crabby Theme Color", min = 0, max = 7, category = "GUI")
|
|
||||||
public static int CRABBY_COLOR = 0;
|
|
||||||
|
|
||||||
@Text(name = "Item 1 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_1_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 1 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_1_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 1 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_1_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 1 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_1_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 2 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_2_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 2 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_2_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 2 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_2_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 2 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_2_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 3 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_3_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 3 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_3_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 3 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_3_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 3 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_3_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 4 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_4_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 4 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_4_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 4 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_4_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 4 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_4_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 5 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_5_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 5 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_5_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 5 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_5_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 5 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_5_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 6 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_6_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 6 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_6_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 6 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_6_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 6 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_6_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 7 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_7_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 7 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_7_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 7 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_7_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 7 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_7_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 8 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_8_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 8 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_8_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 8 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_8_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 8 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_8_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 9 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_9_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 9 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_9_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 9 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_9_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 9 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_9_TIER = "ANY";
|
|
||||||
|
|
||||||
@Text(name = "Item 10 Name", placeholder = "Item Name")
|
|
||||||
public static String ITEM_10_NAME = " ";
|
|
||||||
|
|
||||||
@Text(name = "Item 10 Type", placeholder = "Item Type")
|
|
||||||
public static String ITEM_10_TYPE = "ANY";
|
|
||||||
|
|
||||||
@Number(name = "Item 10 Price", min = 1, max = 1000000000)
|
|
||||||
public static int ITEM_10_PRICE = 1;
|
|
||||||
|
|
||||||
@Text(name = "Item 10 Tier", placeholder = "Item Tier")
|
|
||||||
public static String ITEM_10_TIER = "ANY";
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
package me.night0721.lilase.features.flip;
|
package me.night0721.lilase.features.flipper;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
|
@ -1,4 +1,4 @@
|
||||||
package me.night0721.lilase.features.flip;
|
package me.night0721.lilase.features.flipper;
|
||||||
|
|
||||||
public enum FlipperState {
|
public enum FlipperState {
|
||||||
WALKING_TO_FIRST_POINT, WALKING_INTO_AUCTION_HOUSE, BUYING, START, NONE
|
WALKING_TO_FIRST_POINT, WALKING_INTO_AUCTION_HOUSE, BUYING, START, NONE
|
|
@ -1,15 +1,13 @@
|
||||||
package me.night0721.lilase.features.ah;
|
package me.night0721.lilase.features.sniper;
|
||||||
|
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import me.night0721.lilase.Lilase;
|
import me.night0721.lilase.Lilase;
|
||||||
import me.night0721.lilase.features.flip.Flipper;
|
import me.night0721.lilase.config.ConfigUtils;
|
||||||
import me.night0721.lilase.features.flip.FlipperState;
|
import me.night0721.lilase.features.flipper.Flipper;
|
||||||
import me.night0721.lilase.utils.ConfigUtils;
|
import me.night0721.lilase.features.flipper.FlipperState;
|
||||||
import me.night0721.lilase.utils.DiscordWebhook;
|
import me.night0721.lilase.utils.*;
|
||||||
import me.night0721.lilase.utils.UngrabUtils;
|
|
||||||
import me.night0721.lilase.utils.Utils;
|
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
@ -26,7 +24,7 @@ import java.util.Locale;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import static me.night0721.lilase.features.ah.AHConfig.SEND_MESSAGE;
|
import static me.night0721.lilase.config.AHConfig.SEND_MESSAGE;
|
||||||
|
|
||||||
public class AuctionHouse {
|
public class AuctionHouse {
|
||||||
private Boolean open = false;
|
private Boolean open = false;
|
||||||
|
@ -83,8 +81,9 @@ public class AuctionHouse {
|
||||||
|
|
||||||
public void getItem() throws IOException {
|
public void getItem() throws IOException {
|
||||||
if (!open) return;
|
if (!open) return;
|
||||||
if (!Utils.checkInHub()) {
|
Utils.checkFooter();
|
||||||
Utils.sendMessage("Not in hub, stopping");
|
if (Utils.cookie != EffectState.ON && !Utils.checkInHub()) {
|
||||||
|
Utils.sendMessage("You have no cookie but you are not in hub, stopping");
|
||||||
open = false;
|
open = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
package me.night0721.lilase.utils;
|
package me.night0721.lilase.utils;
|
||||||
|
|
||||||
import me.night0721.lilase.features.ah.AHConfig;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +10,7 @@ import java.awt.*;
|
||||||
|
|
||||||
public class CurrentColor {
|
public class CurrentColor {
|
||||||
public static int currentColorGet(float offset) {
|
public static int currentColorGet(float offset) {
|
||||||
switch (AHConfig.CRABBY_COLOR) {
|
switch (0) {
|
||||||
case 0:
|
case 0:
|
||||||
return getRainbow(-4000, (int) (offset * 3000)).getRGB();
|
return getRainbow(-4000, (int) (offset * 3000)).getRGB();
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -33,10 +31,10 @@ public class CurrentColor {
|
||||||
return Color.WHITE.getRGB();
|
return Color.WHITE.getRGB();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static float getFloatValue(float offset, int color){
|
public static float getFloatValue(float offset, int color) {
|
||||||
Color tempC = new Color(CurrentColor.currentColorGet(offset));
|
Color tempC = new Color(CurrentColor.currentColorGet(offset));
|
||||||
int tempC_ = 0;
|
int tempC_ = 0;
|
||||||
switch (color){
|
switch (color) {
|
||||||
case 0:
|
case 0:
|
||||||
tempC_ = tempC.getRed();
|
tempC_ = tempC.getRed();
|
||||||
break;
|
break;
|
||||||
|
@ -50,19 +48,20 @@ public class CurrentColor {
|
||||||
}
|
}
|
||||||
return (((float) tempC_) / 255F);
|
return (((float) tempC_) / 255F);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Following method has been circulating in Minecraft Hacking Community for a while, making it impossible to trace original author.
|
* Following method has been circulating in Minecraft Hacking Community for a while, making it impossible to trace original author.
|
||||||
*/
|
*/
|
||||||
protected static Color getGradientOffset(final Color color1, final Color color2, double offset) {
|
protected static Color getGradientOffset(final Color color1, final Color color2, double offset) {
|
||||||
if (offset > 1.0) {
|
if (offset > 1.0) {
|
||||||
final double left = offset % 1.0;
|
final double left = offset % 1.0;
|
||||||
final int off = (int)offset;
|
final int off = (int) offset;
|
||||||
offset = ((off % 2 == 0) ? left : (1.0 - left));
|
offset = ((off % 2 == 0) ? left : (1.0 - left));
|
||||||
}
|
}
|
||||||
final double inverse_percent = 1.0 - offset;
|
final double inverse_percent = 1.0 - offset;
|
||||||
final int redPart = (int)(color1.getRed() * inverse_percent + color2.getRed() * offset);
|
final int redPart = (int) (color1.getRed() * inverse_percent + color2.getRed() * offset);
|
||||||
final int greenPart = (int)(color1.getGreen() * inverse_percent + color2.getGreen() * offset);
|
final int greenPart = (int) (color1.getGreen() * inverse_percent + color2.getGreen() * offset);
|
||||||
final int bluePart = (int)(color1.getBlue() * inverse_percent + color2.getBlue() * offset);
|
final int bluePart = (int) (color1.getBlue() * inverse_percent + color2.getBlue() * offset);
|
||||||
return new Color(redPart, greenPart, bluePart);
|
return new Color(redPart, greenPart, bluePart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
5
src/main/java/me/night0721/lilase/utils/EffectState.java
Normal file
5
src/main/java/me/night0721/lilase/utils/EffectState.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package me.night0721.lilase.utils;
|
||||||
|
|
||||||
|
public enum EffectState {
|
||||||
|
ON, OFF, INDETERMINABLE
|
||||||
|
}
|
|
@ -93,6 +93,3 @@ public class Utils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum EffectState {
|
|
||||||
ON, OFF, INDETERMINABLE
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue