From 92f5d7443e7815859adf87134aba5a45c4b93990 Mon Sep 17 00:00:00 2001 From: Seth Date: Sun, 28 Jan 2018 10:52:49 -0500 Subject: [PATCH 1/2] timers plugin: check config before checking message --- .../client/plugins/timers/TimersPlugin.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 7644e1bf12..01d8404622 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -229,7 +229,7 @@ public class TimersPlugin extends Plugin return; } - if (event.getMessage().equals("You drink some of your stamina potion.") && config.showStamina()) + if (config.showStamina() && event.getMessage().equals("You drink some of your stamina potion.")) { createGameTimer(STAMINA); } @@ -239,17 +239,17 @@ public class TimersPlugin extends Plugin removeGameTimer(STAMINA); } - if (event.getMessage().equals("You drink some of your antifire potion.") && config.showAntiFire()) + if (config.showAntiFire() && event.getMessage().equals("You drink some of your antifire potion.")) { createGameTimer(ANTIFIRE); } - if (event.getMessage().equals("You drink some of your extended antifire potion.") && config.showExAntiFire()) + if (config.showExAntiFire() && event.getMessage().equals("You drink some of your extended antifire potion.")) { createGameTimer(EXANTIFIRE); } - if (event.getMessage().equals("You drink some of your extended super antifire potion.") && config.showExSuperAntifire()) + if (config.showExSuperAntifire() && event.getMessage().equals("You drink some of your extended super antifire potion.")) { createGameTimer(EXSUPERANTIFIRE); } @@ -261,12 +261,12 @@ public class TimersPlugin extends Plugin removeGameTimer(EXANTIFIRE); } - if (event.getMessage().contains("You drink some of your overload potion") && config.showOverload()) + if (config.showOverload() && event.getMessage().startsWith("You drink some of your") && event.getMessage().contains("overload")) { createGameTimer(OVERLOAD); } - if ((event.getMessage().equals("You add the furnace.") || event.getMessage().contains("You repair your cannon, restoring it to working order.")) && config.showCannon()) + if (config.showCannon() && (event.getMessage().equals("You add the furnace.") || event.getMessage().contains("You repair your cannon, restoring it to working order."))) { createGameTimer(CANNON); } @@ -276,12 +276,12 @@ public class TimersPlugin extends Plugin removeGameTimer(CANNON); } - if (event.getMessage().contains("You drink some of your super antivenom potion") && config.showAntiVenomPlus()) + if (config.showAntiVenomPlus() && event.getMessage().contains("You drink some of your super antivenom potion")) { createGameTimer(ANTIVENOMPLUS); } - if (event.getMessage().equals("You are charged to combine runes!") && config.showMagicImbue()) + if (config.showMagicImbue() && event.getMessage().equals("You are charged to combine runes!")) { createGameTimer(MAGICIMBUE); } @@ -291,22 +291,22 @@ public class TimersPlugin extends Plugin removeGameTimer(MAGICIMBUE); } - if (event.getMessage().equals("A teleblock spell has been cast on you. It will expire in 5 minutes, 0 seconds.") && config.showTeleblock()) + if (config.showTeleblock() && event.getMessage().equals("A teleblock spell has been cast on you. It will expire in 5 minutes, 0 seconds.")) { createGameTimer(FULLTB); } - if (event.getMessage().equals("A teleblock spell has been cast on you. It will expire in 2 minutes, 30 seconds.") && config.showTeleblock()) + if (config.showTeleblock() && event.getMessage().equals("A teleblock spell has been cast on you. It will expire in 2 minutes, 30 seconds.")) { createGameTimer(HALFTB); } - if (event.getMessage().contains("You drink some of your super antifire potion") && config.showSuperAntiFire()) + if (config.showSuperAntiFire() && event.getMessage().contains("You drink some of your super antifire potion")) { createGameTimer(SUPERANTIFIRE); } - if (event.getMessage().equals("Your super antifire potion has expired.") && config.showSuperAntiFire()) + if (event.getMessage().equals("Your super antifire potion has expired.")) { removeGameTimer(SUPERANTIFIRE); } @@ -316,12 +316,12 @@ public class TimersPlugin extends Plugin removeGameTimer(IMBUEDHEART); } - if (event.getMessage().contains("You drink some of your antivenom potion") && config.showAntiVenom()) + if (config.showAntiVenom() && event.getMessage().contains("You drink some of your antivenom potion")) { createGameTimer(ANTIVENOM); } - if (event.getMessage().contains("You drink some of your Sanfew Serum.") && config.showSanfew()) + if (config.showSanfew() && event.getMessage().contains("You drink some of your Sanfew Serum.")) { createGameTimer(SANFEW); } @@ -337,12 +337,12 @@ public class TimersPlugin extends Plugin return; } - if (actor.getGraphic() == IMBUEDHEART.getGraphicId() && config.showImbuedHeart()) + if (config.showImbuedHeart() && actor.getGraphic() == IMBUEDHEART.getGraphicId()) { createGameTimer(IMBUEDHEART); } - if (actor.getGraphic() == VENGEANCE.getGraphicId() && config.showVengeance()) + if (config.showVengeance() && actor.getGraphic() == VENGEANCE.getGraphicId()) { createGameTimer(VENGEANCE); } From 782e75725a36916232d07cc5fdc0e2283815ce46 Mon Sep 17 00:00:00 2001 From: Seth Date: Sun, 28 Jan 2018 10:53:58 -0500 Subject: [PATCH 2/2] timers plugin: add raids potions --- .../main/java/net/runelite/api/Varbits.java | 7 ++++- .../client/plugins/timers/GameTimer.java | 4 ++- .../client/plugins/timers/TimersConfig.java | 10 ++++++++ .../client/plugins/timers/TimersPlugin.java | 24 +++++++++++++++++- .../client/plugins/timers/overloadraid.png | Bin 0 -> 576 bytes .../client/plugins/timers/prayerenhance.png | Bin 0 -> 1166 bytes 6 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/timers/overloadraid.png create mode 100644 runelite-client/src/main/resources/net/runelite/client/plugins/timers/prayerenhance.png diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index 75cba65767..ec67d0315c 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -187,7 +187,12 @@ public enum Varbits /** * Experience drop color */ - EXPERIENCE_DROP_COLOR(4695, 1227, 6, 8); + EXPERIENCE_DROP_COLOR(4695, 1227, 6, 8), + + /** + * Raids + */ + IN_RAID(5432, 1431, 31, 31); /** * varbit id diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java index 7e7094bcbb..561618c374 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/GameTimer.java @@ -64,7 +64,9 @@ public enum GameTimer ANTIDOTEPLUS("antidoteplus", "Antidote+", 518, ChronoUnit.SECONDS), ANTIVENOM("antivenom", "Anto-venom", 12, ChronoUnit.MINUTES), EXSUPERANTIFIRE("exsuperantifire", "Extended Super AntiFire", 6, ChronoUnit.MINUTES), - SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES); + SANFEW("sanfew", "Sanfew serum", 6, ChronoUnit.MINUTES), + OVERLOAD_RAID("overloadraid", "Overload", 5, ChronoUnit.MINUTES), + PRAYER_ENHANCE("prayerenhance", "Prayer enhance", 5, ChronoUnit.MINUTES); @Getter private final String imageResource; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java index fd7314dd2f..c21117e23a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersConfig.java @@ -214,4 +214,14 @@ public interface TimersConfig extends Config { return true; } + + @ConfigItem( + keyName = "showPrayerEnhance", + name = "Prayer enhance timer", + description = "Configures whether prayer enhance timer is displayed" + ) + default boolean showPrayerEnhance() + { + return true; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index 01d8404622..2ba0f30966 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -36,6 +36,8 @@ import static net.runelite.client.plugins.timers.GameTimer.FULLTB; import static net.runelite.client.plugins.timers.GameTimer.HALFTB; import static net.runelite.client.plugins.timers.GameTimer.MAGICIMBUE; import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD; +import static net.runelite.client.plugins.timers.GameTimer.OVERLOAD_RAID; +import static net.runelite.client.plugins.timers.GameTimer.PRAYER_ENHANCE; import static net.runelite.client.plugins.timers.GameTimer.SANFEW; import static net.runelite.client.plugins.timers.GameTimer.STAMINA; import static net.runelite.client.plugins.timers.GameTimer.SUPERANTIFIRE; @@ -59,6 +61,7 @@ import net.runelite.api.ChatMessageType; import net.runelite.api.Client; import net.runelite.api.ItemID; import net.runelite.api.Prayer; +import net.runelite.api.Varbits; import net.runelite.api.events.GraphicChanged; import net.runelite.client.config.ConfigManager; import net.runelite.api.events.ChatMessage; @@ -115,6 +118,7 @@ public class TimersPlugin extends Plugin if (!config.showOverload()) { removeGameTimer(OVERLOAD); + removeGameTimer(OVERLOAD_RAID); } if (!config.showCannon()) @@ -191,6 +195,11 @@ public class TimersPlugin extends Plugin removeGameTimer(ICEBLITZ); removeGameTimer(ICEBARRAGE); } + + if (!config.showPrayerEnhance()) + { + removeGameTimer(PRAYER_ENHANCE); + } } @Subscribe @@ -263,7 +272,15 @@ public class TimersPlugin extends Plugin if (config.showOverload() && event.getMessage().startsWith("You drink some of your") && event.getMessage().contains("overload")) { - createGameTimer(OVERLOAD); + if (client.getSetting(Varbits.IN_RAID) == 1) + { + createGameTimer(OVERLOAD_RAID); + } + else + { + createGameTimer(OVERLOAD); + } + } if (config.showCannon() && (event.getMessage().equals("You add the furnace.") || event.getMessage().contains("You repair your cannon, restoring it to working order."))) @@ -325,6 +342,11 @@ public class TimersPlugin extends Plugin { createGameTimer(SANFEW); } + + if (config.showPrayerEnhance() && event.getMessage().startsWith("You drink some of your") && event.getMessage().contains("prayer enhance")) + { + createGameTimer(PRAYER_ENHANCE); + } } @Subscribe diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/timers/overloadraid.png b/runelite-client/src/main/resources/net/runelite/client/plugins/timers/overloadraid.png new file mode 100644 index 0000000000000000000000000000000000000000..5f76477aaf576f6348dc930be8cea0faf55cedfe GIT binary patch literal 576 zcmV-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