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
  • Correct looping within side onLoop | meant for big bots. AbstractScripts


    f4i13rr0r

    Recommended Posts

    Meant for bots || scripts with more than one task.

    Spoiler
    package Proof;
    
    import org.dreambot.api.methods.interactive.Players;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.methods.map.Tile;
    import org.dreambot.api.methods.walking.impl.Walking;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    
    @ScriptManifest(category = Category.MISC, name = "Proof", author = "f4i13rr0r", version = 0)
    public class Proof extends AbstractScript {
        @Override
        public void onStart() {
        }
    
        @Override
        public int onLoop() {
            final Area Draynor = new Area(
                    new Tile(3092, 3240, 0),
                    new Tile(3097, 3240, 0),
                    new Tile(3097, 3246, 0),
                    new Tile(3092, 3246, 0));
            final Area Lumbridge = new Area(
                    new Tile(3218, 3216, 0),
                    new Tile(3224, 3216, 0),
                    new Tile(3224, 3221, 0),
                    new Tile(3218, 3221, 0));
    
            while (!Draynor.contains(Players.getLocal())) {
                if (Lumbridge.contains(Players.getLocal())) {
                    Walking.walk(Draynor.getRandomTile());
                    sleep(1000,9000);
                } else {
                    while (!Lumbridge.contains(Players.getLocal())) {
                        if (!Draynor.contains(Players.getLocal())) {
                            Walking.walk(Draynor.getRandomTile());
                            sleep(1000, 9000);
                        } else {
                            break;
                        }
                    }
                }
            }
            while (!Lumbridge.contains(Players.getLocal())) {
                if (Draynor.contains(Players.getLocal())) {
                    Walking.walk(Lumbridge.getRandomTile());
                    sleep(11000,13000);
                    while (!Draynor.contains(Players.getLocal())) {
                        if (Lumbridge.contains(Players.getLocal())) {
                            sleep(11000,13000);
                            break;
                        } else {
                            Walking.walk(Lumbridge.getRandomTile());
                            sleep(1000, 9000);
                        }
                    }
                }
            }
            return 0;
        }
    
        @Override
        public void onExit() {
        }
    }

     

    Spoiler

     

    GitHub Java source file

     

    Screenshot2023-05-15211610.png.42cb11137ea89deb0e52f3162f56937a.pngScreenshot2023-05-15211636.png.280909453d3ae59141eeca6f124e1500.pngScreenshot2023-05-15211650.png.09e7f31b77c9ef44f4a328eaf5a1f1bc.pngScreenshot2023-05-15211707.png.45da381e18ce64d62dcc30e4f2e4beba.pngScreenshot2023-05-15211725.png.c80db4332ad5f30dc32cd1a6506ea527.png

    Edited by f4i13rr0r
    Link to comment
    Share on other sites

    • 2 weeks later...

    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.