Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Can't get my Fishing Bot to fish [SOLVED]


    UnusualPerson

    Recommended Posts

    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

    • UnusualPerson changed the title to Can't get my Fishing Bot to fish [SOLVED]
    • 1 month later...
    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.