Butters Posted July 16, 2017 Share Posted July 16, 2017 Was testing stuff with interaction event and can't get my head around the hasFailed() and hasFinished() methods. Snippet below: Player worker = s.players.closest(tradeArea, workerName); if (worker != null) { InteractionEvent e = new InteractionEvent(worker, "Trade with"); e.setHover(false); e.setMaximumAttempts(1); e.setOperateCamera(true); s.execute(e); Utils.condSleep(5000, 300, () -> e.hasFinished() || e.hasFailed()); if (e.hasFinished()) { s.log("Interaction even has finished and will sleep!!!"); Utils.condSleep(20000, 500, () -> s.trade.isFirstInterfaceOpen()); } if (e.hasFailed()) s.log("Interaction event failed!!!!!!!"); } As you can see this is for trading. It seems that hasFinished() == true when the event succeeds (doesn't fail), hasFailed() == when it fails to eventually send a trade request. The problem I'm facing is that the hasFailed() method sometimes fires even if it actually succeeds (sent a trade request). Is this a bug or am I doing something wrong? 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted July 16, 2017 Share Posted July 16, 2017 if the event executes sucessfully then it will be true? true meaning it did the action "Trade with" it will fail it couldnt interact Quote Link to comment Share on other sites More sharing options...
Butters Posted July 16, 2017 Author Share Posted July 16, 2017 11 minutes ago, Chris said: if the event executes sucessfully then it will be true? true meaning it did the action "Trade with" it will fail it couldnt interact Sadly it did. Log looked something like: [log message - action| Interaction event failed - didn't trade Interaction event failed - didn't trade Interaction event failed - trade sent somehow Quote Link to comment Share on other sites More sharing options...
Chris Posted July 16, 2017 Share Posted July 16, 2017 it will fail if it couldnt click the action Quote Link to comment Share on other sites More sharing options...
The Undefeated Posted July 16, 2017 Share Posted July 16, 2017 18 minutes ago, nosepicker said: Sadly it did. Log looked something like: [log message - action| Interaction event failed - didn't trade Interaction event failed - didn't trade Interaction event failed - trade sent somehow This also happens with the .interact() method aswell. Annoying as fuck sometimes. Quote Link to comment Share on other sites More sharing options...
Butters Posted July 16, 2017 Author Share Posted July 16, 2017 21 minutes ago, The Undefeated said: This also happens with the .interact() method aswell. Annoying as fuck sometimes. Yeah that's why I started using interaction event with setMaximumAttemps(1). Usually spammed trade requests like hell. Quote Link to comment Share on other sites More sharing options...
Butters Posted July 16, 2017 Author Share Posted July 16, 2017 So no ideas how to prevent this without doing woodoo stuff? Quote Link to comment Share on other sites More sharing options...
Pegasus Posted July 12, 2018 Share Posted July 12, 2018 On 7/17/2017 at 3:35 AM, Butters said: So no ideas how to prevent this without doing woodoo stuff? Is this solved after 1 year? Quote Link to comment Share on other sites More sharing options...
dreameo Posted July 13, 2018 Share Posted July 13, 2018 I'm guessing each event was distinct? Event 1 - attempt: fail Event 2 - attempt: fail Event 3 - attempt: pass instead of Event 1 - attempt: fail Event 1 - attempt: fail Event 1 - attempt: pass Never tried interactevent befoh Quote Link to comment Share on other sites More sharing options...