From 97c24856b3bf411ddc25ae2aed87461e2dd4b6a3 Mon Sep 17 00:00:00 2001 From: mqtze Date: Mon, 2 Sep 2024 08:20:52 +0200 Subject: [PATCH 1/3] fixed description of visitorsExchangeTravelMethod --- .../java/com/jelly/farmhelperv2/config/FarmHelperConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java index ce338fe2..84624463 100644 --- a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java +++ b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java @@ -1019,7 +1019,7 @@ public class FarmHelperConfig extends Config { public static boolean visitorsExchangeTravelMethodInfo; @DualOption( name = "Travel method", category = VISITORS_MACRO, subcategory = "Visitors Macro", - description = "The travel method to use to get to the pest exchange desk", + description = "The travel method to use to get to the visitor stand", left = "Fly", right = "Walk" ) From 3016fe4cbdb91d343e3e2eb53d7bb83bb2759ff4 Mon Sep 17 00:00:00 2001 From: mqtze Date: Mon, 2 Sep 2024 08:21:30 +0200 Subject: [PATCH 2/3] Revert "fixed description of visitorsExchangeTravelMethod" This reverts commit 97c24856b3bf411ddc25ae2aed87461e2dd4b6a3. --- .../java/com/jelly/farmhelperv2/config/FarmHelperConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java index 84624463..ce338fe2 100644 --- a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java +++ b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java @@ -1019,7 +1019,7 @@ public class FarmHelperConfig extends Config { public static boolean visitorsExchangeTravelMethodInfo; @DualOption( name = "Travel method", category = VISITORS_MACRO, subcategory = "Visitors Macro", - description = "The travel method to use to get to the visitor stand", + description = "The travel method to use to get to the pest exchange desk", left = "Fly", right = "Walk" ) From a7c17e7b5f49b031f4bb38f72661c46fb4e5b7da Mon Sep 17 00:00:00 2001 From: mqtze Date: Mon, 2 Sep 2024 15:30:04 +0200 Subject: [PATCH 3/3] added config dependencies --- .../farmhelperv2/config/FarmHelperConfig.java | 9 +++++++++ .../farmhelperv2/feature/impl/AutoComposter.java | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java index ce338fe2..1e0adc3a 100644 --- a/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java +++ b/src/main/java/com/jelly/farmhelperv2/config/FarmHelperConfig.java @@ -2337,6 +2337,15 @@ public FarmHelperConfig() { this.addDependency("sprintWhileFlying", "enablePestsDestroyer"); this.addDependency("pausePestsDestroyerDuringJacobsContest", "enablePestsDestroyer"); + this.addDependency("pauseAutoComposterDuringJacobsContest","autoComposter"); + this.addDependency("autoComposterMinMoney","autoComposter"); + this.addDependency("autoComposterMaxSpendLimit","autoComposter"); + this.addDependency("autoComposterOrganicMatterLeft","autoComposter"); + this.addDependency("autoComposterFuelLeft","autoComposter"); + this.addDependency("autoComposterAutosellBeforeFilling","autoComposter"); + this.addDependency("logAutoComposterEvents","enableWebHook"); + this.addDependency("triggerManuallyAutoComposter","autoComposter"); + this.hideIf("infoCookieBuffRequired", () -> GameStateHandler.getInstance().inGarden() || GameStateHandler.getInstance().getCookieBuffState() == BuffState.NOT_ACTIVE); diff --git a/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoComposter.java b/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoComposter.java index 32cfd501..73868a63 100644 --- a/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoComposter.java +++ b/src/main/java/com/jelly/farmhelperv2/feature/impl/AutoComposter.java @@ -139,6 +139,12 @@ public void stop() { @Override public void resetStatesAfterMacroDisabled() { + mainState = MainState.NONE; + travelState = TravelState.NONE; + composterState = ComposterState.NONE; + composterChecked = false; + buyState = BuyState.NONE; + itemsToBuy.clear(); if (!FarmHelperConfig.autoComposterAfkInfiniteMode) return; FarmHelperConfig.autoComposterAfkInfiniteMode = false; afkDelay.reset(); @@ -466,6 +472,7 @@ public void onComposterState() { break; } if (invName.contains("Composter")) { + LogUtils.sendDebug("[Auto Composter] Checking Composter"); Slot organicMatterSlot = InventoryUtils.getSlotOfIdInContainer(37); Slot fuelSlot = InventoryUtils.getSlotOfIdInContainer(43); if (organicMatterSlot == null || fuelSlot == null) break; @@ -508,7 +515,7 @@ public void onComposterState() { if (currentFuel == -1) break; int amountFuel = (maxFuel - currentFuel) / voltaFuel; if (amountFuel > 0) { - itemsToBuy.add(Pair.of("Volta", amountFuel)); //TODO oil barrel or volta which is cheaper + itemsToBuy.add(Pair.of("Volta", amountFuel)); } composterChecked = true; PlayerUtils.closeScreen(); @@ -532,7 +539,7 @@ public void onComposterState() { if (invName2.contains("Composter")) { ContainerChest chest = (ContainerChest) mc.thePlayer.openContainer; int boughtOrganicMatterSlot = InventoryUtils.getSlotIdOfItemInContainer("Box of Seeds"); - int boughtFuelSlot = InventoryUtils.getSlotIdOfItemInContainer("Volta"); //TODO if change to buy cheaper of volta / oil barrel + int boughtFuelSlot = InventoryUtils.getSlotIdOfItemInContainer("Volta"); if (boughtOrganicMatterSlot != -1) { InventoryUtils.clickSlotWithId(boughtOrganicMatterSlot, InventoryUtils.ClickType.LEFT, InventoryUtils.ClickMode.PICKUP, chest.windowId); delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay()); @@ -541,6 +548,10 @@ public void onComposterState() { InventoryUtils.clickSlotWithId(boughtFuelSlot, InventoryUtils.ClickType.LEFT, InventoryUtils.ClickMode.PICKUP, chest.windowId); delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay()); } + LogUtils.sendWarning("Supplied composter with resources."); + if (FarmHelperConfig.logAutoComposterEvents){ + LogUtils.webhookLog("Supplied composter with resources."); + } setComposterState(ComposterState.END); } else { PlayerUtils.closeScreen(); @@ -616,7 +627,6 @@ private Entity getComposter() { .min(Comparator.comparingDouble(entity -> entity.getDistanceSqToCenter(mc.thePlayer.getPosition()))).orElse(null); } - @SubscribeEvent public void onRenderWorldLast(RenderWorldLastEvent event) { if (!isRunning()) return;