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.

List allPlayers = getPlayers().getAll(); - How to get display names?

Featured Replies

Hi brothers, how do you get the display name of other characters?

 

Im get only

org.osbot.rs07.api.model.Player@1f2b425

And it dont match with my admin string

			if (getInventory().contains(7936) && getInventory().getAmount(7936) > 4) {
				// trade for ess	
				java.util.List<Player> allPlayers = getPlayers().getAll();
				if (!hosts.contains(admin)) {
					hosts.add(admin);
				}
				if (allPlayers != null) {
					for (int i = 0; i < allPlayers.size(); i++) {
						log(allPlayers.get(i));
						log(hosts);
						if (hosts.contains(allPlayers.get(i))) {
							playerMatch = allPlayers.get(i);
							//playerMatch.interact("Follow");
							break;
						}
						
					}
					new ConditionalSleep(2000) {
						@Override
						public boolean condition() throws InterruptedException {
							return trade.isFirstInterfaceOpen();
						}
					}.sleep();
					if (trade.isCurrentlyTrading()) {
						if (trade.isFirstInterfaceOpen()) {
							trade.offerAll(7936);
						}
						if (trade.getTheirOffers().onlyContains(7937, 995) && trade.didOtherAcceptTrade()) {
							trade.acceptTrade();
						}
						if (trade.isSecondInterfaceOpen() && trade.getTheirOffers().onlyContains(7937, 995)
								&& trade.didOtherAcceptTrade()) {
							trade.acceptTrade();
						}
					}
				}
			}

Edited by semanji

getName().

 

Note that rs names contain special space characters, which do not equal to regular spaces

 

Hi brothers, how do you get the display name of other characters?

 

Im get only

org.osbot.rs07.api.model.Player@1f2b425

And it dont match with my admin string

			
if (hosts.contains(allPlayers.get(i))) 
										

 

use getName(), but you will also need to account for non breaking spaces in their name so use:

if (hosts.contains(allPlayers.get(i).getName().replace('\u00A0', ' ')))

Edited by Explv

  • Author

getName().

 

Note that rs names contain special space characters, which do not equal to regular spaces

Thankyou =]

 

I already found this space problem earlier =] runescape uses non blocking space right?

Create an account or sign in to comment

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.