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.

Script getting stuck

Featured Replies

Hello, have been experiencing this issue for sometime now and fail to find why it is happening. My script just randomly throws this error: [WARN][Bot #1][11/19 06:28:37 AM]: Script executor is taking too long to suspend; restarting now... and pretty much script crashes, stands for 5 minutes, logs out and that's it. Also it happens very randomly, e.g. the last time this happened script ran for 10 hours without issues, but it also could happened within hour or so. 

The logger goes like this before crashing:

[INFO][Bot #1][11/19 06:23:29 AM]: Trading NPC
[INFO][Bot #1][11/19 06:23:30 AM]: Check amount
[INFO][Bot #1][11/19 06:23:30 AM]: Buy item at first try
[WARN][Bot #1][11/19 06:28:37 AM]: Script executor is taking too long to suspend; restarting now...
[INFO][Bot #1][11/19 06:41:46 AM]: Terminating script Ironmanbuyer...

if (gpAmount > 1000) {

            final int feathers = (int)this.getInventory().getAmount(new String[] { "Item" });
         
            getNpcs().closest("NPC").interact("Trade");
            log("Trading NPC");
            new ConditionalSleep(8000, 1000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getStore().isOpen();
                }
            }.sleep();
            log("Check amount");
            if(getStore().isOpen() && getStore().getAmount("Item") > 5){
                log("Buy item at first try");
                if(getStore().getItem("Item") != null){
                    getStore().buy("Item",5);
                }
                log("Bought");
                new ConditionalSleep(5000, 1000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return getInventory().contains("Item");
                    }
                }.sleep();
                log("Closing store");
                getStore().close();
                new ConditionalSleep(5000, 1000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return !getStore().isOpen();
                    }
                }.sleep();
            }

 

 

So the last logger are always "Buy item at first try" and after it crashes I never find it with the item in inventory. So the issue must be in this part, but I don't know why is this is wrong. Can it be client itself issue since these issues were not happening with previous versions? 🤔 Thanks everyone for input :)

if(getStore().getItem("Item") != null){ getStore().buy("Item",1); }

Edited by Kramnik

"Item" has to be a name of the item in case you didn't know, Feathers for example

Also the logic is fairly flawed and unstable.
You should try to only do 1 or max 2 actions in 1 loop.

A better format would be:

if (gp > 1000){
	if(store is open){
		if(store contains more than 5 items){
			buyItems();
		}
	}else{
		openstore()
	}
}


If you are hopping or whatever you should close the bank ik there :)

  • Author
7 hours ago, Khaleesi said:

"Item" has to be a name of the item in case you didn't know, Feathers for example

Also the logic is fairly flawed and unstable.
You should try to only do 1 or max 2 actions in 1 loop.

A better format would be:



if (gp > 1000){
	if(store is open){
		if(store contains more than 5 items){
			buyItems();
		}
	}else{
		openstore()
	}
}


If you are hopping or whatever you should close the bank ik there :)

Hi, yes I am aware of it, I changed it to "Item" when I pasted :D I changed a code to be more like you said, but still the issue is happening. Happened two times, one after 6 hours of using it other after 10 minutes.

Currently using this code:

getNpcs().closest("NPC").interact("Trade");
                log("Trading NPC");
                new ConditionalSleep(8000, 1000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return getStore().isOpen();
                    }
                }.sleep();
                log("Store is open now");
                if(getStore().isOpen()) {
                    log("Store is open");
                    if (getStore().getAmount("Item") > 5) {
                        log("Amount is good, buying");
                        getStore().buy("Item", 1);
                        new ConditionalSleep(5000, 1000) {
                            @Override
                            public boolean condition() throws InterruptedException {
                                return getInventory().contains("Item");
                            }
                        }.sleep();
                        log("Closing store");
                        getStore().close();
                        new ConditionalSleep(5000, 1000) {
                            @Override
                            public boolean condition() throws InterruptedException {
                                return !getStore().isOpen();
                            }
                        }.sleep();

And still bugs with this in logger:
[INFO][Bot #1][11/19 03:15:40 PM]: Opening store
[INFO][Bot #1][11/19 03:15:40 PM]: Trading NPC
[INFO][Bot #1][11/19 03:15:41 PM]: Store is open now
[INFO][Bot #1][11/19 03:15:41 PM]: Store is open
[INFO][Bot #1][11/19 03:15:41 PM]: Amount is good, buying
[WARN][Bot #1][11/19 03:20:48 PM]: Script executor is taking too long to suspend; restarting now...

And when I log into account I can see that it haven't bought the item. Any ideas what could be wrong here? 🤔

Edited by Kramnik

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.