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.

Interacting entity

Featured Replies

We'll have to do with this as long as it's not hooked, I needed this for my script and I decided to share it with you people.

 

public Entity getInteracting(final org.osbot.script.rs2.model.Character<?> character) {
        try {
            final ClassLoader loader = provider.bot.I();
            final Field field = loader.loadClass("aw").getDeclaredField("ao");
            field.setAccessible(true);
            final int index = field.getInt(character.instance) * 1850266567;
            final XClient client = provider.client.instance;
            if (index == -1) {
                return null;
            } else if (index > 32767) {
                final XPlayer[] players = client.getLocalPlayers();
                return new Player(players[index - 32768]);
            } else {
                final XNPC[] npcs = client.getLocalNpcs();
                return new NPC(npcs[index]);
            }
        } catch (final Exception e) {
            provider.log(e.getMessage());
        }
        return null;
    }

Probably self explanatory but it uses the bots classloader to load class aw (entity/character/actor) and retrieve field ao (interacting index). It then changes the modifier of this field to public. If index = -1 (no interacting entity) it returns null, if the index is higher than 32767 (the size of the npc array), the interacting entity is a player and therefor it gets the player array (obviously unmodified) and subtracts 32768 from the index to get the index in the player array. If the index is not higher than 32767 (so 32767 and lower) it'll just get the instance out of the unmodified npc array and return a new NPC.
 
Images:
 
68lqN.jpg
 
68ltq.jpg
 
68lwf.jpg

Edited by Parameter

  • Author

Useless since this is hooked and working fine smile.png

No offense but the api is so messy it is very hard to find, please do point me in the right direction.

Oh you call it getFacing? Fucking Laz with his weird naming it drives me crazy

Edited by Parameter

Guest
This topic is now closed to further replies.

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.