Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Question about InteractionEvent

Featured Replies

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?

if the event executes sucessfully then it will be true? true meaning it did the action "Trade with"

it will fail it couldnt interact

 

  • Author
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

 

it will fail if it couldnt click the action

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.

  • Author
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. 

  • Author

So no ideas how to prevent this without doing woodoo stuff?

  • 11 months later...
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?:think:

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

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.