Jump to content

Accepting trade issues


Xious

Recommended Posts

Hey ^^ I've seen another thread about an issue with trading, but no solution has been posted so I'm posting another one :3

 

I'm writing some merching scripts and when trading, "trade.acceptTrade()" sometimes fails to accept the trade and instead

only shakes the mouse over Decline trade button doing nothing? It's been bugging me out for hours -.-

 

Anyone knows how to solve this?

Thx

Link to comment
Share on other sites

do u have a:

getTrade().isCurrentlyTrading()

in your code

 

edit: post ur code

 

 

Trader 1:

        if(trade.isCurrentlyTrading())
        {
            if(trade.isFirstInterfaceOpen())
            {
                trade.acceptTrade();
                while(trade.isCurrentlyTrading() && !trade.isSecondInterfaceOpen()) sleep(50);
            }

            if(trade.isSecondInterfaceOpen())
            {
                trade.acceptTrade();
                while(trade.isCurrentlyTrading()) sleep(50);
            }

            return;
        }

Trader 2:

        if(trade.isCurrentlyTrading())
        {
            if(trade.isFirstInterfaceOpen())
            {
                while(!trade.didOtherAcceptTrade()) sleep(50);
                trade.acceptTrade();
            }

            if(trade.isSecondInterfaceOpen())
            {
                while(!trade.didOtherAcceptTrade()) sleep(50);
                trade.acceptTrade();
            }
        }

This isn't exactly how my code looks like, but this is an example of my logic. smile.png (There are sleeps in betwen)

Edited by Xious
Link to comment
Share on other sites

use conditionalsleeps instead of while loops

 

try tis:

           if (getTrade().isCurrentlyTrading()) {
                  if (getTrade().isFirstInterfaceOpen()) {
                      if (getTrade().acceptTrade()) {
                        new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return getTrade().isSecondInterfaceOpen();
                           }
                          }.sleep();
                         }
                        } else {
                       if (getTrade().acceptTrade()) {
                         new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return !getTrade().isCurrentlyTrading();
                           }
                          }.sleep();
                         }
                       }
                             

idk 100% if code will work cause i wrote it on browser

 

  • Like 1
Link to comment
Share on other sites

use conditionalsleeps instead of while loops

 

try tis:

           if (getTrade().isCurrentlyTrading()) {
                  if (getTrade().isFirstInterfaceOpen()) {
                      if (getTrade().acceptTrade()) {
                        new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return getTrade().isSecondInterfaceOpen();
                           }
                          }.sleep();
                         }
                        } else {
                       if (getTrade().acceptTrade()) {
                         new ConditionalSleep(5000) {
                          @Override
                          public boolean condition() throws InterruptedException {
                           return !getTrade().isCurrentlyTrading();
                           }
                          }.sleep();
                         }
                       }
                             

idk 100% if code will work cause i wrote it on browser

 

Thx, gonna try this ^^

Link to comment
Share on other sites

  • 3 months later...

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