So I've decided to clean and restructure one of my scripts that I've stitched together by a miracle (started scripting roughly a month ago, so don't kill me straight away).
This one has the trading function included in it, but I can't seem to make it complete the second trade window (it does 'accept' the first trade screen (if condition is met) , but closes second one).
I've inserted snippets after the script has opened the trade window (no issues there).
if (getTrade().isFirstInterfaceOpen()
&& getTrade().getTheirOffers().contains("")) {
getTrade().acceptTrade();
Script.sleep(Script.random(1000, 1500));
}
if (getTrade().isSecondInterfaceOpen()) {
getTrade().acceptTrade();
Script.sleep(Script.random(1000, 1500));
}
Previously I used something very redundant and fairly stupid, but it got the job done (no need to grill me on that one):
if (getTrade().isFirstInterfaceOpen()) {
Script.sleep(Script.random(2000, 3000));
if (getTrade().getTheirOffers().contains("")) {
Script.sleep(Script.random(2000, 3000));
getTrade().acceptTrade();
Script.sleep(Script.random(2000, 3000));
getTrade().acceptTrade();
Script.sleep(Script.random(2000, 3000));
}