Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Keep bot logged in?


    Banker
     Share

    Recommended Posts

    Hey, so i have managed to create my dicebot (previous thread) but i am having an issue keeping it logged in, as it only chats it simply logs out after a certain amount of time.

     

    I dont really want the bot to walk around so how would i make it rotate the camera a random amount every so often in the onLoop to keep it logged in?

     

    Thanks.

    Link to comment
    Share on other sites

    You want to have a timer and a long called nextRotate.

    Timer timer;
    long nextRotate;
    
    @Override
    public void onStart() {
          timer = new Timer();
    }
    

    And in your onLoop method

    @Override
    public int onLoop() {
          if (timer.elapsed() > nextRotate) {
                getCamera.rotate(); //I am not sure what the method is called but look it up
                nextRotate = timer.elapsed() + 10 * 60 * 1000; //Rotate the camera in 10 minutes
          }
          return 200;
    }
    
    Link to comment
    Share on other sites

     

    You want to have a timer and a long called nextRotate.

    Timer timer;
    long nextRotate;
    
    @Override
    public void onStart() {
          timer = new Timer();
    }
    

    And in your onLoop method

    @Override
    public int onLoop() {
          if (timer.elapsed() > nextRotate) {
                getCamera.rotate(); //I am not sure what the method is called but look it up
                nextRotate = timer.elapsed() + 10 * 60 * 1000; //Rotate the camera in 10 minutes
          }
          return 200;
    }
    

     

     

    Would doing this keep the bot logged in also?

     

    @Override
    public int onLoop() {
    
    
    getCamera().mouseRotateTo(rand.nextInt(100), rand.nextInt(100));
    
    
    return Calculations.random(3500,7500);
    }
    Link to comment
    Share on other sites

     

    Would doing this keep the bot logged in also?

     

    @Override
    public int onLoop() {
    
    
    getCamera().mouseRotateTo(rand.nextInt(100), rand.nextInt(100));
    
    
    return Calculations.random(3500,7500);
    }

     

     

    Yes it does the same thing. Using that method you really can not do anything else in your onLoop but I guess you do not need anything in your onLoop because it is a dicing script.

    Link to comment
    Share on other sites

    Yes it does the same thing. Using that method you really can not do anything else in your onLoop but I guess you do not need anything in your onLoop because it is a dicing script.

     

    Ahh, okay, thanks for your help anyway :)

    Link to comment
    Share on other sites

    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
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.