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
  • Is there a method for finding the Interactable Object that is making us not reach?


    Bryno
     Share

    Recommended Posts

    Hi there!

    I see there is canReach methods and such but I was wondering if there was a way of determining WHY can't I reach that object?

    For example, if I just try to attack a Chicken, it might say you can't reach because door is closed, and then I can do something like:

    // Can't reach the chicken, because this door is closed in the way
    Gameobject door = objectInWay(Chicken);
    
    // Open that door so I can reach chicken.
    door.interact("Open");

     

    Thanks!

    Link to comment
    Share on other sites

    Here's essentially what I do, just force it to walk (i.e. handle obstacles)
     

    if (!Walking.canReach(Chicken)) {
      if (Walking.shouldWalk(Calculations.random(4,9)) {
        Walking.walk(chicken);
        sleep(5,10);
      }
    }
    
    if (canReach....)

    Also some less common, but still common, obstacles need to be added to the walker but doors and such should already be covered.

    Edited by holic
    Link to comment
    Share on other sites

    9 minutes ago, holic said:

    Here's essentially what I do, just force it to walk (i.e. handle obstacles)
     

    if (!Walking.canReach(Chicken)) {
      if (Walking.shouldWalk(Calculations.random(4,9)) {
        Walking.walk(chicken);
        sleep(5,10);
      }
    }
    
    if (canReach....)

    Also some less common, but still common, obstacles need to be added to the walker but doors and such should already be covered.

    Wait... NO WAY!

    You're telling me they implemented door handling in the "walk()" method....

    That is CRAZY amazing! :D<3 

    I have to test that out... I just assumed you would always have to implement your own door-object handling based on your script :O    

    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.