Jump to content

Fixed code snippet for issue. Please check, thanks


Kramnik

Recommended Posts

Hi, after 2.5.64 update my scripts started getting:

[WARN][Bot #1][12/12 06:17:42 AM]: Script executor is taking too long to suspend; restarting now...

It happens when my bots go trade my mule and it seems inconsistent, sometime they crach after 20mins, sometimes after 1.5 hours and in that time it mules few times. And also sometimes they just hop to mules world and stops next to it and sometimes it get error but manages to trade successfully with it and then stop, which is strange. Also ran one bot with -norandoms and it has been running fine for 2 hours now, don't know if its just coincidence or what. Putting the part where my bot gets stuck below, maybe some one has scripting insight what could be the problem. Thanks :) 

log("Shall we mule?");

        new ConditionalSleep(5000, 8000) {
            @Override
            public boolean condition() throws InterruptedException {
                return getWidgets().isVisible(548,52);
            }
        }.sleep();

        if(inv != null){
            inv.interact();
            log("Atidarom inv");
            sleep(1000);
        }

        if(getInventory().getAmount(YYY548,35;
            ifnull;
                "Open logout";
            sleep1000;
            "Pamiegam 2.5s";
            sleep2500;
            XXX;
            "Hopping";
            sleep5000;
            ;
            double XXX;
            double XXX;
            sleep2000;
            if null if "Trade with""Trading with mule";
                    new 6000, 8000@Override
                        public boolean conditionthrows return ;
                        ;
                sleep700;
            trade, int;
            sleep700;
            tradeYYY, int;
            sleep700;
         new 3000, 4000@Override
                public boolean conditionthrows return ;
                ;
            trade;
            new 1500, 3000@Override
                public boolean conditionthrows return ;
                ;
            trade;
            "Trade done";
            new 3000, 5000@Override
                public boolean conditionthrows return ;
                ;
        

Last crash looked like this:

[INFO][Bot #1][12/12 07:48:15 AM]: Open logout
[INFO][Bot #1][12/12 07:48:16 AM]: Pamiegam 2.5s
[INFO][Bot #1][12/12 07:48:21 AM]: Hopping
[WARN][Bot #1][12/12 07:48:26 AM]: Script executor is taking too long to suspend; restarting now...

But as I said also happens like this:

[INFO][Bot #1][12/12 07:42:36 AM]: Hopping
[WARN][Bot #1][12/12 07:42:47 AM]: Script executor is taking too long to suspend; restarting now...
[INFO][Bot #1][12/12 07:42:47 AM]: Tradinam with mule
[INFO][Bot #1][12/12 07:43:08 AM]: Trade done
[INFO][Bot #1][12/12 07:43:11 AM]: Trade done 2
[INFO][Bot #1][12/12 07:53:16 AM]: Terminating script Script...

Edited by Kramnik
Link to comment
Share on other sites

I don't have much (or any) scripting insight, but it looks like the syntax here is off. Not gonna go into further detail, because I feel like I might mislead you.

Edit: Although if nobody with actual knowledge comes along, you could send me a PM and I'll try to help you out, but I can't promise it wont make it worse lol.

Edited by MasonStorm
Link to comment
Share on other sites

2 hours ago, MasonStorm said:

I don't have much (or any) scripting insight, but it looks like the syntax here is off. Not gonna go into further detail, because I feel like I might mislead you.

Edit: Although if nobody with actual knowledge comes along, you could send me a PM and I'll try to help you out, but I can't promise it wont make it worse lol.

 

9 hours ago, Naked said:

fix yo formatting

Fixed formatting for the script to look as it should



RS2Widget logout = getWidgets().get(548,35);

            if(logout != null){
                logout.interact();
                log("Opening logout");
            }
            sleep(1000);
            log("Sleeping 2.5s");
            sleep(2500);
            getWorlds().hop(500);
            log("Hopping");

            sleep(5000);

            Player trading = getPlayers().closest("XXX");

            double item1 = getInventory().getAmount("XXX");
            double item2 = getInventory().getAmount("XXX");

            sleep(2000);

            if (trading != null && !getTrade().isCurrentlyTrading()) {
                if (trading.interact("Trade with")) {
                    log("Trading with mule");
                    new ConditionalSleep(6000, 8000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return getTrade().isCurrentlyTrading();
                        }
                    }.sleep();
                }
            }
            sleep(700);
            trade.offer("XXX", (int) item1);
            sleep(700);
            trade.offer("XXX", (int) item2);
            sleep(700);
          
            new ConditionalSleep(3000, 4000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getTrade().didOtherAcceptTrade();
                }
            }.sleep();
            trade.acceptTrade();
            new ConditionalSleep(1500, 3000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getTrade().isSecondInterfaceOpen();
                }
            }.sleep();
            trade.acceptTrade();

            log("Trade done");

            sleep(3000);

            new ConditionalSleep(3000, 5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return !getTrade().isCurrentlyTrading();
                }
            }.sleep();

        }


    }
}
Link to comment
Share on other sites

1 hour ago, Kramnik said:

 

Fixed formatting for the script to look as it should


RS2Widget logout = getWidgets().get(548,35);

            if(logout != null){
                logout.interact();
                log("Opening logout");
            }
            sleep(1000);
            log("Sleeping 2.5s");
            sleep(2500);
            getWorlds().hop(500);
            log("Hopping");

            sleep(5000);

            Player trading = getPlayers().closest("XXX");

            double item1 = getInventory().getAmount("XXX");
            double item2 = getInventory().getAmount("XXX");

            sleep(2000);

            if (trading != null && !getTrade().isCurrentlyTrading()) {
                if (trading.interact("Trade with")) {
                    log("Trading with mule");
                    new ConditionalSleep(6000, 8000) {
                        @Override
                        public boolean condition() throws InterruptedException {
                            return getTrade().isCurrentlyTrading();
                        }
                    }.sleep();
                }
            }
            sleep(700);
            trade.offer("XXX", (int) item1);
            sleep(700);
            trade.offer("XXX", (int) item2);
            sleep(700);
          
            new ConditionalSleep(3000, 4000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getTrade().didOtherAcceptTrade();
                }
            }.sleep();
            trade.acceptTrade();
            new ConditionalSleep(1500, 3000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return getTrade().isSecondInterfaceOpen();
                }
            }.sleep();
            trade.acceptTrade();

            log("Trade done");

            sleep(3000);

            new ConditionalSleep(3000, 5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    return !getTrade().isCurrentlyTrading();
                }
            }.sleep();

        }


    }
}

Basicly you shuld only use 1 action every onLoop and check every state onLoop.
That's how you get proper flawless scripts.

Btw don't use widgets ids please ... its so bad as they can change a lot :/
 

if(trade open){
  if(secondtradescreen{
	accepttrade();
  }else{
      if(trade contain both items){
		acceptFirstTrade()
      }elseif(trade contain first items){
		inputSecondItem();
      }else{
		inputFirstItem();
      }
  }
}else{
	tradeplayer();
}

 

Edited by Khaleesi
Link to comment
Share on other sites

1 hour ago, Khaleesi said:

Basicly you shuld only use 1 action every onLoop and check every state onLoop.
That's how you get proper flawless scripts.

Btw don't use widgets ids please ... its so bad as they can change a lot :/
 


if(trade open){
  if(secondtradescreen{
	accepttrade();
  }else{
      if(trade contain both items){
		acceptFirstTrade()
      }elseif(trade contain first items){
		inputSecondItem();
      }else{
		inputFirstItem();
      }
  }
}else{
	tradeplayer();
}

 

Thank you for insight :) But what is strange is that if I run client if -norandoms it seems to run without encountering this problem. Mostly accounts get stuck in first 30-40mins but -norandoms ones are running 1 hour+. Don't know if when the problem is in client or in script 🤔

Edit: On second though, client definitely had some issues with world hopping before but now it only fails only when I go mule, so its still very unclear for me where could issue be

Edited by Kramnik
Link to comment
Share on other sites

17 hours ago, Kramnik said:

Hi, after 2.5.64 update my scripts started getting:

[WARN][Bot #1][12/12 06:17:42 AM]: Script executor is taking too long to suspend; restarting now...

It happens when my bots go trade my mule and it seems inconsistent, sometime they crach after 20mins, sometimes after 1.5 hours and in that time it mules few times. And also sometimes they just hop to mules world and stops next to it and sometimes it get error but manages to trade successfully with it and then stop, which is strange. Also ran one bot with -norandoms and it has been running fine for 2 hours now, don't know if its just coincidence or what. Putting the part where my bot gets stuck below, maybe some one has scripting insight what could be the problem. Thanks :) 


log("Shall we mule?");

        new ConditionalSleep(5000, 8000) {
            @Override
            public boolean condition() throws InterruptedException {
                return getWidgets().isVisible(548,52);
            }
        }.sleep();

        if(inv != null){
            inv.interact();
            log("Atidarom inv");
            sleep(1000);
        }

        if(getInventory().getAmount(YYY548,35;
            ifnull;
                "Open logout";
            sleep1000;
            "Pamiegam 2.5s";
            sleep2500;
            XXX;
            "Hopping";
            sleep5000;
            ;
            double XXX;
            double XXX;
            sleep2000;
            if null if "Trade with""Trading with mule";
                    new 6000, 8000@Override
                        public boolean conditionthrows return ;
                        ;
                sleep700;
            trade, int;
            sleep700;
            tradeYYY, int;
            sleep700;
         new 3000, 4000@Override
                public boolean conditionthrows return ;
                ;
            trade;
            new 1500, 3000@Override
                public boolean conditionthrows return ;
                ;
            trade;
            "Trade done";
            new 3000, 5000@Override
                public boolean conditionthrows return ;
                ;
        

Last crash looked like this:

[INFO][Bot #1][12/12 07:48:15 AM]: Open logout
[INFO][Bot #1][12/12 07:48:16 AM]: Pamiegam 2.5s
[INFO][Bot #1][12/12 07:48:21 AM]: Hopping
[WARN][Bot #1][12/12 07:48:26 AM]: Script executor is taking too long to suspend; restarting now...

But as I said also happens like this:

[INFO][Bot #1][12/12 07:42:36 AM]: Hopping
[WARN][Bot #1][12/12 07:42:47 AM]: Script executor is taking too long to suspend; restarting now...
[INFO][Bot #1][12/12 07:42:47 AM]: Tradinam with mule
[INFO][Bot #1][12/12 07:43:08 AM]: Trade done
[INFO][Bot #1][12/12 07:43:11 AM]: Trade done 2
[INFO][Bot #1][12/12 07:53:16 AM]: Terminating script Script...

Following the log it definitley is happening once you try to hop worlds.if having the -norandoms fixes this than I would think that the world hop method has a bug in that causes the randoms handler to start and gets stuck since there is no random to solve. Try to crete your own world hop method and see if it fixes it.

Link to comment
Share on other sites

6 minutes ago, BravoTaco said:

Following the log it definitley is happening once you try to hop worlds.if having the -norandoms fixes this than I would think that the world hop method has a bug in that causes the randoms handler to start and gets stuck since there is no random to solve. Try to crete your own world hop method and see if it fixes it.

I've told him before, this is the issue.

Unfortunately, creating a custom a world-hop class may not help here. The auto-login handler will fire even if a blank script is running and you manually hop through worlds. 

Link to comment
Share on other sites

5 hours ago, BravoTaco said:

Following the log it definitley is happening once you try to hop worlds.if having the -norandoms fixes this than I would think that the world hop method has a bug in that causes the randoms handler to start and gets stuck since there is no random to solve. Try to crete your own world hop method and see if it fixes it.

Did more testing so seems that you have mentioned the fix. I implemented manual world hop for the mule world in the script and it seems working atm. Thanks :) 

5 hours ago, camaro 09 said:

I've told him before, this is the issue.

Unfortunately, creating a custom a world-hop class may not help here. The auto-login handler will fire even if a blank script is running and you manually hop through worlds. 

Actualy that time it was a kind of different issue. The world hopping was completely broke due to client itself but with this version it world hops fine just somehow it fuckup when hopping to mule :) 

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