Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

World hopper + break system

Featured Replies

  • Developer

Today I finally got around to finishing up the world hopping system. This was also a nice moment to bring the random management system in to action. For anyone interested in the random management system in action code wise for the world hopping system, here you go:

package org.osbot.script.rs2.ui;
 
import org.osbot.engine.Bot;
import org.osbot.script.mouse.RectangleDestination;
import org.osbot.script.rs2.randoms.RandomBehaviourHook;
import org.osbot.script.rs2.randoms.RandomManager;
import org.osbot.utility.Gaussian;
 
import java.awt.*;
import java.util.ArrayList;
import java.util.Map;
 
/**
 * Created with IntelliJ IDEA.
 * User: Maxime
 * Date: 26-05-13
 * Time: 19:24
 * To change this template use File | Settings | File Templates.
 */
public class WorldHopper {
 
    private final Bot bot;
 
    private boolean isHopping = false;
    private int nextWorld = -1;
 
    public WorldHopper(Bot bot) {
        this.bot = bot;
    }
 
    /**
     * Logs you out and changes hops to the world specified. This method does not take in to account full worlds yet,
     * so hopping to a full world will fail.
     * @param world Worlds range from 301 to 378 but remember that the worlds
     *              307, 315, 323, 324, 331, 332, 347, 348, 355, 356, 363, 364, 371, 372
     *              do not exist.
     */
    public void hopWorld(int world) throws InterruptedException {
        nextWorld = world;
        isHopping = true;
        bot.getScript().randomManager.registerHook(hook);
        while (bot.getClient().getLoginState() != 10) {
            if (bot.getScript().logoutTab.logOut()) {
                Thread.sleep(500 + Gaussian.random(300, 300));
            }
        }
    }
 
    private static enum State {
        GO_TO_SELECTION, WORLD_SELECTION, UNHOOK;
    }
 
    private RandomBehaviourHook hook = new RandomBehaviourHook(RandomManager.LOGIN_SCRIPT) {
 
        private State state = null;
 
        @Override
        public String getName() {
            return "World Hopping";
        }
 
        public void scan() {
            if (!isHopping || bot.getClient().getLoginState() != 10 || nextWorld == -1) {
                state = State.UNHOOK;
                return;
            }
            if (bot.getClient().getColorPicker().isColorAt(54, 294, Color.BLACK)) {
                state = State.WORLD_SELECTION;
                return;
            } else {
                if (bot.getClient().getCurrentWorld() == nextWorld) {
                    state = State.UNHOOK;
                } else {
                    state = State.GO_TO_SELECTION;
                }
            }
        }
 
        /**
         * The main loop logic. This will continue until shouldActivate() returns true or
         * -1 is returned.
         *
         * @return The time to sleep until the next loop.
         * @throws InterruptedException
         */
        @Override
        public int onLoop() throws InterruptedException {
            scan();
            switch (state) {
                case GO_TO_SELECTION:
                    bot.getClient().moveMouseTo(new RectangleDestination(new Rectangle(12, 466, 86, 26)), false, true, false);
                    return 600 + gRandom(200, 200);
                case WORLD_SELECTION:
                    Rectangle dest = getWorldMouseDestination(nextWorld);
                    bot.getClient().moveMouseTo(new RectangleDestination(dest), false, true, false);
                    return 600 + gRandom(200, 200);
                case UNHOOK:
                    nextWorld = -1;
                    isHopping = false;
                    bot.getRandomManager().unregisterHook(RandomManager.LOGIN_SCRIPT);
                    return -1;
                default:
                    return 500 + gRandom(500, 500);
            }
        }
 
        @Override
        public void onExit() {
            isHopping = false;
            nextWorld = -1;
        }
 
    };
 
    /**
     * Calculates the rectangle of the destination to click a world.
     * @param world The specified world in the range of 301 - 378
     * @return The rectangle used for the mouse destination
     */
    private Rectangle getWorldMouseDestination(int world) {
        ******
    }
 
    *****
 
    static {
        *****
    }
}

Furthermore I started on a breaking system. You will be able to set your break settings per saved account profile, which will then be used if you enable it.

 

Expect both updates to be released tonight or tomorrow,

 

Sincerely,

 

OSBot.org

Great job, Maxi. Keep the amazing updates coming. happy.png

Break system sound like some great anti-ban!

Just what i needed! Thanks!

 

Edit: About the breaks: can a script writer modify these settings? For example: if you have a fighter bot, you want to do something before the bot takes a break. Is this a random hook too? (RandomManager.BREAK or something?)

Edited by SXForce

Can't wait until this can consider full worlds.

 

You should include two methods, nextWorld()/hopNextWorld() and randomWorld()/hopRandomWorld().

Sounds great but will it support like say if someone was botting in a members area and the bot chose a f2p world would it switch or would it get stuck trying to keep logging in?

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.