chat commands: add gauntlet kc

Co-authored-by: Robbie McLeod <rbbi@users.noreply.github.com>
This commit is contained in:
Adam
2019-07-29 09:08:04 -04:00
committed by Adam
parent 879628e876
commit 5d884787b7
2 changed files with 33 additions and 1 deletions

View File

@@ -83,7 +83,7 @@ import org.apache.commons.text.WordUtils;
@Slf4j
public class ChatCommandsPlugin extends Plugin
{
private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap) count is: <col=ff0000>(\\d+)</col>");
private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: <col=ff0000>(\\d+)</col>");
private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: <col=ff0000>(\\d+)</col>");
private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: <col=ff0000>(\\d+)</col>");
private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: <col=ff0000>(\\d+)</col>");
@@ -1351,6 +1351,16 @@ public class ChatCommandsPlugin extends Plugin
case "prifddinas":
return "Prifddinas Agility Course";
// The Gauntlet
case "gaunt":
case "gauntlet":
return "Gauntlet";
// Corrupted Gauntlet
case "cgaunt":
case "cgauntlet":
return "Corrupted Gauntlet";
default:
return WordUtils.capitalize(boss);
}

View File

@@ -142,6 +142,28 @@ public class ChatCommandsPluginTest
verify(configManager).setConfiguration("killcount.adam", "herbiboar", 4091);
}
@Test
public void testGauntlet()
{
when(client.getUsername()).thenReturn("Adam");
ChatMessage gauntletMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: <col=ff0000>123</col>.", null, 0);
chatCommandsPlugin.onChatMessage(gauntletMessage);
verify(configManager).setConfiguration("killcount.adam", "gauntlet", 123);
}
@Test
public void testCorruptedGauntlet()
{
when(client.getUsername()).thenReturn("Adam");
ChatMessage corruptedGauntletMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Corrupted Gauntlet completion count is: <col=ff0000>4729</col>.", null, 0);
chatCommandsPlugin.onChatMessage(corruptedGauntletMessage);
verify(configManager).setConfiguration("killcount.adam", "corrupted gauntlet", 4729);
}
@Test
public void testPersonalBest()
{