loottracker: fix tracking first clue opens
This commit is contained in:
@@ -112,7 +112,7 @@ import org.apache.commons.text.WordUtils;
|
||||
public class LootTrackerPlugin extends Plugin
|
||||
{
|
||||
// Activity/Event loot handling
|
||||
private static final Pattern CLUE_SCROLL_PATTERN = Pattern.compile("You have completed [0-9]+ ([a-z]+) Treasure Trails.");
|
||||
private static final Pattern CLUE_SCROLL_PATTERN = Pattern.compile("You have completed [0-9]+ ([a-z]+) Treasure Trails?\\.");
|
||||
private static final int THEATRE_OF_BLOOD_REGION = 12867;
|
||||
|
||||
// Herbiboar loot handling
|
||||
|
||||
@@ -76,19 +76,29 @@ public class LootTrackerPluginTest
|
||||
public void setUp()
|
||||
{
|
||||
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||
|
||||
Player player = mock(Player.class);
|
||||
when(player.getWorldLocation()).thenReturn(new WorldPoint(0, 0, 0));
|
||||
when(client.getLocalPlayer()).thenReturn(player);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPickPocket()
|
||||
{
|
||||
Player player = mock(Player.class);
|
||||
when(player.getWorldLocation()).thenReturn(new WorldPoint(0, 0, 0));
|
||||
when(client.getLocalPlayer()).thenReturn(player);
|
||||
|
||||
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", "You pick the hero's pocket.", "", 0);
|
||||
lootTrackerPlugin.onChatMessage(chatMessage);
|
||||
|
||||
assertEquals("Hero", lootTrackerPlugin.eventType);
|
||||
assertEquals(LootRecordType.PICKPOCKET, lootTrackerPlugin.lootRecordType);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFirstClue()
|
||||
{
|
||||
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "You have completed 1 master Treasure Trail.", "", 0);
|
||||
lootTrackerPlugin.onChatMessage(chatMessage);
|
||||
|
||||
assertEquals("Clue Scroll (Master)", lootTrackerPlugin.eventType);
|
||||
assertEquals(LootRecordType.EVENT, lootTrackerPlugin.lootRecordType);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user