public String handleMessage(String sender, String message) { if (message.equals("!help")) { return "Channel: " + "Sending you help via msg Sender: " + "!linkme Stats Graph " + "!remembername Stores the RSN for an IRC nick Sender: " + "!hiscore HiscoresSender: " + "!price Price LookupSender: " + "!w dictionary reference to the wordSender: " + "!urban Urban dictionary reference to the word. Sender: " + "!xp 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"); } }