Jump to content

player keeps walking away from NPC interaction


Recommended Posts

Posted

so i have this bit of code this is supposed to have the player talk to the NPC in karamja and pay the fare but he keeps walking away from the customs officer. the webwalk seems to be looping but I don't know why. the if statement has animation and dialogue checks so the code shouldn't execute ???

Position pos1 = new Position(2943, 3146, 0);
NPC sailor = getNpcs().closest(3648);
if (getInventory().isFull() && (!myPlayer().isAnimating() && (!getDialogues().inDialogue()))) {
    getSettings().setRunning(true);
    getWalking().webWalk(pos1);
    if (sailor != null) {
        sailor.interact("Pay-Fare");
        sleep(getRandomNumber(1000, 3000));
        if (dialogues.isPendingContinuation()) {
            dialogues.clickContinue();
        }

any help would be appreciated :)

Posted
2 hours ago, r3nnoc said:

so i have this bit of code this is supposed to have the player talk to the NPC in karamja and pay the fare but he keeps walking away from the customs officer. the webwalk seems to be looping but I don't know why. the if statement has animation and dialogue checks so the code shouldn't execute ???


Position pos1 = new Position(2943, 3146, 0);
NPC sailor = getNpcs().closest(3648);
if (getInventory().isFull() && (!myPlayer().isAnimating() && (!getDialogues().inDialogue()))) {
    getSettings().setRunning(true);
    getWalking().webWalk(pos1);
    if (sailor != null) {
        sailor.interact("Pay-Fare");
        sleep(getRandomNumber(1000, 3000));
        if (dialogues.isPendingContinuation()) {
            dialogues.clickContinue();
        }

any help would be appreciated :)

Because you keep walking every time before you interact with the npc.. Might wanna do some check where your player is located.

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