Add support for parsing Wilderness assignment updates to slayer plugin (#5757)

Fixes #5687
This commit is contained in:
robinwithes
2018-10-03 15:00:20 +02:00
committed by Tomas Slusny
parent 13a85f39ea
commit 2adb760f02
2 changed files with 22 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ import net.runelite.client.util.Text;
public class SlayerPlugin extends Plugin
{
//Chat messages
private static final Pattern CHAT_GEM_PROGRESS_MESSAGE = Pattern.compile("You're assigned to kill (.*); only (\\d*) more to go\\.");
private static final Pattern CHAT_GEM_PROGRESS_MESSAGE = Pattern.compile("You're assigned to kill (.*?)(?: in the Wilderness)?; only (\\d*) more to go\\.");
private static final String CHAT_GEM_COMPLETE_MESSAGE = "You need something new to hunt.";
private static final Pattern CHAT_COMPLETE_MESSAGE = Pattern.compile("(?:\\d+,)*\\d+");
private static final String CHAT_CANCEL_MESSAGE = "Your task has been cancelled.";
@@ -418,13 +418,13 @@ public class SlayerPlugin extends Plugin
}
Matcher mProgress = CHAT_GEM_PROGRESS_MESSAGE.matcher(chatMsg);
if (!mProgress.find())
{
return;
}
String taskName = mProgress.group(1);
int amount = Integer.parseInt(mProgress.group(2));
setTask(taskName, amount);
}