Jump to content

Get Player Name


Recommended Posts

Posted
[ERROR][Bot #1][10/12 03:07:53 AM]: Error in script executor!
java.lang.NullPointerException
	at org.osbot.rs07.api.model.Player.getName(vm:172)
	at org.osbot.rs07.api.filter.NameFilter.match(bi:56)
	at org.osbot.rs07.api.filter.NameFilter.match(bi:188)
	at org.osbot.rs07.api.filter.FilterAPI.filter(ag:96)
	at org.osbot.rs07.api.EntityAPI.closest(an:174)
	at org.osbot.rs07.api.EntityAPI.closest(an:100)
	at org.osbot.rs07.api.EntityAPI.closest(an:75)
	at Muling.trade(Muling.java:88)
	at Muling.onLoop(Muling.java:63)
	at org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(fo:211)
	at java.lang.Thread.run(Thread.java:748)
	private void trade() {
		if (botName != null) {
			Player player = getPlayers().closest(botName);
			if (player != null && !myPlayer().isMoving() && Banks.GRAND_EXCHANGE.contains(player)) {
				player.interact("Trade with");
				Sleep.sleepUntil(() -> getTrade().isCurrentlyTrading(), 10000);
			}
		}
	}

Anyone know how that NullPointerException could be happening? I've made sure it checks whether the botName string is null or not, then I've made sure to check if the player was null.

What's going on?

Posted (edited)

There is currently an issue with the client due to the recent update, this could be causing that.

Also if "player" is null, this will cause you an issue:

Banks.GRAND_EXCHANGE.contains(player)

 

if (player != null && !myPlayer().isMoving()) {
        if(Banks.GRAND_EXCHANGE.contains(player) ) {
	         player.interact("Trade with");
	         Sleep.sleepUntil(() -> getTrade().isCurrentlyTrading(), 10000);
        }
}
Edited by ihom
Posted
2 hours ago, ihom said:

Then yes, your issue is caused by the recent update.
Same problem with "getNpcs()".

hey i have a question not entirely related to this thread, how long does it normally take for the issues with the bots to get resolved after a new update and when would i know it's fixed.  i make my own private scripts for myself and this is the first time i really encountered a big problem with this

Posted
5 hours ago, datpigeon said:

hey i have a question not entirely related to this thread, how long does it normally take for the issues with the bots to get resolved after a new update and when would i know it's fixed.  i make my own private scripts for myself and this is the first time i really encountered a big problem with this

I assume it could take a minute, it could take a month.. How long's a piece of string?

If these guys are reverse engineering the client and something major has changed, it could take weeks..

Just sit back and play the game until it's back up ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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