Jump to content

How do i make my script STOP and not just stop moving


Ornamental

Recommended Posts

Dear scripters,

I ran into a small problem while learning to code, so basically i'm just making a script that walks to the G.E and use's bank on the banker.

Problem : After that, the script is still running but doesn't move, i want it to stop and not logout my account.

@Override
public void onStart() {
log("Let's get started!");
}

@Override
public int onLoop() throws InterruptedException {
getWalking().webWalk(new Position(3166, 3485, 0));
npcs.closest("Banker").interact("Bank");
stop(false);
return random(200, 300);

}

@Override
public void onExit() {
log("Arrived at destination !");
}

@Override
public void onPaint(Graphics2D g) {

}
}

Could someone explain this, and how i make the script stop when it has interacted with the banker ?

 

Thanks

Edited by Takes A Nap
Link to comment
Share on other sites


stop(false);


@Override

public void onStart() {

log("Let's get started!");

}

@Override

public int onLoop() throws InterruptedException {

getWalking().webWalk(new Position(3166, 3485, 0));

if (npcs.closest("Banker") != null && npcs.closest("Banker").interact("Bank")){

stop(false);

}

return random(200, 300);

}

@Override

public void onExit() {

log("Arrived at destination !");

}

@Override

public void onPaint(Graphics2D g) {

}

}

Edited by Sinatra
Link to comment
Share on other sites

I guess you could try this

@Override
public int onLoop() {
    if (bank.isOpen()) {
        stop(false);
    } else if (npcs.closest("Banker") == null || myPosition().distance(new Position(3166, 3485, 0)) > 10) {
        walking.webWalk(new Position(3166, 3485, 0));
    } else {
        npcs.closest("Banker").interact("Bank");
    }
    return 69;
}
  • Like 1
Link to comment
Share on other sites

 

I guess you could try this

@Override
public int onLoop() {
    if (bank.isOpen()) {
        stop(false);
    } else if (npcs.closest("Banker") == null || myPosition().distance(new Position(3166, 3485, 0)) > 10) {
        walking.webWalk(new Position(3166, 3485, 0));
    } else {
        npcs.closest("Banker").interact("Bank");
    }
    return 69;
}

Oke lol this thing is fast haha, and it stops the script thanks alot !

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