screenshot plugin: add gauntlet loot screenshots
Co-authored-by: Adam <Adam@sigterm.info>
This commit is contained in:
@@ -33,6 +33,7 @@ import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -79,8 +80,8 @@ import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.HotkeyListener;
|
||||
import net.runelite.client.util.ImageCapture;
|
||||
import net.runelite.client.util.ImageUtil;
|
||||
import net.runelite.client.util.Text;
|
||||
import net.runelite.client.util.LinkBrowser;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Screenshot",
|
||||
@@ -90,6 +91,8 @@ import net.runelite.client.util.LinkBrowser;
|
||||
@Slf4j
|
||||
public class ScreenshotPlugin extends Plugin
|
||||
{
|
||||
private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!";
|
||||
private static final Map<Integer, String> CHEST_LOOT_EVENTS = ImmutableMap.of(12127, "The Gauntlet");
|
||||
private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)");
|
||||
private static final Pattern LEVEL_UP_PATTERN = Pattern.compile(".*Your ([a-zA-Z]+) (?:level is|are)? now (\\d+)\\.");
|
||||
private static final Pattern BOSSKILL_MESSAGE_PATTERN = Pattern.compile("Your (.+) kill count is: <col=ff0000>(\\d+)</col>.");
|
||||
@@ -346,6 +349,16 @@ public class ScreenshotPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (chatMessage.equals(CHEST_LOOTED_MESSAGE) && config.screenshotRewards())
|
||||
{
|
||||
final int regionID = client.getLocalPlayer().getWorldLocation().getRegionID();
|
||||
String eventName = CHEST_LOOT_EVENTS.get(regionID);
|
||||
if (eventName != null)
|
||||
{
|
||||
takeScreenshot(eventName, "Chest Loot");
|
||||
}
|
||||
}
|
||||
|
||||
if (config.screenshotValuableDrop())
|
||||
{
|
||||
Matcher m = VALUABLE_DROP_PATTERN.matcher(chatMessage);
|
||||
|
||||
Reference in New Issue
Block a user