From c346e26273ad09db250b7258dfe8a98a92532e7b Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 29 Jul 2019 15:17:57 -0400 Subject: [PATCH 01/10] AnimationID: add crystal and new dragon orn tools --- .../src/main/java/net/runelite/api/AnimationID.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/AnimationID.java b/runelite-api/src/main/java/net/runelite/api/AnimationID.java index 1dc49ca455..0ca4a11162 100644 --- a/runelite-api/src/main/java/net/runelite/api/AnimationID.java +++ b/runelite-api/src/main/java/net/runelite/api/AnimationID.java @@ -44,6 +44,7 @@ public final class AnimationID public static final int WOODCUTTING_DRAGON = 2846; public static final int WOODCUTTING_INFERNAL = 2117; public static final int WOODCUTTING_3A_AXE = 7264; + public static final int WOODCUTTING_CRYSTAL = 8324; public static final int CONSUMING = 829; // consuming consumables public static final int FIREMAKING = 733; public static final int DEATH = 836; @@ -94,6 +95,7 @@ public final class AnimationID public static final int FISHING_BARBTAIL_HARPOON = 5108; public static final int FISHING_DRAGON_HARPOON = 7401; public static final int FISHING_INFERNAL_HARPOON = 7402; + public static final int FISHING_CRYSTAL_HARPOON = 8336; public static final int FISHING_OILY_ROD = 622; public static final int FISHING_KARAMBWAN = 1193; public static final int FISHING_CRUSHING_INFERNAL_EELS = 7553; @@ -107,9 +109,11 @@ public final class AnimationID public static final int MINING_ADAMANT_PICKAXE = 628; public static final int MINING_RUNE_PICKAXE = 624; public static final int MINING_DRAGON_PICKAXE = 7139; - public static final int MINING_DRAGON_PICKAXE_ORN = 642; + public static final int MINING_DRAGON_PICKAXE_UPGRADED = 642; + public static final int MINING_DRAGON_PICKAXE_OR = 8346; public static final int MINING_INFERNAL_PICKAXE = 4482; public static final int MINING_3A_PICKAXE = 7283; + public static final int MINING_CRYSTAL_PICKAXE = 8347; public static final int MINING_MOTHERLODE_BRONZE = 6753; public static final int MINING_MOTHERLODE_IRON = 6754; public static final int MINING_MOTHERLODE_STEEL = 6755; @@ -118,9 +122,11 @@ public final class AnimationID public static final int MINING_MOTHERLODE_ADAMANT = 6756; public static final int MINING_MOTHERLODE_RUNE = 6752; public static final int MINING_MOTHERLODE_DRAGON = 6758; - public static final int MINING_MOTHERLODE_DRAGON_ORN = 335; + public static final int MINING_MOTHERLODE_DRAGON_UPGRADED = 335; + public static final int MINING_MOTHERLODE_DRAGON_OR = 8344; public static final int MINING_MOTHERLODE_INFERNAL = 4481; public static final int MINING_MOTHERLODE_3A = 7282; + public static final int MINING_MOTHERLODE_CRYSTAL = 8345; public static final int DENSE_ESSENCE_CHIPPING = 7201; public static final int DENSE_ESSENCE_CHISELING = 7202; public static final int HERBLORE_POTIONMAKING = 363; //used for both herb and secondary From 099d6b47f4015c575ef9f382e7fe07e54561271c Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 29 Jul 2019 15:19:09 -0400 Subject: [PATCH 02/10] idle notifier: add ids for crystal and new dragon orn tools --- .../client/plugins/idlenotifier/IdleNotifierPlugin.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java index 45b37e60f7..bf23010382 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/idlenotifier/IdleNotifierPlugin.java @@ -134,6 +134,7 @@ public class IdleNotifierPlugin extends Plugin case WOODCUTTING_DRAGON: case WOODCUTTING_INFERNAL: case WOODCUTTING_3A_AXE: + case WOODCUTTING_CRYSTAL: /* Cooking(Fire, Range) */ case COOKING_FIRE: case COOKING_RANGE: @@ -183,9 +184,11 @@ public class IdleNotifierPlugin extends Plugin case MINING_ADAMANT_PICKAXE: case MINING_RUNE_PICKAXE: case MINING_DRAGON_PICKAXE: - case MINING_DRAGON_PICKAXE_ORN: + case MINING_DRAGON_PICKAXE_UPGRADED: + case MINING_DRAGON_PICKAXE_OR: case MINING_INFERNAL_PICKAXE: case MINING_3A_PICKAXE: + case MINING_CRYSTAL_PICKAXE: case DENSE_ESSENCE_CHIPPING: case DENSE_ESSENCE_CHISELING: /* Mining(Motherlode) */ @@ -197,9 +200,11 @@ public class IdleNotifierPlugin extends Plugin case MINING_MOTHERLODE_ADAMANT: case MINING_MOTHERLODE_RUNE: case MINING_MOTHERLODE_DRAGON: - case MINING_MOTHERLODE_DRAGON_ORN: + case MINING_MOTHERLODE_DRAGON_UPGRADED: + case MINING_MOTHERLODE_DRAGON_OR: case MINING_MOTHERLODE_INFERNAL: case MINING_MOTHERLODE_3A: + case MINING_MOTHERLODE_CRYSTAL: /* Herblore */ case HERBLORE_PESTLE_AND_MORTAR: case HERBLORE_POTIONMAKING: From a1450a332be971c980fb190c0afe4afac8abd715 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 29 Jul 2019 15:22:53 -0400 Subject: [PATCH 03/10] woodcutting: add crystal axe to axe enum --- .../java/net/runelite/client/plugins/woodcutting/Axe.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/Axe.java b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/Axe.java index 7b8a5c5f4e..4ad6d6e90f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/Axe.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/woodcutting/Axe.java @@ -32,6 +32,7 @@ import static net.runelite.api.AnimationID.WOODCUTTING_3A_AXE; import static net.runelite.api.AnimationID.WOODCUTTING_ADAMANT; import static net.runelite.api.AnimationID.WOODCUTTING_BLACK; import static net.runelite.api.AnimationID.WOODCUTTING_BRONZE; +import static net.runelite.api.AnimationID.WOODCUTTING_CRYSTAL; import static net.runelite.api.AnimationID.WOODCUTTING_DRAGON; import static net.runelite.api.AnimationID.WOODCUTTING_INFERNAL; import static net.runelite.api.AnimationID.WOODCUTTING_IRON; @@ -41,6 +42,7 @@ import static net.runelite.api.AnimationID.WOODCUTTING_STEEL; import static net.runelite.api.ItemID.ADAMANT_AXE; import static net.runelite.api.ItemID.BLACK_AXE; import static net.runelite.api.ItemID.BRONZE_AXE; +import static net.runelite.api.ItemID.CRYSTAL_AXE; import static net.runelite.api.ItemID.DRAGON_AXE; import static net.runelite.api.ItemID.INFERNAL_AXE; import static net.runelite.api.ItemID.IRON_AXE; @@ -62,7 +64,8 @@ enum Axe RUNE(WOODCUTTING_RUNE, RUNE_AXE), DRAGON(WOODCUTTING_DRAGON, DRAGON_AXE), INFERNAL(WOODCUTTING_INFERNAL, INFERNAL_AXE), - THIRDAGE(WOODCUTTING_3A_AXE, _3RD_AGE_AXE); + THIRDAGE(WOODCUTTING_3A_AXE, _3RD_AGE_AXE), + CRYSTAL(WOODCUTTING_CRYSTAL, CRYSTAL_AXE); private final Integer animId; private final Integer itemId; From a1f01a7574bad551eded075e1563a2e20cc10bf6 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 29 Jul 2019 15:27:38 -0400 Subject: [PATCH 04/10] motherlode: update animation id set with new crystal and dragon tools --- .../runelite/client/plugins/motherlode/MotherlodeOverlay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeOverlay.java index 8a2ad81cdf..62c0d75513 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/motherlode/MotherlodeOverlay.java @@ -45,8 +45,8 @@ class MotherlodeOverlay extends Overlay private static final Set MINING_ANIMATION_IDS = ImmutableSet.of( MINING_MOTHERLODE_BRONZE, MINING_MOTHERLODE_IRON, MINING_MOTHERLODE_STEEL, MINING_MOTHERLODE_BLACK, MINING_MOTHERLODE_MITHRIL, MINING_MOTHERLODE_ADAMANT, - MINING_MOTHERLODE_RUNE, MINING_MOTHERLODE_DRAGON, MINING_MOTHERLODE_DRAGON_ORN, - MINING_MOTHERLODE_INFERNAL + MINING_MOTHERLODE_RUNE, MINING_MOTHERLODE_DRAGON, MINING_MOTHERLODE_DRAGON_UPGRADED, + MINING_MOTHERLODE_DRAGON_OR, MINING_MOTHERLODE_INFERNAL, MINING_MOTHERLODE_CRYSTAL ); private final Client client; From 98816645022d91d2508e454c683b1a4e00b52a43 Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Tue, 30 Jul 2019 14:23:45 -0400 Subject: [PATCH 05/10] discord: add Prifddinas locations --- .../client/plugins/discord/DiscordGameEventType.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java index 5280081563..f877599ebc 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/discord/DiscordGameEventType.java @@ -83,6 +83,7 @@ enum DiscordGameEventType BOSS_SMOKE_DEVIL("Thermonuclear smoke devil", DiscordAreaType.BOSSES, 9363, 9619), BOSS_VORKATH("Vorkath", DiscordAreaType.BOSSES, 9023), BOSS_WINTERTODT("Wintertodt", DiscordAreaType.BOSSES, 6462), + BOSS_ZALCANO("Zalcano", DiscordAreaType.BOSSES, 13250), BOSS_ZULRAH("Zulrah", DiscordAreaType.BOSSES, 9007), // Cities @@ -106,6 +107,7 @@ enum DiscordGameEventType CITY_FALADOR("Falador" , DiscordAreaType.CITIES, 11828, 11572, 11571, 11827, 12084), CITY_GOBLIN_VILLAGE("Goblin Village" , DiscordAreaType.CITIES, 11830), CITY_GUTANOTH("Gu'Tanoth" , DiscordAreaType.CITIES, 10031), + CITY_GWENITH("Gwenith", DiscordAreaType.CITIES, 8501, 8757, 9013), CITY_HOSIDIUS_HOUSE("Hosidius" , DiscordAreaType.CITIES, 6713, 6712, 6455, 6711, 6710, 6965, 6966, 7222, 7223, 6967), CITY_JATISZO("Jatizso" , DiscordAreaType.CITIES, 9531), CITY_JIGGIG("Jiggig" , DiscordAreaType.CITIES, 9775), @@ -129,6 +131,7 @@ enum DiscordGameEventType CITY_PORT_PHASMATYS("Port Phasmatys" , DiscordAreaType.CITIES, 14646), CITY_PORT_SARIM("Port Sarim" , DiscordAreaType.CITIES, 12082), CITY_PISCARILIUS_HOUSE("Port Piscarilius" , DiscordAreaType.CITIES, 6971, 7227, 6970, 7226), + CITY_PRIFDDINAS("Prifddinas", DiscordAreaType.CITIES, 12894, 12895, 13150, 13151), CITY_RELLEKKA("Rellekka" , DiscordAreaType.CITIES, 10553), CITY_RIMMINGTON("Rimmington" , DiscordAreaType.CITIES, 11826, 11570), CITY_SEERS_VILLAGE("Seers' Village" , DiscordAreaType.CITIES, 10806), @@ -179,6 +182,7 @@ enum DiscordGameEventType DUNGEON_GOBLIN_CAVE("Goblin Cave", DiscordAreaType.DUNGEONS, 10393), DUNGEON_GRAND_TREE_TUNNELS("Grand Tree Tunnels", DiscordAreaType.DUNGEONS, 9882), DUNGEON_HAM("H.A.M Dungeon", DiscordAreaType.DUNGEONS, 12694, 10321), + DUNGEON_IORWERTH("Iorwerth Dungeon", DiscordAreaType.DUNGEONS, 12738, 12993, 12994), DUNGEON_JATIZSO_MINES("Jatizo Mines", DiscordAreaType.DUNGEONS, 9631), DUNGEON_JIGGIG_BURIAL_TOMB("Jiggig Burial Tomb", DiscordAreaType.DUNGEONS, 9875, 9874), DUNGEON_JOGRE("Jogre Dungeon", DiscordAreaType.DUNGEONS, 11412), @@ -210,6 +214,7 @@ enum DiscordGameEventType DUNGEON_THE_WARRENS("The Warrens", DiscordAreaType.DUNGEONS, 7070, 7326), DUNGEON_TOLNA("Dungeon of Tolna", DiscordAreaType.DUNGEONS, 13209), DUNGEON_TOWER_OF_LIFE("Tower of Life Basement", DiscordAreaType.DUNGEONS, 12100), + DUNGEON_TRAHAEARN_MINE("Trahaearn Mine", DiscordAreaType.DUNGEONS, 13249), DUNGEON_TUNNEL_OF_CHAOS("Tunnel of Chaos", DiscordAreaType.DUNGEONS, 12625), DUNGEON_UNDERGROUND_PASS("Underground Pass", DiscordAreaType.DUNGEONS, 9369, 9370), DUNGEON_VARROCKSEWERS("Varrock Sewers", DiscordAreaType.DUNGEONS, 12954, 13210), @@ -231,6 +236,7 @@ enum DiscordGameEventType MG_CLAN_WARS("Clan Wars", DiscordAreaType.MINIGAMES, 13135, 13134, 13133, 13131, 13130, 13387, 13386), MG_DUEL_ARENA("Duel Arena", DiscordAreaType.MINIGAMES, 13362), MG_FISHING_TRAWLER("Fishing Trawler", DiscordAreaType.MINIGAMES, 7499), + MG_GAUNTLET("Gauntlet", DiscordAreaType.MINIGAMES, 12995), MG_INFERNO("The Inferno", DiscordAreaType.MINIGAMES, 9043), MG_LAST_MAN_STANDING("Last Man Standing", DiscordAreaType.MINIGAMES, 13660, 13659, 13658, 13916, 13915, 13914), MG_MAGE_TRAINING_ARENA("Mage Training Arena", DiscordAreaType.MINIGAMES, 13462, 13463), From 6b16d2d467a497e96a2894d2c841efa5c503d2b5 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 31 Jul 2019 09:31:41 +0100 Subject: [PATCH 06/10] worldmap: Fix quest marker for Depths of Despair (#9506) --- .../runelite/client/plugins/worldmap/QuestStartLocation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java index 394805357f..1100d22f9f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldmap/QuestStartLocation.java @@ -72,7 +72,7 @@ enum QuestStartLocation DARKNESS_OF_HALLOWVALE(Quest.DARKNESS_OF_HALLOWVALE, new WorldPoint(3494, 9628, 0)), DEATH_PLATEAU_TROLL_STRONGHOLD(new Quest[]{Quest.DEATH_PLATEAU, Quest.TROLL_STRONGHOLD}, new WorldPoint(2895, 3528, 0)), DEATH_TO_THE_DORGESHUUN(Quest.DEATH_TO_THE_DORGESHUUN, new WorldPoint(3316, 9613, 0)), - THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1846, 3556, 0)), + THE_DEPTHS_OF_DESPAIR(Quest.THE_DEPTHS_OF_DESPAIR, new WorldPoint(1780, 3569, 0)), DESERT_TREASURE(Quest.DESERT_TREASURE, new WorldPoint(3177, 3043, 0)), DEVIOUS_MINDS(Quest.DEVIOUS_MINDS, new WorldPoint(3405, 3492, 0)), THE_DIG_SITE(Quest.THE_DIG_SITE, new WorldPoint(3363, 3337, 0)), From 734e8aca582eaf4e2b6d21491fa7b84f9a0a7bcc Mon Sep 17 00:00:00 2001 From: Alexsuperfly Date: Mon, 29 Jul 2019 15:31:16 -0400 Subject: [PATCH 07/10] wintertodt: add crystal axe to animation list --- .../runelite/client/plugins/wintertodt/WintertodtPlugin.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java index 1fb36bfd27..ee1eedbf1f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/wintertodt/WintertodtPlugin.java @@ -41,6 +41,7 @@ import static net.runelite.api.AnimationID.WOODCUTTING_3A_AXE; import static net.runelite.api.AnimationID.WOODCUTTING_ADAMANT; import static net.runelite.api.AnimationID.WOODCUTTING_BLACK; import static net.runelite.api.AnimationID.WOODCUTTING_BRONZE; +import static net.runelite.api.AnimationID.WOODCUTTING_CRYSTAL; import static net.runelite.api.AnimationID.WOODCUTTING_DRAGON; import static net.runelite.api.AnimationID.WOODCUTTING_INFERNAL; import static net.runelite.api.AnimationID.WOODCUTTING_IRON; @@ -405,6 +406,7 @@ public class WintertodtPlugin extends Plugin case WOODCUTTING_DRAGON: case WOODCUTTING_INFERNAL: case WOODCUTTING_3A_AXE: + case WOODCUTTING_CRYSTAL: setActivity(WintertodtActivity.WOODCUTTING); break; From 1ce2e5aa930d122d1c543c497f9990b2cde8b235 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 30 Jul 2019 19:02:22 -0400 Subject: [PATCH 08/10] chat commands: fix tracking zuk pb --- .../chatcommands/ChatCommandsPlugin.java | 4 +-- .../chatcommands/ChatCommandsPluginTest.java | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 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 ac165c4a63..5bb9630550 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 @@ -87,8 +87,8 @@ public class ChatCommandsPlugin extends Plugin private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); 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("(?:Fight|Lap) duration: [0-9:]+. Personal best: ([0-9:]+)"); - private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?:Fight|Lap) duration: ([0-9:]+) \\(new personal best\\)"); + private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap )?duration: [0-9:]+\\. Personal best: ([0-9:]+)"); + private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap )?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?"); 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 f7a576477e..9582e41ba2 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 @@ -266,4 +266,34 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration(eq("personalbest.adam"), eq("prifddinas agility course"), eq(61)); verify(configManager).setConfiguration(eq("killcount.adam"), eq("prifddinas agility course"), eq(2)); } + + @Test + public void testZukNewPb() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzKal-Zuk kill count is: 2.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: 104:31 (new personal best)", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("tzkal-zuk"), eq(104 * 60 + 31)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("tzkal-zuk"), eq(2)); + } + + @Test + public void testZukKill() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your TzKal-Zuk kill count is: 3.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Duration: 172:18. Personal best: 134:52", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("tzkal-zuk"), eq(134 * 60 + 52)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("tzkal-zuk"), eq(3)); + } } From 1b2219374ff5dbc5c3380ff596779a06a34e7040 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 30 Jul 2019 19:37:13 -0400 Subject: [PATCH 09/10] chat commands: add gg pb --- .../chatcommands/ChatCommandsPlugin.java | 47 +++++++++++++------ .../chatcommands/ChatCommandsPluginTest.java | 30 ++++++++++++ 2 files changed, 63 insertions(+), 14 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 5bb9630550..1a52129220 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 @@ -109,6 +109,7 @@ public class ChatCommandsPlugin extends Plugin private boolean logKills; private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player private String lastBossKill; + private int lastPb = -1; @Inject private Client client; @@ -223,7 +224,17 @@ public class ChatCommandsPlugin extends Plugin int kc = Integer.parseInt(matcher.group(2)); setKc(boss, kc); - lastBossKill = boss; + // We either already have the pb, or need to remember the boss for the upcoming pb + if (lastPb > -1) + { + log.debug("Got out-of-order personal best for {}: {}", boss, lastPb); + setPb(boss, lastPb); + lastPb = -1; + } + else + { + lastBossKill = boss; + } return; } @@ -291,19 +302,16 @@ public class ChatCommandsPlugin extends Plugin setKc("Barrows Chests", kc); } - if (lastBossKill != null) + matcher = KILL_DURATION_PATTERN.matcher(message); + if (matcher.find()) { - matcher = KILL_DURATION_PATTERN.matcher(message); - if (matcher.find()) - { - matchPb(matcher); - } + matchPb(matcher); + } - matcher = NEW_PB_PATTERN.matcher(message); - if (matcher.find()) - { - matchPb(matcher); - } + matcher = NEW_PB_PATTERN.matcher(message); + if (matcher.find()) + { + matchPb(matcher); } lastBossKill = null; @@ -316,8 +324,19 @@ public class ChatCommandsPlugin extends Plugin if (s.length == 2) { int seconds = Integer.parseInt(s[0]) * 60 + Integer.parseInt(s[1]); - log.debug("Got personal best for {}: {}", lastBossKill, seconds); - setPb(lastBossKill, seconds); + if (lastBossKill != null) + { + // Most bosses sent boss kill message, and then pb message, so we + // use the remembered lastBossKill + log.debug("Got personal best for {}: {}", lastBossKill, seconds); + setPb(lastBossKill, seconds); + lastPb = -1; + } + else + { + // Some bosses send the pb message, and then the kill message! + lastPb = seconds; + } } } 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 9582e41ba2..9f74ebf22b 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 @@ -296,4 +296,34 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration(eq("personalbest.adam"), eq("tzkal-zuk"), eq(134 * 60 + 52)); verify(configManager).setConfiguration(eq("killcount.adam"), eq("tzkal-zuk"), eq(3)); } + + @Test + public void testGgNewPb() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: 1:36 (new personal best)", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Grotesque Guardians kill count is: 179.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("grotesque guardians"), eq(96)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("grotesque guardians"), eq(179)); + } + + @Test + public void testGgKill() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Fight duration: 2:41. Personal best: 2:14", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Grotesque Guardians kill count is: 32.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("grotesque guardians"), eq(2 * 60 + 14)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("grotesque guardians"), eq(32)); + } } From e27459f1f0a8fd06ba685baea258bd210d5e21fa Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 31 Jul 2019 08:16:57 -0400 Subject: [PATCH 10/10] chat commands: add guantlet pb --- .../chatcommands/ChatCommandsPlugin.java | 4 +-- .../chatcommands/ChatCommandsPluginTest.java | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 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 1a52129220..ef140b3350 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 @@ -87,8 +87,8 @@ public class ChatCommandsPlugin extends Plugin private static final Pattern RAIDS_PATTERN = Pattern.compile("Your completed (.+) count is: (\\d+)"); 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 )?duration: [0-9:]+\\. Personal best: ([0-9:]+)"); - private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap )?duration: ([0-9:]+) \\(new personal best\\)"); + 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?"); 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 9f74ebf22b..70a4a98ec1 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 @@ -326,4 +326,34 @@ public class ChatCommandsPluginTest verify(configManager).setConfiguration(eq("personalbest.adam"), eq("grotesque guardians"), eq(2 * 60 + 14)); verify(configManager).setConfiguration(eq("killcount.adam"), eq("grotesque guardians"), eq(32)); } + + @Test + public void testGuantletPersonalBest() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: 10:24. Personal best: 7:59.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: 124.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("killcount.adam"), eq("gauntlet"), eq(124)); + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("gauntlet"), eq(7 * 60 + 59)); + } + + @Test + public void testGuantletNewPersonalBest() + { + when(client.getUsername()).thenReturn("Adam"); + + ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Challenge duration: 10:24 (new personal best).", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Gauntlet completion count is: 124.", null, 0); + chatCommandsPlugin.onChatMessage(chatMessage); + + verify(configManager).setConfiguration(eq("personalbest.adam"), eq("gauntlet"), eq(10 * 60 + 24)); + verify(configManager).setConfiguration(eq("killcount.adam"), eq("gauntlet"), eq(124)); + } }