From a27815802bd8dbacd2c2050cc7485888b4242c0b Mon Sep 17 00:00:00 2001 From: NK Date: Sun, 26 Feb 2023 19:10:47 +0000 Subject: [PATCH 1/4] more stats in gui, flipped, posted, sniped --- build.gradle | 2 +- src/main/java/me/night0721/lilase/Lilase.java | 3 +-- .../lilase/events/SniperFlipperEvents.java | 18 +++++++++++++++--- .../lilase/features/ah/AuctionHouse.java | 17 +++++++++++++++++ .../lilase/features/flip/Flipper.java | 5 ++++- .../lilase/utils/KeyBindingManager.java | 2 +- 6 files changed, 39 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 2ae6d07..43d1f26 100644 --- a/build.gradle +++ b/build.gradle @@ -21,7 +21,7 @@ apply plugin: "net.minecraftforge.gradle.forge" apply plugin: "com.github.johnrengelman.shadow" apply plugin: "org.spongepowered.mixin" -version = "1.0.22" +version = "1.0.23" group = "me.night0721.lilase" archivesBaseName = "Lilase" sourceCompatibility = 1.8 diff --git a/src/main/java/me/night0721/lilase/Lilase.java b/src/main/java/me/night0721/lilase/Lilase.java index 4643d81..8644a6a 100644 --- a/src/main/java/me/night0721/lilase/Lilase.java +++ b/src/main/java/me/night0721/lilase/Lilase.java @@ -30,14 +30,13 @@ import static me.night0721.lilase.features.ah.AHConfig.RECONNECT_DELAY; public class Lilase { public static final String MOD_NAME = "Lilase"; public static final String MODID = "Lilase"; - public static final String VERSION = "1.0.22"; + public static final String VERSION = "1.0.23"; public static final Minecraft mc = Minecraft.getMinecraft(); public static AuctionHouse auctionHouse; public static AHConfig config; private int tickAmount; private final Clock clock = new Clock(); - @Mod.EventHandler public void init(FMLInitializationEvent event) { KeyBindingManager keyBindingManager = new KeyBindingManager(); diff --git a/src/main/java/me/night0721/lilase/events/SniperFlipperEvents.java b/src/main/java/me/night0721/lilase/events/SniperFlipperEvents.java index 1d9959c..c5af07a 100644 --- a/src/main/java/me/night0721/lilase/events/SniperFlipperEvents.java +++ b/src/main/java/me/night0721/lilase/events/SniperFlipperEvents.java @@ -24,8 +24,12 @@ import net.minecraftforge.fml.common.gameevent.InputEvent; import org.lwjgl.input.Keyboard; import java.io.IOException; +import java.util.ArrayList; import java.util.Calendar; +import java.util.List; import java.util.TimeZone; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import static me.night0721.lilase.features.ah.AHConfig.GUI_COLOR; import static me.night0721.lilase.features.ah.AuctionHouse.flipper; @@ -36,10 +40,13 @@ import static me.night0721.lilase.utils.PlayerUtils.sendPacketWithoutEvent; public class SniperFlipperEvents { private int windowId = 1; private boolean buying = false; - + private boolean bought = false; + private final Pattern boughtPattern = Pattern.compile("^(.*?) bought (.*?) for ([\\d,]+) coins CLICK$"); + public static List postedNames = new ArrayList<>(); @SubscribeEvent public void onChat(ClientChatReceivedEvent event) throws InterruptedException, IOException { String message = event.message.getUnformattedText(); + Matcher matcher = boughtPattern.matcher(message); if (!message.contains(":")) { if (message.equals("You didn't participate in this auction!")) { Utils.debugLog("[Sniper] Failed to buy item, not fast enough. Closing the menu"); @@ -52,7 +59,7 @@ public class SniperFlipperEvents { Utils.debugLog("[Sniper] Saved new API key to config"); String apiKey = message.replace("Your new API key is ", ""); ConfigUtils.writeStringConfig("main", "APIKey", apiKey); - } else if (message.equals("Claiming BIN auction...") && buying) { + } else if (message.equals("Claiming BIN auction...") && bought) { Utils.debugLog("[Sniper] Bought an item, starting to sell"); Lilase.auctionHouse.webhook.execute(); flipper.sellItem(); @@ -75,6 +82,8 @@ public class SniperFlipperEvents { Utils.sendServerMessage("/hub"); Thread bzchillingthread = new Thread(bazaarChilling); bzchillingthread.start(); + } else if (matcher.matches() && postedNames.contains(matcher.group(2))) { + Lilase.auctionHouse.incrementAuctionsFlipped(); } } } @@ -164,7 +173,9 @@ public class SniperFlipperEvents { "Z: " + Math.round(Lilase.mc.thePlayer.posZ) + "\n" + time + "\n" + "FPS: " + Minecraft.getDebugFPS() + "\n" + - "Auctions Sniped: " + Lilase.auctionHouse.getAuctionsSniped(); + "Auctions Sniped: " + Lilase.auctionHouse.getAuctionsSniped() + "\n" + + "Auctions Posted: " + Lilase.auctionHouse.getAuctionsPosted() + "\n" + + "Auctions Flipped: " + Lilase.auctionHouse.getAuctionsFlipped() + "\n"; TextRenderer.drawString(lines, 0, 0, 1.5, GUI_COLOR.getRGB()); } } @@ -188,6 +199,7 @@ public class SniperFlipperEvents { if (buying && "Confirm Purchase".equals(windowName)) { Lilase.mc.playerController.windowClick(windowId + 1, 11, 0, 0, Lilase.mc.thePlayer); buying = false; + bought = true; } } } diff --git a/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java b/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java index 89a3c1c..4328632 100644 --- a/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java +++ b/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java @@ -28,6 +28,8 @@ public class AuctionHouse { private String message_toSend; private Boolean open = false; private int auctionsSniped = 0; + private int auctionsPosted = 0; + private int auctionsFlipped = 0; public DiscordWebhook webhook = new DiscordWebhook(ConfigUtils.getString("main", "Webhook")); private final List items = new ArrayList<>(); private final List posted = new ArrayList<>(); @@ -230,6 +232,21 @@ public class AuctionHouse { public void incrementAuctionsSniped() { this.auctionsSniped += 1; } + public int getAuctionsPosted() { + return auctionsPosted; + } + + public void incrementAuctionsPosted() { + this.auctionsPosted += 1; + } + + public int getAuctionsFlipped() { + return auctionsFlipped; + } + + public void incrementAuctionsFlipped() { + this.auctionsFlipped += 1; + } } diff --git a/src/main/java/me/night0721/lilase/features/flip/Flipper.java b/src/main/java/me/night0721/lilase/features/flip/Flipper.java index fbd0f07..f09350f 100644 --- a/src/main/java/me/night0721/lilase/features/flip/Flipper.java +++ b/src/main/java/me/night0721/lilase/features/flip/Flipper.java @@ -1,6 +1,7 @@ package me.night0721.lilase.features.flip; import me.night0721.lilase.Lilase; +import me.night0721.lilase.events.SniperFlipperEvents; import me.night0721.lilase.utils.*; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityArmorStand; @@ -41,6 +42,7 @@ public class Flipper { } public void sellItem() { + Lilase.auctionHouse.incrementAuctionsSniped(); Utils.sendMessage("Flipper is running, stopping, will resume when flipper is done"); if (Lilase.auctionHouse.getOpen()) Lilase.auctionHouse.toggleAuction(); UngrabUtils.ungrabMouse(); @@ -125,7 +127,8 @@ public class Flipper { buyWait.schedule(1000); } else if (InventoryUtils.inventoryNameContains("BIN Auction View") && buyWait.passed()) { InventoryUtils.clickOpenContainerSlot(49); - Lilase.auctionHouse.incrementAuctionsSniped(); + Lilase.auctionHouse.incrementAuctionsPosted(); + SniperFlipperEvents.postedNames.add(itemname); buyWait.schedule(500); Lilase.mc.thePlayer.closeScreen(); buyWait.schedule(500); diff --git a/src/main/java/me/night0721/lilase/utils/KeyBindingManager.java b/src/main/java/me/night0721/lilase/utils/KeyBindingManager.java index b2b80c8..1de6d4c 100644 --- a/src/main/java/me/night0721/lilase/utils/KeyBindingManager.java +++ b/src/main/java/me/night0721/lilase/utils/KeyBindingManager.java @@ -69,4 +69,4 @@ public class KeyBindingManager { KeyBinding.setKeyBindState(Lilase.mc.gameSettings.keyBindJump.getKeyCode(), false); } -} +} \ No newline at end of file From fd2ff01554e5a79300d8556065af76242eea67a3 Mon Sep 17 00:00:00 2001 From: NK Date: Sun, 26 Feb 2023 19:14:24 +0000 Subject: [PATCH 2/4] putting back gradle and update mcmod.info --- gradlew | 169 ++++++++++++++++++++++++++++++++++ gradlew.bat | 84 +++++++++++++++++ settings.gradle | 28 ++++++ src/main/resources/mcmod.info | 9 +- 4 files changed, 285 insertions(+), 5 deletions(-) create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 settings.gradle diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..6d17c64 --- /dev/null +++ b/gradlew @@ -0,0 +1,169 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" \ No newline at end of file diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..dee787c --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..44938e9 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,28 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + + maven { + name = "Forge" + url = "https://maven.minecraftforge.net" + } + + maven { + name = "Jitpack" + url = "https://jitpack.io/" + } + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "net.minecraftforge.gradle.forge") { + useModule("com.github.realfork:ForgeGradle:${requested.version}") + } + if (requested.id.id == "org.spongepowered.mixin") { + useModule("com.github.xcfrg:MixinGradle:${requested.version}") + } + } + } +} + +rootProject.name = "Lilase" \ No newline at end of file diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1962a4c..d23aa12 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,15 +2,14 @@ { "modid": "Lilase", "name": "Lilase", - "description": "AH Flipper Mod", + "description": "AH Sniper/Flipper", "version": "${version}", "mcversion": "1.8.9", - "url": "https://github.com/night0721", - "updateUrl": "https://github.com/night0721", + "url": "https://github.com/night0721/Lilase", + "updateUrl": "https://github.com/night0721/Lilase/releases", "authorList": ["night0721"], - "credits": "FarmHelper/JellyLab", + "credits": "JellyLab/FarmHelper", "logoFile": "", - "description": "Lilac", "screenshots": [], "dependencies": [] } From ba67b27c83ffa1d6340af4b4f51be5c9ba0b658b Mon Sep 17 00:00:00 2001 From: NK Date: Sun, 26 Feb 2023 19:15:50 +0000 Subject: [PATCH 3/4] typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6cb23fd..0726c17 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Forge mod will automatiaclly buy item according to your configuration, and send - Failsafe in Limbo - Auto reconnect to server when disconnected - Auto skip confirmation screen -- GUI showing coordinates, fps and clock and more error +- GUI showing coordinates, fps and clock and stats like auctions bought, sniped, flipped - Auto ungrab mouse when sniping/flipping - Auto movement during sniping so hypixel won't send to afk From 1aeb8ae82bf4511f22f87e0ba0b4db3c4c7a5e93 Mon Sep 17 00:00:00 2001 From: NK Date: Sun, 26 Feb 2023 19:47:16 +0000 Subject: [PATCH 4/4] changing motion to random head rotation as it moving looks more fake --- .../lilase/features/ah/AuctionHouse.java | 24 +++++++++---------- .../lilase/features/flip/Flipper.java | 2 +- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java b/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java index cf43752..1c8b8b5 100644 --- a/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java +++ b/src/main/java/me/night0721/lilase/features/ah/AuctionHouse.java @@ -2,7 +2,10 @@ package me.night0721.lilase.features.ah; import me.night0721.lilase.Lilase; import me.night0721.lilase.features.flip.Flipper; -import me.night0721.lilase.utils.*; +import me.night0721.lilase.utils.ConfigUtils; +import me.night0721.lilase.utils.DiscordWebhook; +import me.night0721.lilase.utils.UngrabUtils; +import me.night0721.lilase.utils.Utils; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -23,9 +26,9 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static me.night0721.lilase.features.flip.Flipper.rotation; + public class AuctionHouse { - private String uuid; - private String message_toSend; private Boolean open = false; private int auctionsSniped = 0; private int auctionsPosted = 0; @@ -86,8 +89,8 @@ public class AuctionHouse { open = false; return; } - Utils.debugLog("[Sniper] Randomizing motion as we don't want to be AFK"); - KeyBindingManager.leftClick(); + Utils.debugLog("[Sniper] Doing some motion as we don't want to be AFK"); + rotation.easeTo(Lilase.mc.thePlayer.rotationYaw + 1, Lilase.mc.thePlayer.rotationPitch, 500); URL url = new URL("https://api.hypixel.net/skyblock/auctions"); HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestProperty("Content-Type", "application/json"); @@ -151,18 +154,16 @@ public class AuctionHouse { String updated = matcher.replaceAll(""); webhook.addEmbed(new DiscordWebhook.EmbedObject().setTitle("Bought an item on low price").setUrl("https://sky.coflnet.com/auction/" + auction.getString("uuid")).setAuthor("night0721", "https://github.com/night0721", "https://avatars.githubusercontent.com/u/77528305?v=4").setDescription(updated.replace("\n", "\\n")).addField("Item", auction.getString("item_name"), true).addField("Price", format.format(auction.getInt("starting_bid")) + " coins", true).addField("Seller", profile.getJSONObject("player").getString("displayname"), true).addField("Started for", toDuration(System.currentTimeMillis() - auction.getLong("start")), true).addField("Ends in", getTimeSinceDate(auction.getLong("end") - System.currentTimeMillis()), true).setColor(Color.decode("#003153"))); webhook.setContent(auction.getString("item_name") + " is sale at " + format.format(auction.getInt("starting_bid")) + "! `" + "/viewauction " + auction.getString("uuid") + "`"); - uuid = auction.getString("uuid"); - message_toSend = "Auction House: " + auction.getString("item_name") + " is sale for " + format.format(auction.getInt("starting_bid")) + "!"; if (ConfigUtils.getBoolean("main", "checkMultiplierBeforeBuy")) { float multi = flipper.checkMultiplier(); Utils.debugLog("[Sniper] Found an item, checking profit multiplier"); if (multi > ConfigUtils.getInt("main", "Multiplier")) { Utils.debugLog("[Sniper] Higher than required multiplier, buying now"); - sendAuction(); + Utils.sendServerMessage("/viewauction " + auction.getString("uuid")); } } else { Utils.debugLog("[Sniper] Found an item, trying to buy"); - sendAuction(); + Utils.sendServerMessage("/viewauction " + auction.getString("uuid")); } return; } @@ -170,10 +171,6 @@ public class AuctionHouse { } } - private void sendAuction() { - Utils.sendServerMessage("/viewauction " + uuid); - Utils.sendMessage(message_toSend); - } private final List times = Arrays.asList(TimeUnit.DAYS.toMillis(365), TimeUnit.DAYS.toMillis(30), TimeUnit.DAYS.toMillis(1), TimeUnit.HOURS.toMillis(1), TimeUnit.MINUTES.toMillis(1), TimeUnit.SECONDS.toMillis(1)); private final List timesString = Arrays.asList("year", "month", "day", "hour", "minute", "second"); @@ -233,6 +230,7 @@ public class AuctionHouse { public void incrementAuctionsSniped() { this.auctionsSniped += 1; } + public int getAuctionsPosted() { return auctionsPosted; } diff --git a/src/main/java/me/night0721/lilase/features/flip/Flipper.java b/src/main/java/me/night0721/lilase/features/flip/Flipper.java index f09350f..a6a7566 100644 --- a/src/main/java/me/night0721/lilase/features/flip/Flipper.java +++ b/src/main/java/me/night0721/lilase/features/flip/Flipper.java @@ -99,7 +99,7 @@ public class Flipper { } else if (InventoryUtils.inventoryNameContains("Create BIN Auction")) { if (InventoryUtils.isStoneButton() && buyWait.passed()) { if (InventoryUtils.getSlotForItem(itemname) == -1) { - Utils.sendMessage("Cannot find item in inventory, stopping flipper"); + Utils.debugLog("[Flipper] Cannot find item in inventory, stopping flipper"); state = FlipperState.NONE; Lilase.auctionHouse.setOpen(true); return;