@@ -203,12 +203,9 @@ public void onTickExecution(TickEvent.ClientTickEvent event) {
203
203
if (InventoryUtils .hasItemInHotbar (!FarmHelperConfig .pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX" )) {
204
204
LogUtils .sendDebug ("Repellent in hotbar, selecting repellent" );
205
205
state = State .SELECT_REPELLENT ;
206
- } else if ( InventoryUtils . hasItemInInventory (! FarmHelperConfig . pestRepellentType ? "Pest Repellent" : "Pest Repellent MAX" )) {
206
+ } else {
207
207
LogUtils .sendDebug ("Repellent not in hotbar, moving to hotbar" );
208
208
state = State .MOVE_REPELLENT ;
209
- } else {
210
- LogUtils .sendDebug ("Repellent not in inventory, buying" );
211
- state = State .NONE ;
212
209
}
213
210
delayClock .schedule (FarmHelperConfig .getRandomGUIMacroDelay ());
214
211
break ;
@@ -399,7 +396,6 @@ public void onDrawGui(DrawScreenAfterEvent event) {
399
396
if (confirmSlot == null ) {
400
397
break ;
401
398
}
402
- state = State .FIND_REPELLENT_IN_INVENTORY ;
403
399
InventoryUtils .clickContainerSlot (confirmSlot .slotNumber , InventoryUtils .ClickType .LEFT , InventoryUtils .ClickMode .PICKUP );
404
400
delayClock .schedule (FarmHelperConfig .getRandomGUIMacroDelay ());
405
401
break ;
@@ -413,8 +409,13 @@ public void onChatReceived(ClientChatReceivedEvent event) {
413
409
String message = StringUtils .stripControlCodes (event .message .getUnformattedText ()); // just to be sure lol
414
410
if (isRunning () && state == State .CONFIRM_BUY ) {
415
411
if (message .startsWith ("You bought Pest" )) {
416
- state = State .FIND_REPELLENT_IN_INVENTORY ;
412
+ if (FarmHelperConfig .pestRepellentType && !message .contains ("MAX" )){
413
+ state = State .CLICK_REPELLENT ;
414
+ } else {
415
+ state = State .FIND_REPELLENT_IN_INVENTORY ;
416
+ }
417
417
delayClock .schedule (FarmHelperConfig .getRandomGUIMacroDelay ());
418
+ return ;
418
419
}
419
420
}
420
421
if (message .startsWith ("YUM! Pests will now spawn" )) {
0 commit comments