Jump to content

No more org.osbot.rs07.script.RandomBehaviourHook ?


Recommended Posts

Posted (edited)

Okay so I've opened a script i wrote 3 months ago where i implemented my own break handler and i used to import this:

import org.osbot.rs07.script.RandomBehaviourHook;

And i used to put this in my onStart() : 

 

try {
   this.bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.AUTO_LOGIN) {
       @[member='Override']
       public boolean shouldActivate() {
        if(/*blabla*/){
        //blabla
        return false;
        }else{
        return super.shouldActivate();
        }
        }
   });
} catch (Exception ex) {
   //blabla
}

 

And it used to work perfectly, but now it gives me an error when I'm trying to import that RandomBehaviourHook and it looks like it's gone from the API.

 

Is it gone? Or is there another way to make this work?

Edited by dokato
Posted (edited)

Okay so I've opened a script i wrote 3 months ago where i implemented my own break handler and i used to import this:

import org.osbot.rs07.script.RandomBehaviourHook;

And i used to put this in my onStart() : 

 

try {
   this.bot.getRandomExecutor().registerHook(new RandomBehaviourHook(RandomEvent.AUTO_LOGIN) {
       @[member='Override']
       public boolean shouldActivate() {
        if(/*blabla*/){
        //blabla
        return false;
        }else{
        return super.shouldActivate();
        }
        }
   });
} catch (Exception ex) {
   //blabla
}

 

And it used to work perfectly, but now it gives me an error when I'm trying to import that RandomBehaviourHook and it looks like it's gone from the API.

 

Is it gone? Or is there another way to make this work?

 

You can now disable randoms all together using the:

-allow norandoms

CLI flag, and then write your own custom login handler

Edited by Explv
  • Like 1
Posted (edited)

Why do you need to register this? isn't it enabled by default

 

Alek added a -norandom flag to CLI not too long ago, look into that.

 

 

You can now disable randoms all together using the:

-allow norandoms

CLI flag, and then write your own custom break handler

 

Well Thx guys,

But you both clearly misunderstood what I'm trying to do here

 

I don't want to disable a random here, I just want to make sure that the random will only be executed whenever I like (on code level), not completely disable it using CLI.

 

In this case I only want it to log back in when the expression in the if(/*blabla*/) returns false. If I disable that random completely it won't be able to log back in. 

Edited by dokato
Posted

Well Thx guys,

But you both clearly misunderstood what I'm trying to do here

 

I don't want to disable a random here, I just want to make sure that the random will only be executed whenever I like (on code level), not completely disable it using CLI.

 

In this case I only want it to log back in when the expression in the if(/*blabla*/) returns false. If I disable that random completely it won't be able to log back in. 

 

I did not misunderstand what you are trying to do.

 

The registerHook method has been removed from the API, to achieve what you want to do, you will need to disable all randoms, and write your own login handler, like this:

 

http://osbot.org/forum/topic/109560-a-simple-login-handler/

  • Like 1
Posted

I did not misunderstand what you are trying to do.

 

The registerHook method has been removed from the API, to achieve what you want to do, you will need to disable all randoms, and write your own login handler, like this:

 

http://osbot.org/forum/topic/109560-a-simple-login-handler/

 

A ok Thx, I still tried to use OSBot's login thing, but now you have to make even that completely yourself, very thoughtfull of Alek or who ever changed that. 

Guess what we learn at college is really true, "change is the only constant". 

But in this case I really don't understand why.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...