private void handleTrading() {
if(!isCurrentlyTrading) {
whenTradeOpened = System.currentTimeMillis();
}
log("Is trade offer empty? " + getTrade().getTheirOffers().isEmpty());
log("Did he accept? " + getTrade().didOtherAcceptTrade());
isCurrentlyTrading = true;
if(System.currentTimeMillis() - whenTradeOpened >= 60000) {
log("Trade condition 1");
putPlayerOnCooldown(getTrade().getOtherPlayer());
getTrade().declineTrade();
handleTradeClosed();
} else if(getTrade().isSecondInterfaceOpen() && getTrade().didOtherAcceptTrade()) {
log("Trade condition 2");
long amount = RsBuddy.getPrice(getTrade().getTheirOffers().getItems());
putPlayerOnCooldown(getTrade().getOtherPlayer(), 10000);
getTrade().acceptTrade();
handleTradeComplete(amount);
} else if(getTrade().getTheirOffers().isEmpty() && getTrade().didOtherAcceptTrade()) {
log("Trade condition 3");
getTrade().declineTrade();
putPlayerOnCooldown(getTrade().getOtherPlayer());
handleTradeClosed();
} else if(!getTrade().getTheirOffers().isEmpty() && getTrade().didOtherAcceptTrade() && (System.currentTimeMillis() - lastAcceptAttempt >= 1000)) {
log("Trade condition 4");
getTrade().acceptTrade();
lastAcceptAttempt = System.currentTimeMillis();
}
}
Yeah I could but that would not solve the problem that lies within the API.