Jump to content

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


dokato
 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

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