I've been trying to see if i can add some parsing to weaponm.
so i added some code to different files in the hope that it will work. I was trying to add a catch for You Recover 22 of your turns. message and update my turn variable in the database which would subsequently i would think update the status panel unless i have to explicitly fire off a event.
DataLexer.jplexCode:
<Rule expr="{LD}\[KYou recover \[1;36m{NN_INTEGER}\[0;35m of your turns\." event="recoverTurns"/>
DataParser.javaCode:
// Updating turns as events happen
@Override
public void recoverTurns(CharSequence seq, int off, int len) {
you.setTurns(you.getTurns()+ParserUtils.findInteger(seq, off, len));
}
DataEventAdapter.javaCode:
@Override
public void recoverTurns(CharSequence seq, int off, int len) {
}
DataEventListener.javaCode:
public void recoverTurns(CharSequence seq, int off, int len);
DataEventLogger.javaCode:
@Override
public void recoverTurns(CharSequence seq, int off, int len) {
logger.debug("recoverTurns: " + seq.subSequence(off, off + len));
}
I then made sure i exported JPlex to a jar with its libraries like you mentioned and ran it to produce new .gz files which also looks like it modified DataLexer.java
but I don't get anything firing in the console. Did i do too many steps? or miss anything? I've never used regular expressions before, so maybe that is where i'm going wrong. i just tried to copy the one above which pulls "You have 33 turns this Stardate." but then also noticed that it doesn't trigger anything in the console either.