All pastes #758097 Raw Edit

Someone

public text v1 · immutable
·published 2007-11-01 22:14 UTC
rendered paste body
	public String handleMessage(String sender, String message) {
		if (message.equals("!help")) {
			return "Channel: " + "Sending you help via msg </n> Sender: "
			+ "!linkme <RSN - Optional>  Stats Graph </n> " 
			+ "!remembername <RSN> Stores the RSN for an IRC nick </n> Sender: " 
			+ "!hiscore <rsn - optional> <skill>  Hiscores</n>Sender: " 
			+ "!price <item> Price Lookup</n>Sender: " 
			+ "!w <word>  dictionary reference to the word</n>Sender: " 
			+ "!urban <word>  Urban dictionary reference to the word. </n>Sender: "
			+ "!xp <user - optional> <skill> <goal level - optional> Calculates ways to get to the goal level (or next level) in the skill.";
		}
		if (message.startsWith("!rsname")) {
			String[] rsnameSplit = message.split(" ");
			return "Channel: " + rsnameSplit[1] + " - " + (String) rsname.get(rsnameSplit[1]);
		}
		if (message.startsWith("!remember")) {
			String[] remember = message.split(" ");
			rsname.put(sender, remember[1]);
			writeNames();
			return "Channel: " + "Associating RSN " + remember[1] + " with nick " + sender;
					}
		if (message.startsWith("!link")) {
			String[] split = message.split(" ");
			if (split.length == 1 ) {
				String realname = (String) rsname.get(sender);
					if (realname == null) {
						realname = sender;
					}
					return "Channel: " + "http://guilds.sinthos-soft.com/rs/stats/rs_levels.php?user=" + realname;
			}
			else {return "Channel: " + "http://guilds.sinthos-soft.com/rs/stats/rs_levels.php?user=" + split[1];
			}
		}
		if (message.startsWith("!price")) {
			String priceSearch;
			String[] priceSplit = message.split(" ", 2);
			priceSearch = priceSplit[1].replaceAll(" ", "+");
			writePrice(sender, sender, priceSearch);
			return "";
		}
		if (message.startsWith("!cmb")) {
			String[] combatSplit = message.split(" ");
			String realname2 = combatSplit[1];
			writeCombat(realname2);
			return "";
		}
		if (message.startsWith("!urban")) {
			String[] urbanLookup = message.split(" ", 2);
			urbanLookup[1] = urbanLookup[1].replaceAll(" ", "+");
			return "Channel: " + "http://www.urbandictionary.com/define.php?term=" + urbanLookup[1];
		}
		if (message.startsWith("!w")) {
			String[] word = message.split(" ");
			return "Channel: " + "http://dictionary.reference.com/search?q=" + word[1];
		}
		if (message.startsWith("!pot")) {
			String[] potSplit = message.split(" ");
			String pot = potSplit[1];
			potHash.removePotAbbrevs(pot);
			return "Channel: " + (String) potHash.potHash.get("range");
		}
	
	}