runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java
/**
	 * Looks up the player skill and changes the original message to the
	 * response.
	 *
	 * @param setMessage The chat message containing the command.
	 * @param search The item given with the command.
	 */
Looks up the player skill and changes the original message to the
response.

@param setMessage The chat message containing the command.
@param search The item given with the command.
Looks up the player skill and changes the original message to the response . @param setMessage The chat message containing the command . @param search The item given with the command .
private void playerSkillLookup(ChatMessageType type, SetMessage setMessage, String search)
	{
		search = SkillAbbreviations.getFullName(search);
		String player;
		if (type.equals(ChatMessageType.PRIVATE_MESSAGE_SENT))
		{
			player = client.getLocalPlayer().getName();
		}
		else
		{
			player = sanitize(setMessage.getName());
		}
		HiscoreSkill skill;
		try
		{
			skill = HiscoreSkill.valueOf(search.toUpperCase());
		}
		catch (IllegalArgumentException i)
		{
			return;
		}
		try
		{
			SingleHiscoreSkillResult result = hiscoreClient.lookup(player, skill);
			Skill hiscoreSkill = result.getSkill();
			String response = new ChatMessageBuilder()
				.append(ChatColorType.NORMAL)
				.append("Level ")
				.append(ChatColorType.HIGHLIGHT)
				.append(skill.getName()).append(": ").append(String.valueOf(hiscoreSkill.getLevel()))
				.append(ChatColorType.NORMAL)
				.append(" Experience: ")
				.append(ChatColorType.HIGHLIGHT)
				.append(String.format("%,d", hiscoreSkill.getExperience()))
				.append(ChatColorType.NORMAL)
				.append(" Rank: ")
				.append(ChatColorType.HIGHLIGHT)
				.append(String.format("%,d", hiscoreSkill.getRank()))
				.build();
			log.debug("Setting response {}", response);
			final MessageNode messageNode = setMessage.getMessageNode();
			messageNode.setRuneLiteFormatMessage(response);
			chatMessageManager.update(messageNode);
			client.refreshChat();
		}
		catch (IOException ex)
		{
			log.warn("unable to look up skill {} for {}", skill, search, ex);
		}
	}
private void playerSkillLookup ( ChatMessageType type , SetMessage setMessage , String search ) { search = SkillAbbreviations . getFullName ( search ) ; String player ; if ( type . equals ( ChatMessageType . PRIVATE_MESSAGE_SENT ) ) { player = client . getLocalPlayer ( ) . getName ( ) ; } else { player = sanitize ( setMessage . getName ( ) ) ; } HiscoreSkill skill ; try { skill = HiscoreSkill . valueOf ( search . toUpperCase ( ) ) ; } catch ( IllegalArgumentException i ) { return ; } try { SingleHiscoreSkillResult result = hiscoreClient . lookup ( player , skill ) ; Skill hiscoreSkill = result . getSkill ( ) ; String response = new ChatMessageBuilder ( ) . append ( ChatColorType . NORMAL ) . append ( "Level " ) . append ( ChatColorType . HIGHLIGHT ) . append ( skill . getName ( ) ) . append ( ": " ) . append ( String . valueOf ( hiscoreSkill . getLevel ( ) ) ) . append ( ChatColorType . NORMAL ) . append ( " Experience: " ) . append ( ChatColorType . HIGHLIGHT ) . append ( String . format ( "%,d" , hiscoreSkill . getExperience ( ) ) ) . append ( ChatColorType . NORMAL ) . append ( " Rank: " ) . append ( ChatColorType . HIGHLIGHT ) . append ( String . format ( "%,d" , hiscoreSkill . getRank ( ) ) ) . build ( ) ; log . debug ( "Setting response {}" , response ) ; final MessageNode messageNode = setMessage . getMessageNode ( ) ; messageNode . setRuneLiteFormatMessage ( response ) ; chatMessageManager . update ( messageNode ) ; client . refreshChat ( ) ; } catch ( IOException ex ) { log . warn ( "unable to look up skill {} for {}" , skill , search , ex ) ; } }
Looks up the player skill and changes the original message to the
 response.
Looks up the player skill and changes the original message to the response .