UnusualPerson 4 Author Share Posted March 4, 2022 3 hours ago, camalCase said: okay makes alot more sense now when you're calling NPCs.closest its returning null because theres no NPCs that match your filter, this is probably because the fishing spot isnt in your area could also be because of contentEquals, normally i use equalsIgnoreCase or contains do you have "break;" at the end of your fishing case? Thank you SO much for your help, my friend! Solved it. It was indeed the '"contentEquals" part that was killing it. I changed it to ".getName.contains("Fishing spot") and it works! I also forgot the brakes. I am ashamed of making a mistake like that, but I learned from it and that's most important. Again, huge thanks and big props to you! case FISH: log("About to reel in some fish"); NPC FishingSpot = NPCs.closest(f -> f != null && f.getName().contains("Fishing spot") && BarbarianVillageSpot.contains(f)); log(FishingSpot); if (FishingSpot != null){ FishingSpot.interact("Lure"); sleep(5000); } break; Link to comment Share on other sites More sharing options...
donvlee97 10 Share Posted April 14, 2022 I literally just went to read and good that you figured it out man! Good job on improving! Link to comment Share on other sites More sharing options...
Axolotl 31 Share Posted April 14, 2022 On 3/4/2022 at 3:09 PM, UnusualPerson said: Thank you SO much for your help, my friend! Solved it. It was indeed the '"contentEquals" part that was killing it. I changed it to ".getName.contains("Fishing spot") and it works! I also forgot the brakes. I am ashamed of making a mistake like that, but I learned from it and that's most important. Again, huge thanks and big props to you! case FISH: log("About to reel in some fish"); NPC FishingSpot = NPCs.closest(f -> f != null && f.getName().contains("Fishing spot") && BarbarianVillageSpot.contains(f)); log(FishingSpot); if (FishingSpot != null){ FishingSpot.interact("Lure"); sleep(5000); } break; I recommend you using an if for all interact methods as they can fail due to missclicks and that can matter quite a lot in the future. I don't recommend adding action names inside of the interact unless you NEED to, as it will right click before each time which is rather bot like imo. Also, using sleepUntil would work better as it won't have idle after spot dissapears. something like this would be better: case FISH: log("About to reel in some fish"); NPC FishingSpot = NPCs.closest(f -> f != null && f.getName().contains("Fishing spot") && BarbarianVillageSpot.contains(f)); log(FishingSpot); if (FishingSpot != null) { if(FishingSpot.interact()) { sleepUntil(() -> !FishingSpot.exists(), Calculations.random(4000, 6000)); } } break; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.