Jump to content

Activating/Deactivating Randoms


Isolate

Recommended Posts

damnt, sorry tried to click quote.... i meant turn it off so it doesnt do it until i tell it too. not to override my own methods

OR how to use onLogin(int a) so i can make it do something every time it logs in

 

I think you're talking about overriding the default random manager so you could perform a task before activating it if I understand correctly...

 

In your onStart():

randomManager.registerHook(new RandomBehaviourHook(randomManager.LOGIN_MANAGER)){
          @Override
          public boolean shouldActivatePostLoop(){
                 return true;
          }
          @Override
          public int postLoop() throws InterruptedException{
          //task to perform
          return 0;
          }
}

Note: If you want to exit the postLoop then have it return -1

       2- There are a variety of methods you can override which can be found here

Link to comment
Share on other sites

if i use the LoginListener onLogin(int a). will it run the code i put in there every time it logs in? or am i wrong in thinkign this

 

Have never tried it, hooking the randomManager always works for me so never had to explore further. From the sounds of it thought, it doesn't sound right.

 

If you use the solution I provided you then it will run the code you put in the postLoop() everytime it logs in.

Edited by Divinity
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...