Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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


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

Huh i already have that ? 

then it must not be called

It is:

stop();

Edited by Vilius

  • Author

 

It is

stop(true);

Now it logsout my account sad.png

Edited by Takes A Nap

Now it logsout my account sad.png

Right I guess you dont want that, in that case do this:

getBot().getScriptExecutor().setRunningScript(false);
  • Author

 

Right I guess you dont want that, in that case do this:

getBot().getScriptExecutor().setRunningScript(false);

Hmm it still doesn't stop the script :'( Anything else that might work ?

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;
}
  • Author

 

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 !

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.