Skip 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.

[2.4.15] map.canReach(entity)

Featured Replies

Returns true if an entity is behind a door. Since OSBot on its own cannot pass through a door, this shouldn't be the case.

Looking at this now. Closing this topic temporarily so I don't get redundant information.

 

Edit: I'm going to have to ask you to use the bug report template so I can gather more information.

Edit2: The other dummy door was closed too.

 

33770f7eb0af75491e80f7cb1e1dd435.png

 

Some more tests:
b0d0830556fcb2b4db4c165e3cb73a12.png

 

  • Author

You deleted the thread I posted using the template, but this one was approved. I hope that wasn't on purpose...

 

13e3891dbce0861ff58b1d9c306cfc24.png

 

This is the filter I'm using to search for entities:

getContext().getWebWalker().interactWith(location,
                        "Attack", entity -> {
                            if (entity instanceof NPC) {
                                NPC npc = (NPC) entity;
                                if (!script.isAttackUnreachable() || getContext().getMap().canReach(npc))
                                    return npc.getHealth() > 0
                                            && npc.getLevel() < 1337
                                            && monsters.stream().anyMatch(s -> npc.getName().equalsIgnoreCase(s))
                                            && npc.getInteracting() == null;
                            }
                            return false;
                        });

Relevant debug:

[INFO][Bot #1][12/04 11:47:32 PM]: Executing node: FightMonster
[INFO][Bot #1][12/04 11:47:32 PM]: Attacking unreachable monsters? false
[INFO][Bot #1][12/04 11:47:32 PM]: Searching for entity at id=136 name=Chicken, x=3229y=3296, z=0
[INFO][Bot #1][12/04 11:47:34 PM]: Successfully interacted with [Farmer]
[INFO][Bot #1][12/04 11:47:34 PM]: Can reach? false

Looking at this line in particular:

                                if (!script.isAttackUnreachable() || getContext().getMap().canReach(npc))

Looks like 

!script.isAttackUnreachable()

was the problem... Brb hanging myself.

 

Sorry I wasted your time.

 

 

Edited by Valkyr

 

You deleted the thread I posted using the template, but this one was approved. I hope that wasn't on purpose...

 

13e3891dbce0861ff58b1d9c306cfc24.png

 

This is the filter I'm using to search for entities:

getContext().getWebWalker().interactWith(location,
                        "Attack", entity -> {
                            if (entity instanceof NPC) {
                                NPC npc = (NPC) entity;
                                if (!script.isAttackUnreachable() || getContext().getMap().canReach(npc))
                                    return npc.getHealth() > 0
                                            && npc.getLevel() < 1337
                                            && monsters.stream().anyMatch(s -> npc.getName().equalsIgnoreCase(s))
                                            && npc.getInteracting() == null;
                            }
                            return false;
                        });

Looking at this line in particular:

                                if (!script.isAttackUnreachable() || getContext().getMap().canReach(npc))

Relevant debug:

[INFO][Bot #1][12/04 11:47:32 PM]: Executing node: FightMonster
[INFO][Bot #1][12/04 11:47:32 PM]: Attacking unreachable monsters? false
[INFO][Bot #1][12/04 11:47:32 PM]: Searching for entity at id=136 name=Chicken, x=3229y=3296, z=0
[INFO][Bot #1][12/04 11:47:34 PM]: Successfully interacted with [Farmer]
[INFO][Bot #1][12/04 11:47:34 PM]: Can reach? false

 

Break it down using bare bones vanilla api like I did above, simply map.canReach(). Once you find specifically something which is not correct, let me know. I tested ground items, objects, npc, different planes, obstacles, walls, etc.

Also I didn't check your other thread, I assumed they were duplicates.

  • Author

Status?

canReach is fine, I said the presence of a single ! was the issue ;-;

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

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.