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.

[2.3.77] Character#getInteracting broken

Featured Replies

OSBot version number: 2.3.77

Description of the bug/error: Character#getInteracting always returns null

Instructions how to replicate the bug/error: Check what an attacking npc is interacting with

(IF APPLICABLE) SSCCE that causes the bug/error: N/A

(IF APPLICABLE) Script name ran causing the bug/error. Optionally include relevant parts of source code:

FrostBarrows

(IF APPLICABLE) Screenshots:

fd1c93438693722b172b883d759266f3.png

Can we get an update on this bug? I have been unable to use this bot since that bug came up... 

  • Author

I'll need to hide my script from the SDN fairly soon if I don't get an update on this..

 

The issue boils down to Client#getMyPlayerIndex being broken (always -1)

Edited by FrostBug

  • Author

I was about to report the same bug today.

It does work sometimes for other players though.

 

any news on this?

 

Khaleesi

 

it always works for other players

 

The issue is that the index of the local player is -1; so the thread title is a bit misleading

 

EDIT: I tried hooking the LocalPlayerIndex field according to rsh updater logs; and that too returns -1 :s.. this is strange

Edited by FrostBug

it always works for other players

 

The issue is that the index of the local player is -1; so the thread title is a bit misleading

 

Ow I see, I didn't test other players properly.

I just noticed that the monsters returned the right player if it was not my player.

 

Thx for clearing this out.

 

I hope this gets fixed quickly =)

 

Khaleesi

it always works for other players

 

The issue is that the index of the local player is -1; so the thread title is a bit misleading

 

EDIT: I tried hooking the LocalPlayerIndex field according to rsh updater logs; and that too returns -1 :s.. this is strange

 

 

try

 

myPlayerIndex ~ [FieldNode] Owner: client, Name: hf, Desc: I GetterModifier: 96403577

  • Author

temp workaround:

 

	public Character<?> getInteracting(Character<?> c) {
		int uid = c.accessor.getCharacterFacingUid();
		if (uid == -1) {
			return null;
		}

		if (uid < 0x8000) {
			return getNpcs().getLocalNPC(uid);
		} else {
			uid -= 0x8000;
			Player player = getPlayers().getLocalPlayer(uid);
			if (uid == getClient().getMyPlayerIndex() || player == null) {
				return myPlayer();
			}
			return player;
		}
	}

 

Note, this temp workaround probably returns the local player in the case of an npc interacting with a player who isn't loaded (offscreen).. But I guess it will have to do for now


try

 

myPlayerIndex ~ [FieldNode] Owner: client, Name: hf, Desc: I GetterModifier: 96403577

 

That is the same as the rsh one. Aka. the one I tried
 

temp workaround:

 

	public Character<?> getInteracting(Character<?> c) {
		int uid = c.accessor.getCharacterFacingUid();
		if (uid == -1) {
			return null;
		}

		if (uid < 0x8000) {
			return getNpcs().getLocalNPC(uid);
		} else {
			uid -= 0x8000;
			Player player = getPlayers().getLocalPlayer(uid);
			if (uid == getClient().getMyPlayerIndex() || player == null) {
				return myPlayer();
			}
			return player;
		}
	}

 

Note, this temp workaround probably returns the local player in the case of an npc interacting with a player who isn't loaded (offscreen).. But I guess it will have to do for now

 

That is the same as the rsh one. Aka. the one I tried

 

 

works in my own private bot

  • Administrator

I'll need to hide my script from the SDN fairly soon if I don't get an update on this..

 

The issue boils down to Client#getMyPlayerIndex being broken (always -1)

 

It was fixed at around 9AM PST.

I was told in the scripters' chat around that time. Sorry for the delay.

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.