Xious Posted June 18, 2016 Share Posted June 18, 2016 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 Quote Link to comment Share on other sites More sharing options...
Acerd Posted June 18, 2016 Share Posted June 18, 2016 (edited) do u have a: getTrade().isCurrentlyTrading() in your code edit: post ur code Edited June 18, 2016 by Acerd 1 Quote Link to comment Share on other sites More sharing options...
Xious Posted June 18, 2016 Author Share Posted June 18, 2016 (edited) 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. (There are sleeps in betwen) Edited June 18, 2016 by Xious Quote Link to comment Share on other sites More sharing options...
Acerd Posted June 18, 2016 Share Posted June 18, 2016 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 1 Quote Link to comment Share on other sites More sharing options...
Xious Posted June 18, 2016 Author Share Posted June 18, 2016 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 ^^ Quote Link to comment Share on other sites More sharing options...
Xious Posted June 19, 2016 Author Share Posted June 19, 2016 (edited) I tested and it doesn't seem to be the logic of how I implemented it, acceptTrade(); just fails at some point >:< Edit: It was my bad, figured it out ^^ Edited June 19, 2016 by Xious Quote Link to comment Share on other sites More sharing options...
Acerd Posted June 19, 2016 Share Posted June 19, 2016 I tested and it doesn't seem to be the logic of how I implemented it, acceptTrade(); just fails at some point >:< report it to alek Quote Link to comment Share on other sites More sharing options...
Xious Posted June 19, 2016 Author Share Posted June 19, 2016 report it to alek Thanks for your help anyways, gave me ideas ^_^ Quote Link to comment Share on other sites More sharing options...
Chambo Posted October 4, 2016 Share Posted October 4, 2016 @Xious Sorry for grave digging but did you figure this out? Quote Link to comment Share on other sites More sharing options...