Butters Posted July 16, 2017 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
Chris Posted July 16, 2017 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
Butters Posted July 16, 2017 Author 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
The Undefeated Posted July 16, 2017 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.
Butters Posted July 16, 2017 Author 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.
Butters Posted July 16, 2017 Author Posted July 16, 2017 So no ideas how to prevent this without doing woodoo stuff?
Pegasus Posted July 12, 2018 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?
dreameo Posted July 13, 2018 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