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.

Guranteed Dismissal of Random Events

Featured Replies

Lately I've noticed that some random events aren't properly dismissed by the bot client. So I added this simple snippet into my script to ensure that they are.

 

onLoop:

if(dismissRandom()) {

                sleep(random(600, 800));

                while(myPlayer().isMoving()) {

                    sleep(600);

                }

                sleep(400);

            }

boolean:

    private boolean dismissRandom() {

        for(NPC npc : npcs.getAll()) {

            

            if(npc == null || npc.getInteracting() == null

                || npc.getInteracting() != myPlayer()) {

                continue;

            }

            

            if(npc.hasAction("Dismiss")) {

                npc.interact("Dismiss");

                return true;

            }

            

        }

        return false;

    }

This basically checks if there are any npcs with the "dismiss" option interacting with you and if so, they'll be dismissed.

Edited by swiffyp

why dissmiss then lol, most " legit" players just let then disappear sometimes to 

  • Author

why dissmiss then lol, most " legit" players just let then disappear sometimes to 

 

Highly doubt that it's okay to not dismiss/attend random events.

Highly doubt that it's okay to not dismiss/attend random events.

I'm pretty sure the built in solver does the same thing as your code, have you tested this with the same random events that the built in solver doesn't work for? Did you file a bug report detailing the case where it didn't work so that the devs can fix it?

When I sometimes play legit I cba to dismiss them, and I'm pretty sure the built in Random solver does this already and would override any script anyways (if enabled).

  • Author

I'm pretty sure the built in solver does the same thing as your code, have you tested this with the same random events that the built in solver doesn't work for? Did you file a bug report detailing the case where it didn't work so that the devs can fix it?

 

The built-in solver is not always triggered. It happens to me very often, which is why I decided to write this quickly.

I haven't filed a bug report but I will do that.

 

Now if you don't like this, don't use it. It's that simple. smile.png

Edited by swiffyp

this is a really handy snippet. but i would add a tiny piece of logic to prevent the very awkward snap run to dismiss issue. where your bot is say running to the bank. the random spawns 50 feet back and your bot clicks "dismiss" and sprint turns and runs back to the now far away random NPC to dismiss them. its always been a behavior that bothered me. Unless you have a long run back to the bank this change should be of little consequence.

if(npc == null || npc.getInteracting() == null || npc.getInteracting() != myPlayer() && !api.myPlayer.isMoving())

i let them follow me like a little bitch fuck dismissing

Lol

 

But nice snippet :) have noticed the built in one doesnt work 75% of the time 

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.