Jump to content

trade.acceptTrade() clicking wrong button?


Johnxtrem

Recommended Posts

Hey guys :) I've noticed this can happen sometimes, usually after account is running for a longer time when calling:

trade.acceptTrade();

Instead of accepting the trade, it clicks on decline button instead, not even clicking but just hover it and returns true despite.

Any ideas what could be the cause of this?

Thanks!

Link to comment
Share on other sites

Most likely yeah, doesn't happen always but just sometimes. I'm running about 35+ clients.

Hmm, I'm using conditional loop, but since it returns true even if it doesn't behave correctly its kinda useless :/

 

new ConditionalLoop(getBot(), 3)
{
    @Override
    public boolean condition()
    {
        return !trade.acceptTrade();
    }
}.start();
Link to comment
Share on other sites

private void acceptTrades() {
		if (trade.isFirstInterfaceOpen() && trade.didOtherAcceptTrade()) {
			log("Accepting first trade");
			gpmade = gpmade + Math.toIntExact(trade.getTheirOffers().getAmount("Coins"));
			trade.acceptTrade();
			new ConditionalSleep(10000) {

				@Override
				public boolean condition() throws InterruptedException {
					return trade.isSecondInterfaceOpen();
				}
			}.sleep();
		} else if (trade.isSecondInterfaceOpen()) {
			log("Accepting second trade");
			trade.acceptTrade();
			new ConditionalSleep(10000) {

				@Override
				public boolean condition() throws InterruptedException {
					return !trade.isCurrentlyTrading();
				}
			}.sleep();
		}
	}

Thats mine, works everytime i dont run 35+ clients but i have tested it on 10 running for a few days and not one problem

Link to comment
Share on other sites

4 minutes ago, whipz said:

private void acceptTrades() {
		if (trade.isFirstInterfaceOpen() && trade.didOtherAcceptTrade()) {
			log("Accepting first trade");
			gpmade = gpmade + Math.toIntExact(trade.getTheirOffers().getAmount("Coins"));
			trade.acceptTrade();
			new ConditionalSleep(10000) {

				@Override
				public boolean condition() throws InterruptedException {
					return trade.isSecondInterfaceOpen();
				}
			}.sleep();
		} else if (trade.isSecondInterfaceOpen()) {
			log("Accepting second trade");
			trade.acceptTrade();
			new ConditionalSleep(10000) {

				@Override
				public boolean condition() throws InterruptedException {
					return !trade.isCurrentlyTrading();
				}
			}.sleep();
		}
	}

Thats mine, works everytime i dont run 35+ clients but i have tested it on 10 running for a few days and not one problem

Hey, I had something similar prior running so many clients and worked just perfectly, the issue occured only when running as much... I made it with conditional sleeps and loops now and seems to be working so far :D 

Link to comment
Share on other sites

1 hour ago, Johnxtrem said:

Most likely yeah, doesn't happen always but just sometimes. I'm running about 35+ clients.

Hmm, I'm using conditional loop, but since it returns true even if it doesn't behave correctly its kinda useless :/

 


new ConditionalLoop(getBot(), 3)
{
    @Override
    public boolean condition()
    {
        return !trade.acceptTrade();
    }
}.start();

Hey I'm pretty new to scripting and I was gotcha wondering how you made the bot into an integer. My guess is you put all the slaves into an array list 0-34?

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