Jump to content

player keeps walking away from NPC interaction


r3nnoc

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

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