Skip to content

Commit

Permalink
Merge pull request #271 from mqtze/fix/pest-repellent
Browse files Browse the repository at this point in the history
dont close skymart between purchases
  • Loading branch information
onixiya1337 authored Oct 26, 2024
2 parents 25389bf + 2d8c781 commit 0a339fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.8.10
version=2.8.11
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,9 @@ public void onTickExecution(TickEvent.ClientTickEvent event) {
if (InventoryUtils.hasItemInHotbar(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")) {
LogUtils.sendDebug("Repellent in hotbar, selecting repellent");
state = State.SELECT_REPELLENT;
} else if (InventoryUtils.hasItemInInventory(!FarmHelperConfig.pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX")){
} else {
LogUtils.sendDebug("Repellent not in hotbar, moving to hotbar");
state = State.MOVE_REPELLENT;
} else {
LogUtils.sendDebug("Repellent not in inventory, buying");
state = State.NONE;
}
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
break;
Expand Down Expand Up @@ -399,7 +396,6 @@ public void onDrawGui(DrawScreenAfterEvent event) {
if (confirmSlot == null) {
break;
}
state = State.FIND_REPELLENT_IN_INVENTORY;
InventoryUtils.clickContainerSlot(confirmSlot.slotNumber, InventoryUtils.ClickType.LEFT, InventoryUtils.ClickMode.PICKUP);
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
break;
Expand All @@ -413,8 +409,13 @@ public void onChatReceived(ClientChatReceivedEvent event) {
String message = StringUtils.stripControlCodes(event.message.getUnformattedText()); // just to be sure lol
if (isRunning() && state == State.CONFIRM_BUY) {
if (message.startsWith("You bought Pest")) {
state = State.FIND_REPELLENT_IN_INVENTORY;
if(FarmHelperConfig.pestRepellentType && !message.contains("MAX")){
state = State.CLICK_REPELLENT;
} else {
state = State.FIND_REPELLENT_IN_INVENTORY;
}
delayClock.schedule(FarmHelperConfig.getRandomGUIMacroDelay());
return;
}
}
if (message.startsWith("YUM! Pests will now spawn")) {
Expand Down

0 comments on commit 0a339fc

Please sign in to comment.