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.

Terminate random event script

Featured Replies

How can I stop a random event script.

I tested this but it doesn't work.

RandomExecutor re = new RandomExecutor(getBot());
re.interrupt();
re.terminate();

 

How can I stop a random event script.

I tested this but it doesn't work.

RandomExecutor re = new RandomExecutor(getBot());
re.interrupt();
re.terminate();

 

Uhm, do you mean stop as in remove the random handler for a certain random event?

What exactly are you trying to achieve?

RandomExecutor re = new RandomExecutor(getBot()); 
re.interrupt(); 
re.terminate();

... will not terminate the script's Bot's RandomExecutor but the new RandomExecutor you created, "re" .

 

What you might want to try instead:

this.getBot(). getRandomExecutor().terminate();

Edited by Botrepreneur

    @Override

    public void onStart() {

        bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.FREAKY_FORESTER) {

            @Override

            public boolean shouldActivate() {

                return false;    //To change body of overridden methods use File | Settings | File Templates.

            }

        });

    }

  • Author
    @Override
    public void onStart() {
        bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.FREAKY_FORESTER) {
            @Override
            public boolean shouldActivate() {
                return false;    //To change body of overridden methods use File | Settings | File Templates.
            }
        });
    }

 

I don't want to change the random. I want to stop it.

I don't want to change the random. I want to stop it.

 

His snippet stops it from executing.

The solvers automatically stop after executing.

When exactly do you want it to stop ? :p

  • Author

His snippet stops it from executing.

The solvers automatically stop after executing.

When exactly do you want it to stop ? tongue.png

 

For instance in the mid.

this.getBot(). getRandomExecutor().terminate();

This doesn't work but with .interrupt() the random script stops for a moment and start again.

Edited by Soldtodie

For instance in the mid.

this.getBot(). getRandomExecutor().terminate();

This doesn't work but with .interrupt() the random script stops for a moment and start agai

 

@Alek's solution will work.

No problem Alek, Alek's solution overrides the existing random by return false so it wont be activated by any situation.

With this i can terminate the random solver in the mid of the execute?

No, with this, the random solver would not be executed at all

With this i can terminate the random solver in the mid of the execute?

 

You'd have to override the RBH's onLoop()

For instance in the mid.

this.getBot(). getRandomExecutor().terminate();

This doesn't work but with .interrupt() the random script stops for a moment and start again.

 

Stop and restart, isn't what interruption is all about ? tongue.png

Edited by Botrepreneur

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.