From f72071f5bf01789272dc224e259cdeeb4a9ee5e7 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 4 Jun 2018 09:49:33 -0400 Subject: [PATCH 1/2] screenshot plugin: capitalize pet messages constant --- .../client/plugins/screenshot/ScreenshotPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..02db8d3edf 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,7 +107,7 @@ 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"); @@ -252,8 +252,8 @@ 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); From 18ee215f6da66ab08140b10655bb2f6f68e62d37 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 4 Jun 2018 09:49:55 -0400 Subject: [PATCH 2/2] screenshot plugin: screenshot pvp kills --- .../client/plugins/screenshot/ScreenshotConfig.java | 11 +++++++++++ .../client/plugins/screenshot/ScreenshotPlugin.java | 11 +++++++++++ 2 files changed, 22 insertions(+) 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 02db8d3edf..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 @@ -111,6 +111,11 @@ public class ScreenshotPlugin extends Plugin "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; @@ -258,6 +263,12 @@ public class ScreenshotPlugin extends Plugin 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