Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
a2dfc5c4ef
11 changed files with 475 additions and 27 deletions
|
@ -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
|
||||
|
||||
|
|
139
build.gradle
Normal file
139
build.gradle
Normal file
|
@ -0,0 +1,139 @@
|
|||
buildscript {
|
||||
ext.kotlin_version = "1.6.10"
|
||||
repositories {
|
||||
jcenter()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "https://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven { url "https://jitpack.io" }
|
||||
maven { url "https://repo.spongepowered.org/repository/maven-public/" }
|
||||
}
|
||||
dependencies {
|
||||
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.23"
|
||||
group = "me.night0721.lilase"
|
||||
archivesBaseName = "Lilase"
|
||||
sourceCompatibility = 1.8
|
||||
compileJava.options.encoding = "UTF-8"
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
minecraft {
|
||||
version = "1.8.9-11.15.1.2318-1.8.9"
|
||||
runDir = "run"
|
||||
mappings = "stable_22"
|
||||
makeObfSourceJar = false
|
||||
|
||||
replace "@VERSION@": project.version
|
||||
|
||||
clientRunArgs += ["--tweakClass cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker", "--mixin mixins.night0721.json"]
|
||||
}
|
||||
|
||||
configurations {
|
||||
include
|
||||
implementation.extendsFrom(include)
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url "https://jitpack.io/" }
|
||||
maven { url "https://repo.spongepowered.org/repository/maven-public/" }
|
||||
maven { url "https://repo.sk1er.club/repository/maven-public" }
|
||||
maven { url "https://repo.sk1er.club/repository/maven-releases/" }
|
||||
maven { url "https://storehouse.okaeri.eu/repository/maven-public/" }
|
||||
maven { url "https://repo.polyfrost.cc/releases" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("gg.essential:essential-1.8.9-forge:2581")
|
||||
include("gg.essential:loader-launchwrapper:1.1.3")
|
||||
implementation("org.spongepowered:mixin:0.7.11-SNAPSHOT")
|
||||
annotationProcessor("org.spongepowered:mixin:0.7.11-SNAPSHOT")
|
||||
include("org.apache.commons:commons-collections4:4.4")
|
||||
include("org.json:json:20220924")
|
||||
|
||||
compileOnly('cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+')
|
||||
include("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta9")
|
||||
|
||||
include(fileTree(dir: "libs", include: "*.jar"))
|
||||
implementation(fileTree(dir: "libs", include: "*.jar"))
|
||||
}
|
||||
|
||||
mixin {
|
||||
disableRefMapWarning = true
|
||||
defaultObfuscationEnv searge
|
||||
add sourceSets.main, "mixins.night0721.refmap.json"
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest.attributes("FMLCorePluginContainsFMLMod": true,
|
||||
"FMLCorePlugin": "me.night0721.lilase.mixins.MixinLoader",
|
||||
"ForceLoadAsMod": true,
|
||||
"MixinConfigs": "mixins.night0721.json",
|
||||
"ModSide": "CLIENT",
|
||||
"TweakClass": "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker",
|
||||
"TweakOrder": "0")
|
||||
enabled = false
|
||||
}
|
||||
|
||||
sourceJar {
|
||||
enabled = false
|
||||
}
|
||||
shadowJar {
|
||||
archiveClassifier.set("")
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
configurations = [project.configurations.include]
|
||||
|
||||
exclude "LICENSE.md"
|
||||
exclude "pack.mcmeta"
|
||||
exclude "dummyThing"
|
||||
exclude "**/module-info.class"
|
||||
exclude "*.so"
|
||||
exclude "*.dylib"
|
||||
exclude "*.dll"
|
||||
exclude "*.jnilib"
|
||||
exclude "ibxm/**"
|
||||
exclude "com/jcraft/**"
|
||||
exclude "org/lwjgl/**"
|
||||
exclude "net/java/**"
|
||||
|
||||
exclude "META-INF/proguard/**"
|
||||
exclude "META-INF/maven/**"
|
||||
exclude "META-INF/versions/**"
|
||||
exclude "META-INF/com.android.tools/**"
|
||||
|
||||
exclude "fabric.mod.json"
|
||||
}
|
||||
tasks.reobfJar.dependsOn tasks.shadowJar
|
||||
reobf {
|
||||
shadowJar {
|
||||
classpath = sourceSets.main.compileClasspath
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include "mcmod.info"
|
||||
expand "version": project.version, "mcversion": project.minecraft.version
|
||||
}
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude "mcmod.info"
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main { output.resourcesDir = java.outputDir }
|
||||
}
|
169
gradlew
vendored
Normal file
169
gradlew
vendored
Normal file
|
@ -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 "$@"
|
84
gradlew.bat
vendored
Normal file
84
gradlew.bat
vendored
Normal file
|
@ -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
|
28
settings.gradle
Normal file
28
settings.gradle
Normal file
|
@ -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"
|
|
@ -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();
|
||||
|
|
|
@ -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<String> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,11 +26,13 @@ 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;
|
||||
private int auctionsFlipped = 0;
|
||||
public DiscordWebhook webhook = new DiscordWebhook(ConfigUtils.getString("main", "Webhook"));
|
||||
private final List<Item> items = new ArrayList<>();
|
||||
private final List<String> posted = new ArrayList<>();
|
||||
|
@ -84,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");
|
||||
|
@ -149,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;
|
||||
}
|
||||
|
@ -168,10 +171,6 @@ public class AuctionHouse {
|
|||
}
|
||||
}
|
||||
|
||||
private void sendAuction() {
|
||||
Utils.sendServerMessage("/viewauction " + uuid);
|
||||
Utils.sendMessage(message_toSend);
|
||||
}
|
||||
|
||||
private final List<Long> 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<String> timesString = Arrays.asList("year", "month", "day", "hour", "minute", "second");
|
||||
|
@ -231,6 +230,22 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
@ -97,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;
|
||||
|
@ -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);
|
||||
|
|
|
@ -69,4 +69,4 @@ public class KeyBindingManager {
|
|||
KeyBinding.setKeyBindState(Lilase.mc.gameSettings.keyBindJump.getKeyCode(), false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -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": []
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue