Jump to content

Random management system + new account GUI


Maxi

Recommended Posts

  • Developer

Hello everyone,

 

Here is a heads up on what I have been working on the last two days. I have written the random management system, which will allow script writers full control over how to handle randoms. For example, let's take the case of an autofighter. You get a strange box and you're in combat and not in a safe zone. The programmed random solver for the strange box will recognize the strange box and try to solve it, but it will close the interface constantly because you're under attack. Your autofighter won't any longer be in control, so eventually you will die. Here is where the random management system comes in to play. In this case you want control over what happens before and after solving the strange box, more specifically you want to make sure you are out of combat and in a safe zone when solving the random, you want the random to be solved as programmed by default after that and you want to finish by walking back to your fighting spot.

 

Here is a simplified example of how that would work with the random management system (note that the onLoop doesn't have to be overridden at all here, I just put it here for example purposes):

        @Override
        public void onStart() {
            this.actStartTime = System.currentTimeMillis();
            randomManager.registerHook(
                    new RandomBehaviourHook(RandomManager.STRANGE_BOX) {
 
                        @Override
                        public boolean shouldActivatePreLoop() {
                            return myPlayer().isUnderAttack() && !myPlayer().isInArea(SAFE_AREA);
                        }
 
                        @Override
                        public int preLoop() {
                            walk(SAFE_AREA);
                            return gRandom(600, 300);
                        }
 
                        @Override
                        public int onLoop() throws InterruptedException {
                            return super.onLoop();
                        }
 
                        @Override
                        public boolean shouldActivatePostLoop() {
                            return myPlayer().isInArea(SAFE_AREA);
                        }
 
                        @Override
                        public int postLoop() {
                            walk(FIGHT_AREA);
                            return gRandom(600, 300);
                        }
 
                    }
            );
        }

Furthermore, I have been working on a new GUI for accounts and a fresh system on the backend of it. One reason for this is that the accounts system simply wasn't user friendly and intuitive, another reason is that there were bugs occurring with it sometimes. Accounts are ordered in alphabetical order and you can now set your preferred experience rewards chosen when encountering a genie lamp or book of knowledge per account. Here is a picture of the new accounts GUI:

 

vF4pTZH.png

 

These updates will be fitted in the next release.

 

Sincerely,

 

OSBot.org

  • Like 4
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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