Been trying to use a ConditionalSleep to check when the trade window opens up, but it seems to just timeout before it even realises that it's actually trading.
log("before cond");
log(trade.isCurrentlyTrading()); // returns false, as expected
condSleep(10000, 200, trade.isCurrentlyTrading());
log("after cond");
log(trade.isCurrentlyTrading()); // returns true, as expected
// also in the class
private void condSleep(int timeout, int delay, boolean b) {
new ConditionalSleep(timeout, delay) {
@Override
public boolean condition() throws InterruptedException {
return b;
}
}.sleep();
}
Any help would be greatly appreciated!