Jump to content

Bug with API Interact?


DylanSRT

Recommended Posts

I'm using the following the stream to identify an NPC but keep getting a weird exception occasionally while interacting with it. It only happens sometimes and it can usually be fixed by pausing and unpausing script.

I'm pretty sure it is something wrong with the API because I did not have this issue earlier. Can anyone deduce what is going on or suggest a fix?

    private Predicate<NPC> myCat = n -> n != null && n.isVisible() &&
            n.hasAction("Chase") &&
            !n.isAnimating() &&
            basement.contains(n);

       cat =
                npcs.getAll().stream().filter(myCat).min(new Comparator<NPC>() {
                    public int compare(NPC one, NPC two) {
                        return Integer.compare(getMap().distance(one), getMap().distance(two));
                    }
                }).orElse(null);

if(cat.isPresent(){
   cat.get().interact("Chase")
}
    
    
    
Error executing event : org.osbot.rs07.event.InteractionEvent@348ff5
java.lang.ArrayIndexOutOfBoundsException: -2922
	at org.osbot.rs07.api.NPCS.getLocalNPC(dn:178)
	at org.osbot.rs07.api.Mouse.getEntitiesOnCursor(tj:401)
	at org.osbot.rs07.api.Mouse.isOnCursor(tj:65)
	at org.osbot.rs07.input.mouse.EntityDestination.evaluate(pg:286)
	at org.osbot.rs07.event.InteractionEvent.IIIIiiiiIIii(zi:185)
	at org.osbot.rs07.event.InteractionEvent.execute(zi:349)
	at org.osbot.rs07.event.EventExecutor$2.run(le:246)
	at org.osbot.rs07.event.EventExecutor.execute(le:171)
	at org.osbot.rs07.api.model.Character.interact(pl:464)
	at RatCatcher.onLoop(RatCatcher.java:131)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(bp:22)
	at java.lang.Thread.run(Unknown Source)

 

 

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, Token said:

That looks like a mirror mode error, are you using stealth injection?

Nope, I never use stealth injection =/ . My guess is you are right though. Do you think whoever works on mirror mode can take a look at it? It's not just NPCs. It happens when interacting with Ground Items as well.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...