Jump to content
ospaul

Issues with WalkingEvent

Recommended Posts

Hey all, currently having an issue sometimes with walking event. My logger will show that I have reached the walk event, but will sometimes not actually move, or attempt to move, even though in the logger it says it has generated a tile and is executing the walk event. Other times it works perfectly.

Im new to the API, so I'm unsure if I should be using WalkingEvent? I might need to fine tune my tile selection though.

@Override
    public void process() throws InterruptedException {
        List<NPC> dangerousNPC = script.getNpcs().filter(script::isDangerousNPC);
        dangerousNPC.forEach(npc -> {
            if (script.currentState != States.LOOT && !script.myPlayer().isMoving()) {
                WalkingEvent myEvent = new WalkingEvent(new Position(findAnySafeTile(npc, potentialSafeTiles)));
                script.execute(myEvent);
                script.log("Generated safe tile.. executing walk.");

            }

        });
    }

 

Edited by ospaul
Link to post
Share on other sites
4 hours ago, Heist said:

Try webwalking

I web walk for larger distances this is in a 10x10 area where I sometimes just want to move a tile back. It's to my understanding that webwalking uses the minimap, I don't always want to traverse using the mini map. We walking is also a hog on resources if I'm not mistaken?

 

Edited by ospaul
Link to post
Share on other sites
7 hours ago, ospaul said:

Hey all, currently having an issue sometimes with walking event. My logger will show that I have reached the event sometimes but will not actually move, or attempt to move, even though in the logger it says it has generated a tile and is executing the walk event. Other times it works perfectly.

Im new to the API, so I'm unsure if I should be using WalkingEvent? I might need to fine tune my tile selection though.


@Override
    public void process() throws InterruptedException {
        List<NPC> dangerousNPC = script.getNpcs().filter(script::isDangerousNPC);
        dangerousNPC.forEach(npc -> {
            if (script.currentState != States.LOOT && !script.myPlayer().isMoving()) {
                WalkingEvent myEvent = new WalkingEvent(new Position(findAnySafeTile(npc, potentialSafeTiles)));
                script.execute(myEvent);
                script.log("Generated safe tile.. executing walk.");

            }

        });
    }

 

When creating a walkingevent there is probably a base threshold ste of a few tiles?
To fix that you should add myEvent.setMinDistanceThreshold(0);

That will make sure you walk on the exact tile you want 😉

While myEvent.setMinDistanceThreshold(1);
Would stop the event when you ar e inside 1 tile radius ^^

Link to post
Share on other sites
28 minutes ago, Khaleesi said:

When creating a walkingevent there is probably a base threshold ste of a few tiles?
To fix that you should add myEvent.setMinDistanceThreshold(0);

That will make sure you walk on the exact tile you want 😉

While myEvent.setMinDistanceThreshold(1);
Would stop the event when you ar e inside 1 tile radius ^^

Thanks khal, I’ll try that next time I’m free and let you know if that works!

  • Like 1
Link to post
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.

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