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.

Hiscores checker snippet

Featured Replies

How to use, simply add the player into your map. Then your able to access their skills, rank, level, and exp. I have to give some credit to @Swizzbeat, because i used parts of his snippet to build mine.

 

package dependencies.hiscores;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;

public class Hiscores {
	
	private Script script; 
	private static final String URL_BASE = "http://services.runescape.com/m=hiscore_oldschool/hiscorepersonal.ws?user1=";
	
	public Map<String, Map<Skill, Stat>> playersMap = new HashMap<String, Map<Skill, Stat>>();
		
	public Hiscores(Script s)	{
		script = s;
	}
	
	public static class Stat	{
		
		private int rank, level, exp;
		
		public Stat(int rank, int level, int exp)	{
			this.rank = rank;
			this.level = level;
			this.exp = exp;
		}
		
		public int getRank()	{
			return this.rank;
		}
		
		public int getLevel()	{
			return this.level;
		}
		
		public int getExp()	{
			return this.exp;
		}		
	}

	public int formatString(String string)	{
		String number = string.substring(string.indexOf('>') +1, string.lastIndexOf('<'));
		number = number.replace(",", "");
		return Integer.parseInt(number);
	}
	
	private void getInfo(String userName) throws IOException	{
		String name = userName.replace(" ", "_");
		URL url = new URL(URL_BASE + name);
		BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
		String skillName;

		
		while ((skillName = reader.readLine()) != null)	{
			for (Skill skill: Skill.values())	{
				int rank = 0, level = 0, exp = 0;
				String string;
				
				if (skillName.equalsIgnoreCase(skill.name()))	{
					for (int i = 0; i <= 3; i++)	{
						string = reader.readLine();
						if (i == 1)
							rank = formatString(string);
						else if (i == 2)
							level = formatString(string);
						else if (i == 3)
							exp = formatString(string);
					}
					
					if (!playersMap.containsKey(userName))	
						playersMap.put(userName, new HashMap<Skill, Hiscores.Stat>());
					else
						playersMap.get(userName).put(skill, new Stat(rank, level, exp));
				}				
			}
		}
		reader.close();
	}
		
	public void addPlayer(String userName) throws IOException	{
		if (playersMap.containsKey(userName))	
			playersMap.remove(userName);
		else
			this.getInfo(userName);		
	}
	
	public Stat get(String userName, Skill skill)	{
		if (playersMap.containsKey(userName))
			return playersMap.get(userName).get(skill);
		return null;
	}
} 

Edited by josedpay

  • Author

ohmy.png dry.png ill fix it quick

 

edit: fixed

Edited by josedpay

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.