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
  • Break identifier


    Dexter Bots

    Recommended Posts

    Hello community, I have a problem, here it is. I've been trying for a while now to identify the set breaks in the client. However, without success. The script should recognize when the next break should occur, based on entering a safe zone (combat), so that the break can be executed. I have already tried various methods with BreakSolver/RandomSolver, etc., but it never recognizes it, except when I program it manually. However, I prefer it if the user can determine how long and when they want breaks themselves.

    Link to comment
    Share on other sites

    9 hours ago, Dexter Bots said:

    Hello community, I have a problem, here it is. I've been trying for a while now to identify the set breaks in the client. However, without success. The script should recognize when the next break should occur, based on entering a safe zone (combat), so that the break can be executed. I have already tried various methods with BreakSolver/RandomSolver, etc., but it never recognizes it, except when I program it manually. However, I prefer it if the user can determine how long and when they want breaks themselves.

    So what you want to do is create a custom break handler and add it to the RandomManager. In the "onLoop()" method you can set a code to go to a safe spot or logout or do whatever.

     

     
        public class CustomBreakSolver extends BreakSolver {
            @Override
            public String getEventString() {
                return "MY CUSTOM BREAK HANDLER";
            }
    
            @Override
            public int onLoop() {
                Tile closestBank = BankLocation.getNearest().getTile();
                Walking.walk(closestBank);
                if(closestBank.getArea(4).contains(Players.getLocal()))
                    return super.onLoop();
                else return 100;
            }
        }
    
        @Override
        public void onStart() {
            super.onStart();
            BreakSolver breakSolver = new CustomBreakSolver();
            getRandomManager().registerSolver(breakSolver);
            log("CUSTOM BREAK SOLVER? "+getRandomManager().isUsingCustomBreakSolver());
        }

     

     

    Link to comment
    Share on other sites

    Thank you :)

    i try it.

    now i was make a special loop what was randomly afk and going in safe zones but it wasn that what i would befour ur response are here :)

     

    greez

    Link to comment
    Share on other sites

    2 minutes ago, Dexter Bots said:

    Thank you :)

    i try it.

    now i was make a special loop what was randomly afk and going in safe zones but it wasn that what i would befour ur response are here :)

     

    greez

    When i tested it, it worked (forced a break from the client) but returning super.onLoop() stopped the loop. So just remember to do some logic and return an actual value on the loop to keep the loop going until you hit your desired conditions, then return super.onLoop()

    Link to comment
    Share on other sites

    Thank you very much, it works so far. I'm really happy about the information. I have another small issue where you might be able to help me - the upload to the SDN. Unfortunately, the guide is outdated, and I have the new version of IntelliJ IDEA. It also doesn't work; the script would be a clean script, including a humane antiban, just like how I've been playing RS for 15 years, etc.

    Link to comment
    Share on other sites

    Unfortunately, I have not uploaded a script to the SDN yet. I just came over from another bot about a week ago and have been too busy transferring my scripts over.

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.