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>
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 https://night0721.me/discord for support
For how to use https://github.com/night0721/lilase#how-to-use
<div style="text-align: center;">
<img align="center" src="https://cdn.discordapp.com/attachments/842014909264953354/1082373275038003210/lilase.png" width="300" />
</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:
- Auto buy any item you want, with query customised by yourself

View file

@ -1,5 +1,4 @@
buildscript {
ext.kotlin_version = "1.6.10"
repositories {
jcenter()
maven {
@ -13,20 +12,16 @@ buildscript {
classpath "com.github.Skytils:ForgeGradle:41dfce0a70"
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
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: "com.github.johnrengelman.shadow"
apply plugin: "org.spongepowered.mixin"
version = "1.0.25"
group = "me.night0721.lilase"
archivesBaseName = "Lilase"

View file

@ -221,8 +221,6 @@ public class SniperFlipperEvents {
}
}
}
@SubscribeEvent
public void onPacketReceive(PacketReceivedEvent event) {
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;
String updated = auction.get("item_lore").getAsString().replaceAll("§[0-9a-z]", "");
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")) {
float multi = flipper.checkProfitPercentage();
Utils.debugLog("[Sniper] Found an item, checking profit percentage");
if (multi > ConfigUtils.getInt("main", "ProfitPercentage")) {
Utils.debugLog("[Sniper] Higher than required profit percentage, buying now");
Utils.sendServerMessage("/viewauction " + uuid);
buying = true;
}
} else {
Utils.debugLog("[Sniper] Found an item, trying to buy");
Utils.sendServerMessage("/viewauction " + uuid);
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;
}
}

View file

@ -60,11 +60,11 @@ public class Flipper {
if (Lilase.mc.currentScreen != null) {
Lilase.mc.thePlayer.closeScreen();
} 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);
state = FlipperState.WALKING_INTO_AUCTION_HOUSE;
} 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);
} else {
KeyBindingManager.updateKeys(true, false, false, false, false);
@ -74,14 +74,14 @@ public class Flipper {
if (Lilase.mc.currentScreen != null) {
Lilase.mc.thePlayer.closeScreen();
} 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);
} else if (distanceToAuctionMaster() < 0.7f) {
Utils.debugLog("[Flipper] At Auction Master, opening shop");
KeyBindingManager.updateKeys(false, false, false, false, false);
state = FlipperState.BUYING;
} 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);
} else {
KeyBindingManager.updateKeys(true, false, false, false, false);
@ -164,6 +164,7 @@ public class Flipper {
in.close();
connection.disconnect();
object = (JsonObject) new JsonParser().parse(content.toString());
System.out.println("Price" + object.get("price"));
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",
"name": "Lilase",
"description": "AH Sniper/Flipper",
"name": "§dLilase",
"description": "§dAH Sniper/Flipper",
"version": "${version}",
"mcversion": "1.8.9",
"url": "https://github.com/night0721/Lilase",
"updateUrl": "https://github.com/night0721/Lilase/releases",
"authorList": ["night0721"],
"credits": "JellyLab/FarmHelper",
"logoFile": "",
"logoFile": "lilase.png",
"screenshots": [],
"dependencies": []
}