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.

Get MINIMAP clickable area

Featured Replies

How do I get the clickable area inside the minimap? For example, how would I know if a tile is visible on the minimap and able to be clicked? 

Current code:

 

            MiniMapTileDestination checkDest = new MiniMapTileDestination(bot, check, true);
            Point mmPoint = checkDest.getExactPoint();
            Point centerMM = new Point(642, 84);
            if (checkDest.getExactPoint() == null || am.dist(mmPoint, centerMM) > 90) {
                continue;
            }
            //Now, click check.getExactPoint()


However, it seems to be returning Points that are NOT in the minimap clickable area including the prayer and run toggle buttons. MiniMapTileDestination.isVisible does not work, only returns true if the tile is visible in the game window, not minimap. MiniMapTileDestination.evaluate seems to always return false. What I need is an area representing the clickable portion of the minimap. It must exist somewhere in the API for webwalk to function but I cant find it. Any help is appreciated! 

                  MiniMapTileDestination spot = new MiniMapTileDestination(getBot(), CenterBankPosition);
                        getMouse().click(spot);

 

  • Author
37 minutes ago, Juggles said:

                  MiniMapTileDestination spot = new MiniMapTileDestination(getBot(), CenterBankPosition);
                        getMouse().click(spot);

 


Alright when I pass the MiniMapTileDestination into mouse.click, it returns false. If I debug the position, it's actually over the run button, so slightly out of bounds of the minimap. So the mouse.click function must be somehow checking before clicking to see if the MiniMapTileDestination is actually visible to click. How can I do this check without actually calling mouse.click? Your method is a fix if I already have MiniMapTileDestination's that I know are clickable, but it does not help me find the furthest possible MiniMapTileDestination to click that is still visible. 

Thanks for the help so far. 

getMap().canReach(Position); 

 

  • Author
21 minutes ago, Aiban said:

getMap().canReach(Position); 

 

Doesn't work. Blue = click x, y of tile where map.canReach = true. Red = where map.canReach should = true. Bug? If so how does webwalk function still? (pic attatched)

 

broke.png


EDIT: Full code for clarity

 

Quote

    protected void mmWalk(Position[] path) {
        if (myPlayer().isMoving() && mmDest != null && am.dist(myPlayer(), mmDest) > 3) {
            return;
        }
        if (am.dist(myPlayer(), path[path.length - 1]) < 6) {
            log("Already at destination " + mmDest);
            return;
        }

        mmDest = getBest(path);
        if (mmDest == null) {
            log("No route found to " + path[path.length - 1]);
            return;
        }

        MiniMapTileDestination checkDest = new MiniMapTileDestination(bot, mmDest, true);
        Point mmPoint = checkDest.getExactPoint();
        am.click(mmPoint.getX(), mmPoint.getY(), 5, 5, true, 1.0F);
    }
 



    public Position getBest(Position[] path) {
        int bestDist = 0;
        Position best = null;
        Position dest = path[path.length - 1];
        for (Position check : path) {
            if (check == null) {
                continue;
            }
            if (am.dist(myPlayer(), dest) < am.dist(check, dest)) {
                continue;
            }
            MiniMapTileDestination checkDest = new MiniMapTileDestination(bot, check, true);
            Point mmPoint = checkDest.getExactPoint();
            if (mmPoint == null || !map.canReach(check)) {
                continue;
            }
            int checkDist = am.dist(myPlayer(), check);
            if (checkDist > bestDist) {
                bestDist = checkDist;
                best = check;
            }
        }
        return best;
    }

 

Edited by dmmslaver

Just use myPlayer().getPosition().distance(tile) < 14

16 hours ago, Juggles said:

Map.canReach works perfectly fine for me 

:facep:

 

Edited by Soldtodie

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.