Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class EconomyService implements IMessageReceiveListener {
// payday
private static final Pattern PAYDAY_TIME_PATTERN = compile("^- Zeit seit PayDay: (?<minutes>\\d+)/60 Minuten$");
private static final Pattern PAYDAY_SALARY_PATTERN = compile("^\\[PayDay] Du bekommst dein Gehalt von (?<money>\\d+)\\$ am PayDay ausgezahlt\\.$");
private static final Pattern PAYDAY_MINE_SALARY_PATTERN = compile("^\\[PayDay] Du bekommst deine Mine Einnahmen von (?<money>\\d+)\\$ am PayDay ausgezahlt\\.$");

// other
private static final Pattern ATM_MONEY_AMOUNT_PATTERN = compile("ATM \\d+: (?<moneyAtmAmount>\\d+)\\$/100000\\$");
Expand Down Expand Up @@ -193,6 +194,13 @@ public boolean onMessageReceive(Text text, String message) {
return true;
}

Matcher paydayMineSalaryMatcher = PAYDAY_MINE_SALARY_PATTERN.matcher(message);
if (paydayMineSalaryMatcher.find()) {
int money = parseInt(paydayMineSalaryMatcher.group("money"));
configuration.addPredictedPayDaySalary(money);
return true;
}

Matcher moneyAtmAmountMatcher = ATM_MONEY_AMOUNT_PATTERN.matcher(message);
if (moneyAtmAmountMatcher.find()) {
int moneyAtmAmount = parseInt(moneyAtmAmountMatcher.group("moneyAtmAmount"));
Expand Down