From 4e7d5489403c80df65f2f34a314a7a5d6084fe90 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 2 Mar 2021 17:42:44 -0500 Subject: [PATCH 1/8] perspective: add plane parameter to getCanvasTileAreaPoly --- .../src/main/java/net/runelite/api/Perspective.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Perspective.java b/runelite-api/src/main/java/net/runelite/api/Perspective.java index 8c309ccf3d..06c84f08f2 100644 --- a/runelite-api/src/main/java/net/runelite/api/Perspective.java +++ b/runelite-api/src/main/java/net/runelite/api/Perspective.java @@ -375,7 +375,7 @@ public class Perspective */ public static Polygon getCanvasTilePoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int zOffset) { - return getCanvasTileAreaPoly(client, localLocation, 1, 1, zOffset); + return getCanvasTileAreaPoly(client, localLocation, 1, 1, client.getPlane(), zOffset); } /** @@ -388,7 +388,7 @@ public class Perspective */ public static Polygon getCanvasTileAreaPoly(@Nonnull Client client, @Nonnull LocalPoint localLocation, int size) { - return getCanvasTileAreaPoly(client, localLocation, size, size, 0); + return getCanvasTileAreaPoly(client, localLocation, size, size, client.getPlane(), 0); } /** @@ -398,6 +398,7 @@ public class Perspective * @param localLocation the center location of the AoE * @param sizeX the size of the area in tiles on the x axis * @param sizeY the size of the area in tiles on the y axis + * @param plane the plane of the area * @param zOffset offset from ground plane * @return a polygon representing the tiles in the area */ @@ -406,10 +407,9 @@ public class Perspective @Nonnull LocalPoint localLocation, int sizeX, int sizeY, + int plane, int zOffset) { - final int plane = client.getPlane(); - final int swX = localLocation.getX() - (sizeX * LOCAL_TILE_SIZE / 2); final int swY = localLocation.getY() - (sizeY * LOCAL_TILE_SIZE / 2); From 022e09b9aeced00fad320c0e77c2a0b898b9e9a9 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 2 Mar 2021 14:09:30 -0700 Subject: [PATCH 2/8] Update Item IDs to 2021-3-3 --- runelite-api/src/main/java/net/runelite/api/ItemID.java | 1 + runelite-api/src/main/java/net/runelite/api/NullItemID.java | 1 + 2 files changed, 2 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/runelite-api/src/main/java/net/runelite/api/ItemID.java index 20db96da92..46b65648b8 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -11770,5 +11770,6 @@ public final class ItemID public static final int DHAROKS_GREATAXE_25516 = 25516; public static final int VOLATILE_NIGHTMARE_STAFF_25517 = 25517; public static final int ANCESTRAL_HAT_25518 = 25518; + public static final int JALREKJAD = 25519; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/runelite-api/src/main/java/net/runelite/api/NullItemID.java index a0c04d41a3..758c2ed36f 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -13538,5 +13538,6 @@ public final class NullItemID public static final int NULL_25483 = 25483; public static final int NULL_25501 = 25501; public static final int NULL_25503 = 25503; + public static final int NULL_25520 = 25520; /* This file is automatically generated. Do not edit. */ } From 095152760ae6bc3b72023ac28f275e1fd64fcb3f Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 2 Mar 2021 14:09:31 -0700 Subject: [PATCH 3/8] Update Object IDs to 2021-3-3 --- runelite-api/src/main/java/net/runelite/api/NullObjectID.java | 1 + runelite-api/src/main/java/net/runelite/api/ObjectID.java | 1 + 2 files changed, 2 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java index 578986a5d4..893e7590e7 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullObjectID.java @@ -20059,6 +20059,7 @@ public final class NullObjectID public static final int NULL_41010 = 41010; public static final int NULL_41011 = 41011; public static final int NULL_41012 = 41012; + public static final int NULL_41014 = 41014; public static final int NULL_41022 = 41022; public static final int NULL_41191 = 41191; public static final int NULL_41192 = 41192; diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectID.java b/runelite-api/src/main/java/net/runelite/api/ObjectID.java index 12c8966850..709c3ddb12 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -20940,6 +20940,7 @@ public final class ObjectID public static final int CAGED_MONKEY_SHEEP = 40971; public static final int FIREWORKS = 40972; public static final int POST_40982 = 40982; + public static final int SCOREBOARD_41013 = 41013; public static final int POTION_OF_POWER_TABLE_41023 = 41023; public static final int PEDESTAL_SPACE = 41024; public static final int PEDESTAL_SPACE_41025 = 41025; From ecb64e9885cdda61afe4d505cffe132bb956d456 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 2 Mar 2021 14:09:31 -0700 Subject: [PATCH 4/8] Update NPC IDs to 2021-3-3 --- runelite-api/src/main/java/net/runelite/api/NpcID.java | 6 ++++++ runelite-api/src/main/java/net/runelite/api/NullNpcID.java | 1 + 2 files changed, 7 insertions(+) diff --git a/runelite-api/src/main/java/net/runelite/api/NpcID.java b/runelite-api/src/main/java/net/runelite/api/NpcID.java index b63ecd03ed..9da1445142 100644 --- a/runelite-api/src/main/java/net/runelite/api/NpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NpcID.java @@ -8972,5 +8972,11 @@ public final class NpcID public static final int UNICORN1337KILR = 10609; public static final int BOB_10610 = 10610; public static final int BOB_10611 = 10611; + public static final int JALREKJAD = 10620; + public static final int TZHAARKETRAK = 10621; + public static final int TZHAARKETRAK_10622 = 10622; + public static final int JALTOKJAD_10623 = 10623; + public static final int YTHURKOT_10624 = 10624; + public static final int JALREKJAD_10625 = 10625; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java index 36e299be37..d90eb7b654 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java @@ -1631,5 +1631,6 @@ public final class NullNpcID public static final int NULL_10617 = 10617; public static final int NULL_10618 = 10618; public static final int NULL_10619 = 10619; + public static final int NULL_10626 = 10626; /* This file is automatically generated. Do not edit. */ } From 6526fd9d7c8155c88c8fcf0eef6406de643b81c8 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Tue, 2 Mar 2021 15:03:32 -0700 Subject: [PATCH 5/8] rl-api: update quest scripts to 2021-3-3 --- runelite-api/src/main/java/net/runelite/api/Quest.java | 2 +- runelite-api/src/main/java/net/runelite/api/ScriptID.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Quest.java b/runelite-api/src/main/java/net/runelite/api/Quest.java index cf87417d00..0265ba1ae9 100644 --- a/runelite-api/src/main/java/net/runelite/api/Quest.java +++ b/runelite-api/src/main/java/net/runelite/api/Quest.java @@ -205,7 +205,7 @@ public enum Quest public QuestState getState(Client client) { - client.runScript(ScriptID.QUESTLIST_PROGRESS, id); + client.runScript(ScriptID.QUEST_STATUS_GET, id); switch (client.getIntStack()[0]) { case 2: diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/runelite-api/src/main/java/net/runelite/api/ScriptID.java index 3d8fda2197..0f8853841b 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -124,7 +124,7 @@ public final class ScriptID * */ @ScriptArguments(integer = 1) - public static final int QUESTLIST_PROGRESS = 2267; + public static final int QUEST_STATUS_GET = 4029; /** * Updates the Diary/Quest interface's scrollbar From 274219e6190d60c8370ba4abedff2516366ed978 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 3 Mar 2021 12:07:37 +0000 Subject: [PATCH 6/8] Release 1.7.2 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 2fb04f14d7..1d3808a7be 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index 68430f22b6..edde1eefb9 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index bf00fde2b1..9896620d85 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index f192b71c49..2a83f28f53 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 8d3b05dc49..f97d8ad8ca 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 Web Service diff --git a/pom.xml b/pom.xml index 5f1f37e418..7947c46cda 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.7.2 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 94a578e767..e7eb97b762 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 32aaccd82b..324088f051 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index 85536adbe3..d0c2e5c6d0 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index d5bc0a593a..17d8bf40cf 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2-SNAPSHOT + 1.7.2 script-assembler-plugin From 1cd9158b33d0dc751c2776c4be9c26e488cb7bac Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 3 Mar 2021 12:07:46 +0000 Subject: [PATCH 7/8] Bump for 1.7.3-SNAPSHOT --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 1d3808a7be..eb04d57249 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index edde1eefb9..7a1e0ae47e 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 9896620d85..425279133f 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 2a83f28f53..4d0f8eca55 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index f97d8ad8ca..b20223821e 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index 7947c46cda..dbcd04d68b 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.7.2 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index e7eb97b762..d2b424d7d2 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 324088f051..5d62a423c9 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index d0c2e5c6d0..3d7658cd3b 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 17d8bf40cf..8d79282a6c 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.7.2 + 1.7.3-SNAPSHOT script-assembler-plugin From 45fd98d487c564b319a03d238e1f16cee2bc573d Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 3 Mar 2021 14:06:06 -0500 Subject: [PATCH 8/8] chat commands: add jad challenge kc and pbs --- .../chatcommands/ChatCommandsPlugin.java | 62 +++++++------------ .../chatcommands/ChatCommandsPluginTest.java | 26 ++++++++ 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java index 7d877cb7aa..4d7bac6c1e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/chatcommands/ChatCommandsPlugin.java @@ -27,10 +27,12 @@ package net.runelite.client.plugins.chatcommands; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.MoreObjects; +import com.google.common.collect.ImmutableMap; import com.google.inject.Provides; import java.io.IOException; import java.util.EnumSet; import java.util.List; +import java.util.Map; import java.util.concurrent.ScheduledExecutorService; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -91,16 +93,13 @@ import org.apache.commons.text.WordUtils; @Slf4j public class ChatCommandsPlugin extends Plugin { - private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (.+) (?:kill|harvest|lap|completion) count is: (\\d+)"); - private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); + private static final Pattern KILLCOUNT_PATTERN = Pattern.compile("Your (?:completion count for |subdued |completed )?(.+?) (?:(?:kill|harvest|lap|completion) )?(?:count )?is: (\\d+)"); private static final String COX_TEAM_SIZES = "(?:\\d+(?:\\+|-\\d+)? players|Solo)"; private static final Pattern RAIDS_PB_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: " + COX_TEAM_SIZES + " Duration: (?[0-9:]+) \\(new personal best\\)"); private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("Congratulations - your raid is complete!
Team size: " + COX_TEAM_SIZES + " Duration: [0-9:]+ Personal best: (?[0-9:]+)"); private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: (?[0-9:]+) \\(Personal best!\\)"); private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: [0-9:]+
Personal best: (?[0-9:]+)"); - private static final Pattern WINTERTODT_PATTERN = Pattern.compile("Your subdued Wintertodt count is: (\\d+)"); - private static final Pattern BARROWS_PATTERN = Pattern.compile("Your Barrows chest count is: (\\d+)"); - private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: [0-9:]+\\. Personal best: (?[0-9:]+)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: [0-9:]+\\. Personal best: (?:)?(?[0-9:]+)"); private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: (?[0-9:]+) \\(new personal best\\)"); private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?"); private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?"); @@ -132,6 +131,10 @@ public class ChatCommandsPlugin extends Plugin @VisibleForTesting static final int ADV_LOG_EXPLOITS_TEXT_INDEX = 1; + private static final Map KILLCOUNT_RENAMES = ImmutableMap.of( + "Barrows chest", "Barrows Chests" + ); + private boolean bossLogLoaded; private boolean advLogLoaded; private boolean scrollInterfaceLoaded; @@ -273,6 +276,8 @@ public class ChatCommandsPlugin extends Plugin String boss = matcher.group(1); int kc = Integer.parseInt(matcher.group(2)); + boss = KILLCOUNT_RENAMES.getOrDefault(boss, boss); + setKc(boss, kc); // We either already have the pb, or need to remember the boss for the upcoming pb if (lastPb > -1) @@ -289,31 +294,6 @@ public class ChatCommandsPlugin extends Plugin return; } - matcher = WINTERTODT_PATTERN.matcher(message); - if (matcher.find()) - { - int kc = Integer.parseInt(matcher.group(1)); - - setKc("Wintertodt", kc); - } - - matcher = RAIDS_PATTERN.matcher(message); - if (matcher.find()) - { - String boss = matcher.group(1); - int kc = Integer.parseInt(matcher.group(2)); - - setKc(boss, kc); - if (lastPb > -1) - { - setPb(boss, lastPb); - lastPb = -1; - } - lastBossKill = boss; - lastBossTime = client.getTickCount(); - return; - } - matcher = DUEL_ARENA_WINS_PATTERN.matcher(message); if (matcher.find()) { @@ -351,14 +331,6 @@ public class ChatCommandsPlugin extends Plugin setKc("Duel Arena Losses", losses); } - matcher = BARROWS_PATTERN.matcher(message); - if (matcher.find()) - { - int kc = Integer.parseInt(matcher.group(1)); - - setKc("Barrows Chests", kc); - } - matcher = KILL_DURATION_PATTERN.matcher(message); if (matcher.find()) { @@ -1859,6 +1831,20 @@ public class ChatCommandsPlugin extends Plugin case "wildy agility": return "Wilderness Agility"; + // Jad challenge + case "jad 1": + return "TzHaar-Ket-Rak's First Challenge"; + case "jad 2": + return "TzHaar-Ket-Rak's Second Challenge"; + case "jad 3": + return "TzHaar-Ket-Rak's Third Challenge"; + case "jad 4": + return "TzHaar-Ket-Rak's Fourth Challenge"; + case "jad 5": + return "TzHaar-Ket-Rak's Fifth Challenge"; + case "jad 6": + return "TzHaar-Ket-Rak's Sixth Challenge"; + default: return WordUtils.capitalize(boss); } diff --git a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java index 9df5ff5891..969bc8edf6 100644 --- a/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java +++ b/runelite-client/src/test/java/net/runelite/client/plugins/chatcommands/ChatCommandsPluginTest.java @@ -660,4 +660,30 @@ public class ChatCommandsPluginTest verify(configManager).setRSProfileConfiguration("personalbest", "tztok-jad", 21 * 60 + 58); verify(configManager).setRSProfileConfiguration("killcount", "tztok-jad", 2); } + + @Test + public void testJadChallengeNewPb() + { + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completion count for TzHaar-Ket-Rak's First Challenge is: 1.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: 1:46 (new personal best)", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setRSProfileConfiguration("killcount", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 1); + verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 60 + 46); + } + + @Test + public void testJadChallengeNoPb() + { + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your completion count for TzHaar-Ket-Rak's First Challenge is: 3.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: 1:10. Personal best: 0:59", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setRSProfileConfiguration("killcount", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 3); + verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59); + } }