Jump to content

What is the best way to move to a specific location without using the map? I.e if you have a position right next to the bank you want to go to?


chardragon

Recommended Posts

Hi, I want to click on a specific square and I've created a position called target which has the x, y, and z all visible from the bank. Atm I am using getmap().walk(target) which uses the map which i don't think is realistic as its right next to the bank. so I think its better to just click on the map after fast closing the bank interface with escape. How can i do this as i tried using the api but i didnt get very far.

 

Edit: I would also appreciate if someone can tell me how i can do actions on specific locations for example say I want to mine 3 rocks is there a way I can make the bot focus on the 3 rocks in a way which is better than RS2Object ore_vein = getObjects().closest(obj -> obj.getName().equals("Iron rocks") && MiningArea.contains(obj)); Ideally I would like to cycle through 3 rocks so that it does the same order rather than atm this produces somewhat random results sometimes it picks the top one then the middle then back to the top then bottom etc. which isnt very real like

Edited by chardragon
Link to comment
Share on other sites

private void test() {
    RS2Object rock1 = getObjects().getAll().stream().filter(
            a -> a.getName().equals("Iron rock") &&
                    a.getX() == 123 &&
                    a.getY() == 234)
            .findAny().orElse(null);

    boolean minedRock1 = false;
    boolean minedRock2 = false;

    if (minedRock1 && minedRock2) {
        //make all false
    } else if (!minedRock1) {
        //mine rock 1
        //set true
    } else if (!minedRock2) {
        //mine rock2
        //set true
    }
}
  • Like 1
Link to comment
Share on other sites

8 hours ago, chardragon said:

Edit: I would also appreciate if someone can tell me how i can do actions on specific locations for example say I want to mine 3 rocks is there a way I can make the bot focus on the 3 rocks in a way which is better than RS2Object ore_vein = getObjects().closest(obj -> obj.getName().equals("Iron rocks") && MiningArea.contains(obj)); Ideally I would like to cycle through 3 rocks so that it does the same order rather than atm this produces somewhat random results sometimes it picks the top one then the middle then back to the top then bottom etc. which isnt very real like

Doing it your way is way more bot like, clicking the same rocks in the same order forever.

A player just clicks the closest rock when it spawns. More random is better.

Also your script should be stateless. I.e. we don't keep track of what we have done, we simply read the game state and decide what to do each time.

Link to comment
Share on other sites

1 minute ago, abc3 said:

Doing it your way is way more bot like, clicking the same rocks in the same order forever.

A player just clicks the closest rock when it spawns. More random is better.

Also your script should be stateless. I.e. we don't keep track of what we have done, we simply read the game state and decide what to do each time.

I disagree mate, maybe i explained it wrong but imagine you are mining 3 rocks around you so your character stands still you are more likely in real life to go say top middle bottom and repeat than to to top middle back to top etc... and just to clarify i am specifically talking about iron ore here so that you mine one the next one has spawned. I try to just try to implement what i do when i play. Regarding your last point ill try to bare that in mind :) thanks for taking the time to reply

7 hours ago, skillerkidos1 said:
private void test() {
    RS2Object rock1 = getObjects().getAll().stream().filter(
            a -> a.getName().equals("Iron rock") &&
                    a.getX() == 123 &&
                    a.getY() == 234)
            .findAny().orElse(null);

    boolean minedRock1 = false;
    boolean minedRock2 = false;

    if (minedRock1 && minedRock2) {
        //make all false
    } else if (!minedRock1) {
        //mine rock 1
        //set true
    } else if (!minedRock2) {
        //mine rock2
        //set true
    }
}

Thank you!

Link to comment
Share on other sites

5 hours ago, chardragon said:

I disagree mate, maybe i explained it wrong but imagine you are mining 3 rocks around you so your character stands still you are more likely in real life to go say top middle bottom and repeat than to to top middle back to top etc... and just to clarify i am specifically talking about iron ore here so that you mine one the next one has spawned. I try to just try to implement what i do when i play. Regarding your last point ill try to bare that in mind :) thanks for taking the time to reply

Thank you!

Do you think a player will perfectly click 3 rocks in order with no mistakes for any more than a few minutes?

No, because a human doesn't have perfect memory, a human makes mistakes, and the game can be unpredictable.

You'd be better off just checking for rocks that are facing you or facing next to you first. That's more how real players mine. Then if none are immediately close you mine the other rock.

Edited by abc3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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