diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java index f0d01d51c0..42a588c778 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotConfig.java @@ -133,4 +133,15 @@ public interface ScreenshotConfig extends Config { return false; } + + @ConfigItem( + keyName = "kills", + name = "Screenshot PvP Kills", + description = "Configures whether or not screenshots are automatically taken of PvP kills", + position = 9 + ) + default boolean screenshotKills() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java index 4f4d7f8107..52c5057bd5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/screenshot/ScreenshotPlugin.java @@ -107,10 +107,15 @@ public class ScreenshotPlugin extends Plugin 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 ImmutableList petMessages = ImmutableList.of("You have a funny feeling like you're being followed", + private static final ImmutableList PET_MESSAGES = ImmutableList.of("You have a funny feeling like you're being followed", "You feel something weird sneaking into your backpack", "You have a funny feeling like you would have been followed"); + private static final ImmutableList KILL_MESSAGES = ImmutableList.of("into tiny pieces and sat on them", "you have obliterated", + "falls before your might", "A humiliating defeat for", "With a crushing blow you", "thinking challenging you", + "Can anyone defeat you? Certainly", "was no match for you", "You were clearly a better fighter than", "RIP", + "You have defeated", "What an embarrassing performance by", "was no match for your awesomeness"); + private String clueType; private Integer clueNumber; @@ -252,12 +257,18 @@ public class ScreenshotPlugin extends Plugin return; } } - - if (config.screenshotPet() && petMessages.stream().anyMatch(chatMessage::contains)) + + if (config.screenshotPet() && PET_MESSAGES.stream().anyMatch(chatMessage::contains)) { String fileName = "Pet " + TIME_FORMAT.format(new Date()); takeScreenshot(fileName); } + + if (config.screenshotKills() && KILL_MESSAGES.stream().anyMatch(chatMessage::contains)) + { + String fileName = "Kill " + " " + LocalDate.now(); + takeScreenshot(fileName); + } } @Subscribe