chat commands: add raids pattern

This commit is contained in:
Magic fTail
2018-07-13 06:26:19 +02:00
committed by Adam
parent cbc531a9f8
commit 6d3b764b4e

View File

@@ -77,6 +77,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
{
private static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
private static final Pattern KILLCOUNT_PATERN = Pattern.compile("Your ([a-zA-Z ]+) kill count is: <col=ff0000>(\\d+)</col>.");
private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed ([a-zA-Z ]+) count is: <col=ff0000>(\\d+)</col>.");
private static final Pattern WINTERTODT_PATERN = Pattern.compile("Your subdued Wintertodt count is: <col=ff0000>(\\d+)</col>.");
private final HiscoreClient hiscoreClient = new HiscoreClient();
@@ -238,6 +239,15 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
setKc("Wintertodt", kc);
}
matcher = RAIDS_PATTERN.matcher(message);
if (matcher.find())
{
String boss = matcher.group(1);
int kc = Integer.parseInt(matcher.group(2));
setKc(boss, kc);
}
}
@Override