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.

Is there any way to customize some built-in timers?

Featured Replies

As an example, npc.interact("Talk") does the following::

1. Moves mouse to npc

2. Right clicks on npc

3. Moves mouse to 'Talk' option

4. Left clicks on it

Steps 2 to 4  are done in extremely fast succession so I'd like to add in a little delay in between those steps to help with antiban. The same goes for other built in api methods, such as bank.depositAll() or store.buy(). Is this possible? If yes, how would you do it?

 

Side question: How would you simulate a random mouse movement on screen? Currently, the pointer moves only if osbot was given a command which is fine, but I'd like to add some random, natural mouse movement while there is no command(event) being run.

  • Author

Thanks, that's what I thought. What's the API that deals with the menu that opens up when you right click on an object such as npc or chest?

 

I managed to get as far as right clicking on my object, but now I'm not sure how to choose the option I want from the popup.

Edited by vlad3921

This will right click an entity and click the action. You can add sleeps wherever you would like. You can also add offsets to the mouse position so that it is more randomized.

private boolean customRightClickInteract(Entity entity, String interaction) throws InterruptedException {
    if (entity != null && entity.hover()) {
        // Right clicks the entity.
        getMouse().click(true);
        // This creates a temporary actionOption to later hold the actual option.
        Option actionOption = null;
        // This loops through all the active options on the screen and checks to see if
        // any match the interaction string.
        // It also increases the index so that it can later be used to grab the correct
        // rectangle from the option.
        int index = 0;
        for (Option option : getMenuAPI().getMenu()) {
            if (option.action.toLowerCase().equalsIgnoreCase(interaction.toLowerCase())) {
                actionOption = option;
                break;
            }
            index++;
        }
        if (actionOption != null) {
            // Moves the mouse to the designated action. You should probably give offsets
            // to the rec.getCenterX() and the rec.getCenterY() so that it doesn't always
            // go to the center of the text. The y will only be able to have an offset
            // of around -3 - 3 or so.
            // The x should be able to handle more maybe -15 - 15? You will have to
            // mess around with it.
            Rectangle rec = getMenuAPI().getOptionRectangle(index);
            getMouse().move((int) rec.getCenterX(), (int) rec.getCenterY());
            return getMouse().click(false);
        }
    }
    return false;
}

Create an account or sign in to comment

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.