chat commands: count barrows chests too
This commit is contained in:
@@ -79,6 +79,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
|||||||
private static final Pattern KILLCOUNT_PATERN = Pattern.compile("Your (.+) kill count is: <col=ff0000>(\\d+)</col>.");
|
private static final Pattern KILLCOUNT_PATERN = Pattern.compile("Your (.+) kill 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 RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: <col=ff0000>(\\d+)</col>.");
|
||||||
private static final Pattern WINTERTODT_PATERN = Pattern.compile("Your subdued Wintertodt count is: <col=ff0000>(\\d+)</col>.");
|
private static final Pattern WINTERTODT_PATERN = Pattern.compile("Your subdued Wintertodt count is: <col=ff0000>(\\d+)</col>.");
|
||||||
|
private static final Pattern BARROWS_PATERN = Pattern.compile("Your Barrows chest count is: <col=ff0000>(\\d+)</col>.");
|
||||||
|
|
||||||
private final HiscoreClient hiscoreClient = new HiscoreClient();
|
private final HiscoreClient hiscoreClient = new HiscoreClient();
|
||||||
private final KillCountClient killCountClient = new KillCountClient();
|
private final KillCountClient killCountClient = new KillCountClient();
|
||||||
@@ -248,6 +249,14 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
|||||||
|
|
||||||
setKc(boss, kc);
|
setKc(boss, kc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
matcher = BARROWS_PATERN.matcher(message);
|
||||||
|
if (matcher.find())
|
||||||
|
{
|
||||||
|
int kc = Integer.parseInt(matcher.group(1));
|
||||||
|
|
||||||
|
setKc("Barrows", kc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -117,4 +117,15 @@ public class ChatCommandsPluginTest
|
|||||||
|
|
||||||
verify(configManager).setConfiguration("killcount.adam", "kree'arra", 4);
|
verify(configManager).setConfiguration("killcount.adam", "kree'arra", 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBarrows()
|
||||||
|
{
|
||||||
|
when(client.getUsername()).thenReturn("Adam");
|
||||||
|
|
||||||
|
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "", "Your Barrows chest count is: <col=ff0000>277</col>.", null);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessageEvent);
|
||||||
|
|
||||||
|
verify(configManager).setConfiguration("killcount.adam", "barrows", 277);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user