@Override
public void onMessage(Message m) throws InterruptedException {
super.onMessage(m);
/*message you want : our ring of dueling has 6 charges remaining. , cut it back to the number
so you could do : our ring of dueling has
or look for both halves exlcuding the number: "our ring of dueling has " , " charges remaining".
but the first should work anyway
*/
String theMessage = "our ring of dueling has ";
if(m.getMessage().contains(theMessage)){
String butcherMessage = m.getMessage().replace(theMessage, "").replace(" charges remaining.", "");
int result = Integer.valueOf(butcherMessage);
//use result here
}
}