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
  • Need Help with Player Positioning Issue Relative to Area Post-World Hop


    Deep Slayer

    Recommended Posts

    Hi everyone,

    I'm currently developing a script and have encountered a problem related to the player's position in relation to a specific area after world hopping. The issue is primarily with the East-West coordinates.

    Lets say this is the defined area in my script for example:


    private final Area myArea = new Area(1234, 1235, 1236, 1237);

     

    After the bot performs a world hop, its understanding of its position in relation to myArea becomes inaccurate. Specifically, the bot perceives itself to be about 8-10 tiles East or West of where it actually is. This error is throwing off the script's logic, as it thinks it's in one area when, in reality, it's off by a significant margin. Interestingly, the North-South coordinates remain accurate; the issue is only with the East-West alignment.

    I have tried implementing a 15-20 second delay between each world hop to address this, but the problem persists.

    Also note that the script works perfectly until a world hop occurs

    I've pasted my world hop logic below

    Has anyone else experienced this? Any insights or solutions would be greatly appreciated.

    Thank you!

     

    private void hopToWorld() {
        World world = Worlds.getRandomWorld(w -> w.isF2P() && !w.isPVP() && w.getMinimumLevel() == 0);
       WorldHopper.hopWorld(world);
       sleep(15000,20000);
    
    }
    
    Edited by Deep Slayer
    Link to comment
    Share on other sites

    I think there is something wrong with your script logic here because your position doesn't change if you hop worlds. The issue won't be with your hop logic.

    If you enable 'show player position' in the client does the position actually change after hopping?

    Link to comment
    Share on other sites

    • 10:26:17 am: [SCRIPT] MY CURRENT POSITION BEFORE HOP: (3073, 3856, 0)
    • 10:26:34 am: [SCRIPT] MY CURRENT POSITION AFTER HOP: (3073, 3864, 0)
      using 
      myPlayer.getTile()); 
      
      to read those coordinates before and after using the below method
      
      private void hopToWorld() {
          World world = Worlds.getRandomWorld(w -> w.isF2P() && !w.isPVP() && w.getMinimumLevel() == 0);
          WorldHopper.hopWorld(world);
          sleep(15000,20000);
      
      }
      

       

      The Player position in developer mode on the client is different than getTile() method after hopping worlds although its the same, before hopping.

       

       

    Edited by Deep Slayer
    Link to comment
    Share on other sites

    23 minutes ago, Deep Slayer said:
    • 10:26:17 am: [SCRIPT] MY CURRENT POSITION BEFORE HOP: (3073, 3856, 0)
    • 10:26:34 am: [SCRIPT] MY CURRENT POSITION AFTER HOP: (3073, 3864, 0)
      using 
      myPlayer.getTile()); 
      
      to read those coordinates before and after using the below method
      
      private void hopToWorld() {
          World world = Worlds.getRandomWorld(w -> w.isF2P() && !w.isPVP() && w.getMinimumLevel() == 0);
          WorldHopper.hopWorld(world);
          sleep(15000,20000);
      
      }
      

       

      The Player position in developer mode on the client is different than getTile() method after hopping worlds although its the same, before hopping.

       

       

    1) You should ensure the world is properly loaded in after the hop

    2) You should re-grab the player every time, changing worlds probably invaldiates the old Player object and puts it to 0,0 of the chunk or something.

    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
    ×
    ×
    • 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.