Jump to content

Issues with WalkingEvent


Recommended Posts

Posted (edited)

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
Posted (edited)
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
Posted
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 ^^

Posted
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

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
  • Recently Browsing   0 members

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