chat commands: fix detecting pb when completing leagues tasks

The league task message is in between the kc and pb messages, so just look for the pb message on the same tick as the kc message
This commit is contained in:
Adam
2020-12-04 15:50:21 -05:00
parent f5a76e9961
commit 3771444b7f
2 changed files with 25 additions and 1 deletions

View File

@@ -679,4 +679,20 @@ public class ChatCommandsPluginTest
verify(configManager).setRSProfileConfiguration("killcount", "hallowed sepulchre", 36);
}
@Test
public void testJadNewPbWithLeagueTask()
{
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzTok-Jad kill count is: <col=ff0000>2</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Congratulations, you've completed a master task: <col=7f3700>Complete the Fight Caves in 25:00</col>.", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: <col=ff0000>21:58</col> (new personal best)", null, 0);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setRSProfileConfiguration(eq("personalbest"), eq("tztok-jad"), eq(21 * 60 + 58));
verify(configManager).setRSProfileConfiguration(eq("killcount"), eq("tztok-jad"), eq(2));
}
}