Jump to content

Get Player Name


someguy567

Recommended Posts

[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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ?

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