fix on flipper

This commit is contained in:
NK 2023-03-06 19:29:10 +00:00
parent 432b1575ed
commit 5c80025ecd
8 changed files with 21 additions and 21 deletions

View file

@ -1,7 +1,12 @@
<h1> Auction House Flipper - Lilase</h1> <h1> Auction House Flipper - Lilase</h1>
Forge mod will automatiaclly buy item according to your configuration, and send you a webhook when it has been bought. <div style="text-align: center;">
If you have any questions please join https://night0721.me/discord for support <img align="center" src="https://cdn.discordapp.com/attachments/842014909264953354/1082373275038003210/lilase.png" width="300" />
For how to use https://github.com/night0721/lilase#how-to-use </div>
# Introduction:
A simple Forge mod will automatiaclly buy item according to your configuration, and send you a webhook when it has been bought.
If you have any questions please join [Discord Server](https://night0721.me/discord) for support
For how to use, see **[here](https://github.com/night0721/lilase#how-to-use)**
# Features: # Features:
- Auto buy any item you want, with query customised by yourself - Auto buy any item you want, with query customised by yourself

View file

@ -1,5 +1,4 @@
buildscript { buildscript {
ext.kotlin_version = "1.6.10"
repositories { repositories {
jcenter() jcenter()
maven { maven {
@ -13,20 +12,16 @@ buildscript {
classpath "com.github.Skytils:ForgeGradle:41dfce0a70" classpath "com.github.Skytils:ForgeGradle:41dfce0a70"
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0" classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
classpath "com.github.debuggingss:MixinGradle:0.6-SNAPSHOT" classpath "com.github.debuggingss:MixinGradle:0.6-SNAPSHOT"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }
} }
apply plugin: 'kotlin'
apply plugin: "net.minecraftforge.gradle.forge" apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "com.github.johnrengelman.shadow" apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "org.spongepowered.mixin" apply plugin: "org.spongepowered.mixin"
version = "1.0.25" version = "1.0.25"
group = "me.night0721.lilase" group = "me.night0721.lilase"
archivesBaseName = "Lilase" archivesBaseName = "Lilase"

View file

@ -221,8 +221,6 @@ 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)) {

View file

@ -185,21 +185,22 @@ public class AuctionHouse {
if (profileName.equalsIgnoreCase(Lilase.mc.thePlayer.getName())) break; if (profileName.equalsIgnoreCase(Lilase.mc.thePlayer.getName())) break;
String updated = auction.get("item_lore").getAsString().replaceAll("§[0-9a-z]", ""); String updated = auction.get("item_lore").getAsString().replaceAll("§[0-9a-z]", "");
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");
webhook.addEmbed(new DiscordWebhook.EmbedObject().setTitle("Bought an item on low price").setUrl("https://sky.coflnet.com/auction/" + uuid).setAuthor("night0721", "https://github.com/night0721", "https://avatars.githubusercontent.com/u/77528305?v=4").setDescription(updated.replace("\n", "\\n")).addField("Item", itemName, true).addField("Price", format.format(price) + " coins", true).addField("Profit", format.format(flipper.getItemPrice() - price) + " coins", true).addField("Profit Percentage", Float.parseFloat(df.format(flipper.getItemPrice() - price)) + "%", true).addField("Seller", profileName, true).addField("Started for", toDuration(System.currentTimeMillis() - auction.get("start").getAsLong()), true).addField("Ends in", getTimeSinceDate(auction.get("end").getAsLong() - System.currentTimeMillis()), true).setColor(Color.decode("#003153")));
webhook.setContent(itemName + " is sale at " + format.format(price) + "! `" + "/viewauction " + uuid + "`");
if (ConfigUtils.getBoolean("main", "checkProfitPercentageBeforeBuy")) { if (ConfigUtils.getBoolean("main", "checkProfitPercentageBeforeBuy")) {
float multi = flipper.checkProfitPercentage(); float multi = flipper.checkProfitPercentage();
Utils.debugLog("[Sniper] Found an item, checking profit percentage"); Utils.debugLog("[Sniper] Found an item, checking profit percentage");
if (multi > ConfigUtils.getInt("main", "ProfitPercentage")) { if (multi > ConfigUtils.getInt("main", "ProfitPercentage")) {
Utils.debugLog("[Sniper] Higher than required profit percentage, buying now"); Utils.debugLog("[Sniper] Higher than required profit percentage, buying now");
Utils.sendServerMessage("/viewauction " + uuid);
buying = true; buying = true;
} }
} else { } else {
Utils.debugLog("[Sniper] Found an item, trying to buy"); Utils.debugLog("[Sniper] Found an item, trying to buy");
Utils.sendServerMessage("/viewauction " + uuid);
buying = true; buying = true;
} }
if (buying) {
Utils.sendServerMessage("/viewauction " + uuid);
webhook.addEmbed(new DiscordWebhook.EmbedObject().setTitle("Bought an item on low price").setUrl("https://sky.coflnet.com/auction/" + uuid).setAuthor("night0721", "https://github.com/night0721", "https://avatars.githubusercontent.com/u/77528305?v=4").setDescription(updated.replace("\n", "\\n")).addField("Item", itemName, true).addField("Price", format.format(price) + " coins", true).addField("Profit", format.format(flipper.getItemPrice() - price) + " coins", true).addField("Profit Percentage", Float.parseFloat(df.format(flipper.getItemPrice() - price)) + "%", true).addField("Seller", profileName, true).addField("Started for", toDuration(System.currentTimeMillis() - auction.get("start").getAsLong()), true).addField("Ends in", getTimeSinceDate(auction.get("end").getAsLong() - System.currentTimeMillis()), true).setColor(Color.decode("#003153")));
webhook.setContent(itemName + " is sale at " + format.format(price) + "! `" + "/viewauction " + uuid + "`");
}
return; return;
} }
} }

View file

@ -60,11 +60,11 @@ public class Flipper {
if (Lilase.mc.currentScreen != null) { if (Lilase.mc.currentScreen != null) {
Lilase.mc.thePlayer.closeScreen(); Lilase.mc.thePlayer.closeScreen();
} else if (distanceToFirstPoint() < 0.7f) { } else if (distanceToFirstPoint() < 0.7f) {
Utils.debugLog("[Flipper] Moving to auction house"); System.out.println("[Flipper] Moving to auction house");
KeyBindingManager.updateKeys(false, false, false, false, false); KeyBindingManager.updateKeys(false, false, false, false, false);
state = FlipperState.WALKING_INTO_AUCTION_HOUSE; state = FlipperState.WALKING_INTO_AUCTION_HOUSE;
} else if (distanceToFirstPoint() < 5f) { } else if (distanceToFirstPoint() < 5f) {
Utils.debugLog("[Flipper] Crouching to point 1"); System.out.println("[Flipper] Crouching to point 1");
KeyBindingManager.updateKeys(true, false, false, false, false, true, false); KeyBindingManager.updateKeys(true, false, false, false, false, true, false);
} else { } else {
KeyBindingManager.updateKeys(true, false, false, false, false); KeyBindingManager.updateKeys(true, false, false, false, false);
@ -74,14 +74,14 @@ public class Flipper {
if (Lilase.mc.currentScreen != null) { if (Lilase.mc.currentScreen != null) {
Lilase.mc.thePlayer.closeScreen(); Lilase.mc.thePlayer.closeScreen();
} else if (AngleUtils.smallestAngleDifference(AngleUtils.get360RotationYaw(), 88f) > 1.2) { } else if (AngleUtils.smallestAngleDifference(AngleUtils.get360RotationYaw(), 88f) > 1.2) {
Utils.debugLog("[Flipper] Rotating to Auction Master"); System.out.println("[Flipper] Rotating to Auction Master");
rotation.easeTo(88f, Lilase.mc.thePlayer.rotationPitch, 500); rotation.easeTo(88f, Lilase.mc.thePlayer.rotationPitch, 500);
} else if (distanceToAuctionMaster() < 0.7f) { } else if (distanceToAuctionMaster() < 0.7f) {
Utils.debugLog("[Flipper] At Auction Master, opening shop"); Utils.debugLog("[Flipper] At Auction Master, opening shop");
KeyBindingManager.updateKeys(false, false, false, false, false); KeyBindingManager.updateKeys(false, false, false, false, false);
state = FlipperState.BUYING; state = FlipperState.BUYING;
} else if (distanceToAuctionMaster() < 5f) { } else if (distanceToAuctionMaster() < 5f) {
Utils.debugLog("[Flipper] Crouching to Auction Master"); System.out.println("[Flipper] Crouching to Auction Master");
KeyBindingManager.updateKeys(true, false, false, false, false, true, false); KeyBindingManager.updateKeys(true, false, false, false, false, true, false);
} else { } else {
KeyBindingManager.updateKeys(true, false, false, false, false); KeyBindingManager.updateKeys(true, false, false, false, false);
@ -164,6 +164,7 @@ public class Flipper {
in.close(); in.close();
connection.disconnect(); connection.disconnect();
object = (JsonObject) new JsonParser().parse(content.toString()); object = (JsonObject) new JsonParser().parse(content.toString());
System.out.println("Price" + object.get("price"));
return (JsonObject) new JsonParser().parse(content.toString()); return (JsonObject) new JsonParser().parse(content.toString());
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

@ -1,15 +1,15 @@
[ [
{ {
"modid": "Lilase", "modid": "Lilase",
"name": "Lilase", "name": "§dLilase",
"description": "AH Sniper/Flipper", "description": "§dAH Sniper/Flipper",
"version": "${version}", "version": "${version}",
"mcversion": "1.8.9", "mcversion": "1.8.9",
"url": "https://github.com/night0721/Lilase", "url": "https://github.com/night0721/Lilase",
"updateUrl": "https://github.com/night0721/Lilase/releases", "updateUrl": "https://github.com/night0721/Lilase/releases",
"authorList": ["night0721"], "authorList": ["night0721"],
"credits": "JellyLab/FarmHelper", "credits": "JellyLab/FarmHelper",
"logoFile": "", "logoFile": "lilase.png",
"screenshots": [], "screenshots": [],
"dependencies": [] "dependencies": []
} }