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.

Non-breaking spaces [2.4.111]

Featured Replies

1. OSBot Version:

2.4.111

2. A description of the issue:

This may not be a bug, but certainly feels like an inconsistency! It causes a few issues when comparing usernames with spaces to a correctly formatted original. When calling message#getUsername(), non-breaking spaces are not replaced.

i.e when calling message#getUsername() with a player name containing a space, an unprintable character is in the space, namely ascii 160.

This means comparing two names

String name = "Example name";

and

String nameToCompare = message.getUsername();

 returns false under equals(), despite the usernames being the same.

3. Are you receiving any errors in the client canvas or the logger? 

No. Ascii code 160 is printed as a space though, despite it not directly being one.

4. How can you replicate the issue?

List<Message> messages = trade.getRequestListener().getRequests();
List<String> verifiedNames = new ArrayList<>(Arrays.asList("Egg cress", "Bacon mayo"));
for (Message m : messages) {
	String username = m.getUsername();
  	if (verifiedNames.contains(username))
    	   log("Username " + username + " verified.");
    	else
      	   log("Username " + username + " not in " + verifiedNames);
}

Solution:

String username = m.getUsername().replaceAll("\u00A0", " ");

 

Edited by Apaec

Player getUsername() returns their unformatted name, meaning you will get the no-break space and any image tags (such as ironman and mods). It's been like that for a pretty long time and if I change the behavior I may be breaking a lot of scripts.

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.