This commit is contained in:
zeruth
2019-05-09 19:20:17 -04:00
26 changed files with 465 additions and 110 deletions

View File

@@ -95,7 +95,7 @@
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.5</version>
<version>2.2.6</version>
<executions>
<execution>
<id>query-git-info</id>

View File

@@ -192,6 +192,7 @@ public final class AnimationID
public static final int MAGIC_LUNAR_SHARED = 4413; // Utilized by Fertile Soil, Boost/Stat Potion Share, NPC Contact, Bake Pie
public static final int MAGIC_LUNAR_CURE_PLANT = 4432;
public static final int MAGIC_LUNAR_GEOMANCY = 7118;
public static final int MAGIC_LUNAR_PLANK_MAKE = 6298;
public static final int MAGIC_LUNAR_STRING_JEWELRY = 4412;
// Arceuus spellbook

View File

@@ -138,6 +138,7 @@ public class WidgetID
public static final int BARROWS_PUZZLE_GROUP_ID = 25;
public static final int KEPT_ON_DEATH_GROUP_ID = 4;
public static final int GUIDE_PRICE_GROUP_ID = 464;
public static final int SEED_VAULT_INVENTORY_GROUP_ID = 630;
static class WorldMap
{

View File

@@ -27,12 +27,14 @@ package net.runelite.client.chat;
import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import java.awt.Color;
import java.util.Arrays;
import java.util.Collection;
import java.util.Objects;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
@@ -41,6 +43,7 @@ import net.runelite.api.ChatLineBuffer;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.Varbits;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ConfigChanged;
@@ -56,6 +59,8 @@ import net.runelite.client.util.ColorUtil;
@Singleton
public class ChatMessageManager
{
private static final Set<Integer> TUTORIAL_ISLAND_REGIONS = ImmutableSet.of(12336, 12335, 12592, 12080, 12079, 12436);
private final Multimap<ChatMessageType, ChatColor> colorCache = HashMultimap.create();
private final Client client;
private final ChatColorConfig chatColorConfig;
@@ -550,6 +555,13 @@ public class ChatMessageManager
private void add(QueuedMessage message)
{
// Do not send message if the player is on tutorial island
final Player player = client.getLocalPlayer();
if (player != null && TUTORIAL_ISLAND_REGIONS.contains(player.getWorldLocation().getRegionID()))
{
return;
}
// this updates chat cycle
client.addChatMessage(
message.getType(),

View File

@@ -165,7 +165,7 @@ public enum AgilityShortcut
YANILLE_DUNGEON_RUBBLE_CLIMB(67, "Pile of Rubble", null, PILE_OF_RUBBLE_23563, PILE_OF_RUBBLE_23564),
ELVEN_OVERPASS_MEDIUM_CLIFF(68, "Rocks", new WorldPoint(2337, 3288, 0), ROCKS_16514, ROCKS_16515),
WEISS_OBSTACLES(68, "Shortcut", null, LITTLE_BOULDER, ROCKSLIDE_33184, ROCKSLIDE_33185, NULL_33327, NULL_33328, LEDGE_33190, ROCKSLIDE_33191, FALLEN_TREE_33192),
ARCEUUS_ESSENSE_NORTH(69, "Rock Climb", new WorldPoint(1759, 3873, 0), ROCKS_27984, ROCKS_27985),
ARCEUUS_ESSENSE_NORTH(69, "Rock Climb", new WorldPoint(1761, 3873, 0), ROCKS_34741),
TAVERLEY_DUNGEON_PIPE_BLUE_DRAGON(70, "Pipe Squeeze", new WorldPoint(2886, 9798, 0), OBSTACLE_PIPE_16509),
TAVERLEY_DUNGEON_ROCKS_NORTH(70, "Rocks", new WorldPoint(2887, 9823, 0), ROCKS, ROCKS_14106),
TAVERLEY_DUNGEON_ROCKS_SOUTH(70, "Rocks", new WorldPoint(2887, 9631, 0), ROCKS, ROCKS_14106),

View File

@@ -38,6 +38,17 @@ import net.runelite.api.*;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.*;
import net.runelite.api.kit.KitType;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.EquipmentInventorySlot;
import net.runelite.api.InventoryID;
import net.runelite.api.Item;
import net.runelite.api.ItemID;
import net.runelite.api.Varbits;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.ItemContainerChanged;
import net.runelite.api.events.VarbitChanged;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetID;
import net.runelite.api.widgets.WidgetInfo;
@@ -258,13 +269,27 @@ public class BarbarianAssaultPlugin extends Plugin
}
@Subscribe
public void onGameTick(GameTick event)
public void onItemContainerChanged(final ItemContainerChanged event)
{
if (client.getVar(Varbits.IN_GAME_BA) == 0 || client.getLocalPlayer() == null || overlay.getCurrentRound() != null)
if (event.getItemContainer() != client.getItemContainer(InventoryID.EQUIPMENT))
{
return;
}
switch (client.getLocalPlayer().getPlayerComposition().getEquipmentId(KitType.CAPE))
if (overlay.getCurrentRound() != null)
{
return;
}
final Item[] items = event.getItemContainer().getItems();
// Check that the local player is wearing enough items to be wearing a cape.
if (items == null || items.length <= EquipmentInventorySlot.CAPE.getSlotIdx())
{
return;
}
switch (items[EquipmentInventorySlot.CAPE.getSlotIdx()].getId())
{
case ItemID.ATTACKER_ICON:
overlay.setCurrentRound(new Round(Role.ATTACKER));

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, Seth <Sethtroll3@gmail.com>
* Copyright (c) 2019, Brandon White <bmwqg@live.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,21 +26,31 @@
package net.runelite.client.plugins.blastfurnace;
import com.google.inject.Provides;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.Client;
import net.runelite.api.GameObject;
import net.runelite.api.GameState;
import static net.runelite.api.NullObjectID.NULL_9092;
import static net.runelite.api.ObjectID.CONVEYOR_BELT;
import net.runelite.api.Skill;
import net.runelite.api.events.GameObjectDespawned;
import net.runelite.api.events.GameObjectSpawned;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.game.ItemManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
import net.runelite.client.util.Text;
@PluginDescriptor(
name = "Blast Furnace",
@@ -49,6 +60,7 @@ import net.runelite.client.ui.overlay.OverlayManager;
public class BlastFurnacePlugin extends Plugin
{
private static final int BAR_DISPENSER = NULL_9092;
private static final String FOREMAN_PERMISSION_TEXT = "Okay, you can use the furnace for ten minutes. Remember, you only need half as much coal as with a regular furnace.";
@Getter(AccessLevel.PACKAGE)
private GameObject conveyorBelt;
@@ -56,6 +68,8 @@ public class BlastFurnacePlugin extends Plugin
@Getter(AccessLevel.PACKAGE)
private GameObject barDispenser;
private ForemanTimer foremanTimer;
@Inject
private OverlayManager overlayManager;
@@ -68,6 +82,15 @@ public class BlastFurnacePlugin extends Plugin
@Inject
private BlastFurnaceClickBoxOverlay clickBoxOverlay;
@Inject
private Client client;
@Inject
private ItemManager itemManager;
@Inject
private InfoBoxManager infoBoxManager;
@Override
protected void startUp() throws Exception
{
@@ -79,11 +102,13 @@ public class BlastFurnacePlugin extends Plugin
@Override
protected void shutDown()
{
infoBoxManager.removeIf(ForemanTimer.class::isInstance);
overlayManager.remove(overlay);
overlayManager.remove(cofferOverlay);
overlayManager.remove(clickBoxOverlay);
conveyorBelt = null;
barDispenser = null;
foremanTimer = null;
}
@Provides
@@ -135,4 +160,31 @@ public class BlastFurnacePlugin extends Plugin
barDispenser = null;
}
}
@Subscribe
public void onGameTick(GameTick event)
{
Widget npcDialog = client.getWidget(WidgetInfo.DIALOG_NPC_TEXT);
if (npcDialog == null)
{
return;
}
// blocking dialog check until 5 minutes needed to avoid re-adding while dialog message still displayed
boolean shouldCheckForemanFee = client.getRealSkillLevel(Skill.SMITHING) < 60
&& (foremanTimer == null || Duration.between(Instant.now(), foremanTimer.getEndTime()).toMinutes() <= 5);
if (shouldCheckForemanFee)
{
String npcText = Text.sanitizeMultilineText(npcDialog.getText());
if (npcText.equals(FOREMAN_PERMISSION_TEXT))
{
infoBoxManager.removeIf(ForemanTimer.class::isInstance);
foremanTimer = new ForemanTimer(this, itemManager);
infoBoxManager.addInfoBox(foremanTimer);
}
}
}
}

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2019, Brandon White <bmwqg@live.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.blastfurnace;
import java.time.temporal.ChronoUnit;
import net.runelite.api.ItemID;
import net.runelite.client.game.ItemManager;
import net.runelite.client.ui.overlay.infobox.Timer;
class ForemanTimer extends Timer
{
private static final String TOOLTIP_TEXT = "Foreman Fee";
ForemanTimer(BlastFurnacePlugin plugin, ItemManager itemManager)
{
super(10, ChronoUnit.MINUTES, itemManager.getImage(ItemID.COAL_BAG), plugin);
setTooltip(TOOLTIP_TEXT);
}
}

View File

@@ -118,13 +118,13 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("MOLD LA RAN", "Old Man Ral", new WorldPoint(3602, 3209, 0), "Meiyerditch"),
new AnagramClue("MOTHERBOARD", "Brother Omad", new WorldPoint(2606, 3211, 0), "Monastery south of Ardougne", "129"),
new AnagramClue("MUS KIL READER", "Radimus Erkle", new WorldPoint(2726, 3368, 0), "Legends' Guild"),
new AnagramClue("MY MANGLE LAL", "Lammy Langle", new WorldPoint(1688, 3540, 0), "Hosidius House spirit tree patch"),
new AnagramClue("MY MANGLE LAL", "Lammy Langle", new WorldPoint(1688, 3540, 0), "Hosidius spirit tree patch"),
new AnagramClue("NO OWNER", "Oronwen", new WorldPoint(1162, 3178, 0), "Lletya Seamstress shop in Lletya", "20"),
new AnagramClue("NOD MED", "Edmond", new WorldPoint(2566, 3332, 0), "Behind the most NW house in East Ardougne", "3"),
new AnagramClue("O BIRDZ A ZANY EN PC", "Cap'n Izzy No-Beard", new WorldPoint(2807, 3191, 0), "Brimhaven Agility Arena", "33"),
new AnagramClue("OK CO", "Cook", new WorldPoint(3207, 3214, 0), "Ground floor of Lumbridge Castle", "9"),
new AnagramClue("OR ZINC FUMES WARD", "Wizard Frumscone", new WorldPoint(2594, 3086, 0), "Downstairs in the Wizards' Guild"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1575, 3590, 0), "Shayzien House Infirmary", "19"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1575, 3590, 0), "Shayzien Infirmary", "19"),
new AnagramClue("PACINNG A TAIE", "Captain Ginea", new WorldPoint(1561, 3602, 0), "Building east of Shayzien combat ring", "113"),
new AnagramClue("PEAK REFLEX", "Flax keeper", new WorldPoint(2744, 3444, 0), "Flax field south of Seers Village", "676"),
new AnagramClue("PEATY PERT", "Party Pete", new WorldPoint(3047, 3376, 0), "Falador Party Room"),
@@ -143,11 +143,11 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("SLIDE WOMAN", "Wise Old Man", new WorldPoint(3088, 3253, 0), "Draynor Village", "28"),
new AnagramClue("SNAH", "Hans", new WorldPoint(3218, 3219, 0), "Lumbridge Castle courtyard"),
new AnagramClue("SNAKES SO I SAIL", "Lisse Isaakson", new WorldPoint(2351, 3801, 0), "Neitiznot", "2"),
new AnagramClue("TAMED ROCKS", "Dockmaster", new WorldPoint(1822, 3739, 0), "Piscarilius House, NE of General store", "5"),
new AnagramClue("TAMED ROCKS", "Dockmaster", new WorldPoint(1822, 3739, 0), "Port Piscarilius, NE of General store", "5"),
new AnagramClue("TEN WIGS ON", "Wingstone", new WorldPoint(3389, 2877, 0), "Between Nardah & Agility Pyramid"),
new AnagramClue("THEM CAL CAME", "Cam the Camel", new WorldPoint(3300, 3231, 0), "Just outside of the Duel Arena"),
new AnagramClue("THICKNO", "Hickton", new WorldPoint(2822, 3442, 0), "Catherby fletching shop", "2"),
new AnagramClue("TWENTY CURE IRON", "New recruit Tony", new WorldPoint(1498, 3544, 0), "Shayzien House's Graveyard"),
new AnagramClue("TWENTY CURE IRON", "New recruit Tony", new WorldPoint(1498, 3544, 0), "Shayzien Graveyard"),
new AnagramClue("UNLEASH NIGHT MIST", "Sigli the Huntsman", new WorldPoint(2660, 3654, 0), "Rellekka", "302"),
new AnagramClue("VESTE", "Steve", new WorldPoint(2432, 3423, 0), "Upstairs Wyvern Area or Stronghold Slayer Cave", "2"),
new AnagramClue("VEIL VEDA", "Evil Dave", new WorldPoint(3079, 9892, 0), "Doris' basement, Edgeville", "666"),

View File

@@ -47,7 +47,7 @@ public class CipherClue extends ClueScroll implements TextClueScroll, NpcClueScr
new CipherClue("GUHCHO", "Drezel", new WorldPoint(3440, 9895, 0), "Paterdomus", "7"),
new CipherClue("ZCZL", "Adam", new WorldPoint(3227, 3227, 0), "Outside Lumbridge castle", "666"),
new CipherClue("ZHLUG ROG PDQ", "Weird Old Man", new WorldPoint(3224, 3112, 0), "Kalphite Lair entrance. Fairy ring BIQ", "150"),
new CipherClue("ECRVCKP MJCNGF", "Captain Khaled", new WorldPoint(1845, 3754, 0), "Large eastern building in Piscarilius House", "5"),
new CipherClue("ECRVCKP MJCNGF", "Captain Khaled", new WorldPoint(1845, 3754, 0), "Large eastern building in Port Piscarilius", "5"),
new CipherClue("OVEXON", "Eluned", new WorldPoint(2289, 3144, 0), "Outside Lletya", "53,000"),
new CipherClue("VTYR APCNTGLW", "King Percival", new WorldPoint(2634, 4682, 1), "Fisher Realm, first floor. Fairy ring BJR", "5"),
new CipherClue("UZZU MUJHRKYYKJ", "Otto Godblessed", new WorldPoint(2501, 3487, 0), "Otto's Grotto", "3"),
@@ -55,7 +55,7 @@ public class CipherClue extends ClueScroll implements TextClueScroll, NpcClueScr
new CipherClue("HCKTA IQFHCVJGT", "Fairy Godfather", new WorldPoint(2446, 4428, 0), "Zanaris throne room", "64"),
new CipherClue("ZSBKDO ZODO", "Pirate Pete", new WorldPoint(3680, 3537, 0), "Dock northeast of the Ectofunctus", "Puzzle"),
new CipherClue("GBJSZ RVFFO", "Fairy Queen", new WorldPoint(2347, 4435, 0), "Fairy Resistance Hideout", "Puzzle"),
new CipherClue("QSPGFTTPS HSBDLMFCPOF", "Professor Gracklebone", new WorldPoint(1625, 3802, 0), "Ground floor of Arceuus House Library", "9"),
new CipherClue("QSPGFTTPS HSBDLMFCPOF", "Professor Gracklebone", new WorldPoint(1625, 3802, 0), "Ground floor of Arceuus Library", "9"),
new CipherClue("IWPPLQTP", "Gunnjorn", new WorldPoint(2541, 3548, 0), "Barbarian Outpost Agility course", "Puzzle"),
new CipherClue("BSOPME MZETQPS", "Arnold Lydspor", new WorldPoint(2329, 3689, 0), "Piscatorus Fishing Colony general store/bank", "Puzzle")
);

View File

@@ -76,7 +76,7 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
.put(new WorldPoint(2363, 3531, 0), "North-east of Eagles' Peak.")
.put(new WorldPoint(2919, 3535, 0), "East of Burthorpe pub.")
.put(new WorldPoint(3548, 3560, 0), "Inside Fenkenstrain's Castle.")
.put(new WorldPoint(1456, 3620, 0), "Graveyard west of Shayzien House.")
.put(new WorldPoint(1456, 3620, 0), "Graveyard west of Shayzien.")
.put(new WorldPoint(2735, 3638, 0), "East of Rellekka, north-west of Golden Apple Tree (AJR).")
.put(new WorldPoint(2681, 3653, 0), "Rellekka, in the garden of the south-east house.")
.put(new WorldPoint(2537, 3881, 0), "Miscellania.")

View File

@@ -223,7 +223,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Dig where only the skilled, the wealthy, or the brave can choose not to visit again.", new WorldPoint(3221, 3219, 0), "Dig at Lumbridge spawn"),
new CrypticClue("Scattered coins and gems fill the floor. The chest you seek is in the north east.", "King Black Dragon", CLOSED_CHEST_375, new WorldPoint(2288, 4702, 0), "Kill the King Black Dragon for a key (elite), and then open the closed chest in the NE corner of the lair."),
new CrypticClue("A ring of water surrounds 4 powerful rings, dig above the ladder located there.", new WorldPoint(1910, 4367, 0), "Dig by the ladder leading to the Dagannoth Kings room in the Waterbirth Island Dungeon."),
new CrypticClue("This place sure is a mess.", "Ewesey", new WorldPoint(1646, 3631, 0), "Ewesey is located in the Hosidius House mess hall in Great Kourend."),
new CrypticClue("This place sure is a mess.", "Ewesey", new WorldPoint(1646, 3631, 0), "Ewesey is located in the mess hall in Hosidius."),
new CrypticClue("Here, there are tears, but nobody is crying. Speak to the guardian and show off your alignment to balance.", "Juna", JUNA, new WorldPoint(3252, 9517, 2), "Talk to Juna while wearing three Guthix related items."),
new CrypticClue("You might have to turn over a few stones to progress.", null, "Kill a rock crab."),
new CrypticClue("Dig under Razorlor's toad batta.", new WorldPoint(3139, 4554, 0), "Dig on the toad batta spawn in Tarn's Lair."),
@@ -240,7 +240,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Search the crates in the guard house of the northern gate of East Ardougne.", CRATE_356, new WorldPoint(2645, 3338, 0), "The guard house is northeast of the Handelmort Mansion."),
new CrypticClue("Go to the village being attacked by trolls, search the drawers in one of the houses.", "Penda", DRAWERS_350, new WorldPoint(2921, 3577, 0), "Go to Dunstan's house in the northeast corner of Burthorpe. Kill Penda in the Toad and Chicken to obtain the key."),
new CrypticClue("You'll get licked.", null, "Kill a Bloodveld."),
new CrypticClue("She's small but can build both literally and figuratively, as long as you have their favour.", "Lovada", new WorldPoint(1486, 3834, 0), "Speak to Lovada south of the Lovakengj House blast mine"),
new CrypticClue("She's small but can build both literally and figuratively, as long as you have their favour.", "Lovada", new WorldPoint(1486, 3834, 0), "Speak to Lovada by the entrance to the blast mine in Lovakengj."),
new CrypticClue("Dig in front of the icy arena where 1 of 4 was fought.", new WorldPoint(2874, 3757, 0), "Where you fought Kamil from Desert Treasure."),
new CrypticClue("Speak to Roavar.", "Roavar", new WorldPoint(3494, 3474, 0), "Talk to Roavar in the Canifis tavern."),
new CrypticClue("Search the drawers upstairs of houses in the eastern part of Falador.", DRAWERS_350, new WorldPoint(3035, 3347, 1), "House is located east of the eastern Falador bank and south of the fountain. The house is indicated by the icon on the minimap."),
@@ -255,7 +255,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Search the chests upstairs in Al Kharid Palace.", CLOSED_CHEST_375, new WorldPoint(3301, 3169, 1), "The chest is located, in the northeast corner, on the first floor of the Al Kharid Palace"),
new CrypticClue("Search the boxes just outside the Armour shop in East Ardougne.", BOXES_361, new WorldPoint(2654, 3299, 0), "Outside Zenesha's Plate Mail Body Shop"),
new CrypticClue("Surrounded by white walls and gems.", "Herquin", new WorldPoint(2945, 3335, 0), "Talk to Herquin, the gem store owner in Falador."),
new CrypticClue("Monk's residence in the far west. See robe storage device.", DRAWERS_350, new WorldPoint(1742, 3490, 1), "Search the drawers upstairs in the chapel found on the southern coast of Great Kourend's Hosidius House. Directly south of the player-owned house portal."),
new CrypticClue("Monk's residence in the far west. See robe storage device.", DRAWERS_350, new WorldPoint(1742, 3490, 1), "Search the drawers upstairs in the chapel found on the southern coast of Hosidius, directly south of the player-owned house portal."),
new CrypticClue("Search the drawers in Catherby's Archery shop.", DRAWERS_350, new WorldPoint(2825, 3442, 0), "Hickton's Archery Emporium in Catherby."),
new CrypticClue("The hand ain't listening.", "The Face", new WorldPoint(3019, 3232, 0), "Talk to The Face located by the manhole just north of the Port Sarim fishing shop."),
new CrypticClue("Search the chest in the left-hand tower of Camelot Castle.", CLOSED_CHEST_25592, new WorldPoint(2748, 3495, 2), "Located on the second floor of the western tower of Camelot."),
@@ -263,7 +263,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Anger those who adhere to Saradomin's edicts to prevent travel.", "Monk of Entrana", new WorldPoint(3042, 3236, 0), "Port Sarim Docks, try to charter a ship to Entrana with armour or weapons equipped."),
new CrypticClue("South of a river in a town surrounded by the undead, what lies beneath the furnace?", new WorldPoint(2857, 2966, 0), "Dig in front of the Shilo Village furnace."),
new CrypticClue("Talk to the Squire in the White Knights' castle in Falador.", "Squire", new WorldPoint(2977, 3343, 0), "The squire is located in the courtyard of the White Knights' Castle."),
new CrypticClue("Thanks, Grandma!", "Tynan", new WorldPoint(1836, 3786, 0), "Tynan can be found in the north-east corner of Piscarilius House in Great Kourend."),
new CrypticClue("Thanks, Grandma!", "Tynan", new WorldPoint(1836, 3786, 0), "Tynan can be found in the north-east corner of Port Piscarilius."),
new CrypticClue("In a town where everyone has perfect vision, seek some locked drawers in a house that sits opposite a workshop.", "Chicken", DRAWERS_25766, new WorldPoint(2709, 3478, 0), "The Seers' Village house south of the Elemental Workshop entrance. Kill any Chicken to obtain a key."),
new CrypticClue("The treasure is buried in a small building full of bones. Here is a hint: it's not near a graveyard.", new WorldPoint(3356, 3507, 0), "In the western building near the Limestone quarry east of Varrock. Dig south of the box of bones in the smaller building."),
new CrypticClue("Search the crates in East Ardougne's general store.", CRATE_357, new WorldPoint(2615, 3291, 0), "Located south of the Ardounge church."),
@@ -274,8 +274,8 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Impossible to make angry", "Abbot Langley", new WorldPoint(3059, 3486, 0), "Speak to Abbot Langley at the Edgeville Monastery."),
new CrypticClue("Search the crates in Horvik's armoury.", CRATE_5106, new WorldPoint(3228, 3433, 0), "Horvik's in Varrock"),
new CrypticClue("Ghommal wishes to be impressed by how strong your equipment is.", "Ghommal", new WorldPoint(2878, 3546, 0), "Speak to Ghommal at the Warriors' Guild with a total Melee Strength bonus of over 100."),
new CrypticClue("Shhhh!", "Logosia", new WorldPoint(1633, 3808, 0), "Speak to Logosia in the Arceuus House Library's ground floor."),
new CrypticClue("Salty peter.", "Konoo", new WorldPoint(1703, 3524, 0), "Talk to Konoo who is digging saltpeter in the Hosidius district in Zeah."),
new CrypticClue("Shhhh!", "Logosia", new WorldPoint(1633, 3808, 0), "Speak to Logosia in the Arceuus Library's ground floor."),
new CrypticClue("Salty peter.", "Konoo", new WorldPoint(1703, 3524, 0), "Talk to Konoo who is digging saltpetre in Hosidius, south of the bank."),
new CrypticClue("Talk to Zeke in Al Kharid.", "Zeke", new WorldPoint(3287, 3190, 0), "Zeke is the owner of the scimitar shop in Al Kharid."),
new CrypticClue("Guthix left his mark in a fiery lake, dig at the tip of it.", new WorldPoint(3069, 3935, 0), "Dig at the tip of the lava lake that is shaped like a Guthixian symbol, west of the Mage Arena."),
new CrypticClue("Search the drawers in the upstairs of a house in Catherby.", DRAWERS_350, new WorldPoint(2809, 3451, 1), "Perdu's house in Catherby."),
@@ -294,11 +294,11 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Dig in the centre of a great kingdom of 5 cities.", new WorldPoint(1639, 3673, 0), "Dig in front of the large statue in the centre of Great Kourend."),
new CrypticClue("Hopefully this set of armour will help you to keep surviving.", "Sir Vyvin", new WorldPoint(2982, 3336, 2), "Speak to Sir Vyvin while wearing a white platebody, and platelegs."),
new CrypticClue("The beasts retreat, for their Queen is gone; the song of this town still plays on. Dig near the birthplace of a blade, be careful not to melt your spade.", new WorldPoint(2342, 3677, 0), "Dig in front of the small furnace in the Piscatoris Fishing Colony."),
new CrypticClue("Darkness wanders around me, but fills my mind with knowledge.", "Biblia", new WorldPoint(1633, 3825, 2), "Speak to Biblia on the Arceuus House Library's top floor."),
new CrypticClue("Darkness wanders around me, but fills my mind with knowledge.", "Biblia", new WorldPoint(1633, 3825, 2), "Speak to Biblia on the Arceuus Library's top floor."),
new CrypticClue("I would make a chemistry joke, but I'm afraid I wouldn't get a reaction.", "Chemist", new WorldPoint(2932, 3212, 0), "Talk to the Chemist in Rimmington"),
new CrypticClue("Show this to Hazelmere.", "Hazelmere", new WorldPoint(2677, 3088, 1), "Hazelmere is found upstairs on the island located just east of Yanille."),
new CrypticClue("Does one really need a fire to stay warm here?", new WorldPoint(3816, 3810, 0), "Dig next to the fire near the Volcanic Mine entrance."),
new CrypticClue("Search the open crate found in a small farmhouse in Hosidius. Cabbages grow outside.", CRATE_27533, new WorldPoint(1687, 3628, 0), "The house is east of the Mess in Great Kourend."),
new CrypticClue("Search the open crate found in a small farmhouse in Hosidius. Cabbages grow outside.", CRATE_27533, new WorldPoint(1687, 3628, 0), "The house is north-east of the general store in Hosidius."),
new CrypticClue("Dig under Ithoi's cabin.", new WorldPoint(2529, 2838, 0), "Dig under Ithoi's cabin in the Corsair Cove."),
new CrypticClue("Search the drawers, upstairs in the bank to the East of Varrock.", DRAWERS_7194, new WorldPoint(3250, 3420, 1), "Search the drawers upstairs in Varrock east bank."),
new CrypticClue("Speak to Hazelmere.", "Hazelmere", new WorldPoint(2677, 3088, 1), "Located upstairs in the house to the north of fairy ring CLS. Answer: 6859"),

View File

@@ -118,7 +118,7 @@ public enum HotColdLocation
MISTHALIN_VARROCK_STONE_CIRCLE(new WorldPoint(3225, 3355, 0), MISTHALIN, "South of the stone circle near Varrock's entrance."),
MISTHALIN_LUMBRIDGE(new WorldPoint(3238, 3169, 0), MISTHALIN, "Just north-west of the Lumbridge Fishing tutor."),
MISTHALIN_LUMBRIDGE_2(new WorldPoint(3170, 3278, 0), MISTHALIN, "North of the pond between Lumbridge and Draynor Village."),
MISTHALIN_GERTUDES(new WorldPoint(3158, 3421, 0), MISTHALIN, "Nort-east of Gertrude's house west of Varrock."),
MISTHALIN_GERTUDES(new WorldPoint(3158, 3421, 0), MISTHALIN, "North-east of Gertrude's house west of Varrock."),
MISTHALIN_DRAYNOR_BANK(new WorldPoint(3096, 3235, 0), MISTHALIN, "South of Draynor Village bank."),
MISTHALIN_LUMBER_YARD(new WorldPoint(3303, 3483, 0), MISTHALIN, "South of Lumber Yard, east of Assistant Serf."),
MORYTANIA_BURGH_DE_ROTT(new WorldPoint(3545, 3253, 0), MORYTANIA, "In the north-east area of Burgh de Rott, by the reverse-L-shaped ruins."),
@@ -151,25 +151,25 @@ public enum HotColdLocation
WILDERNESS_38(new WorldPoint(3294, 3817, 0), WILDERNESS, "South of Callisto, level 38 Wilderness."),
WILDERNESS_49(new WorldPoint(3140, 3910, 0), WILDERNESS, "South-west of the Deserted Keep, level 49 Wilderness."),
WILDERNESS_54(new WorldPoint(2983, 3946, 0), WILDERNESS, "West of the Wilderness Agility Course, level 54 Wilderness."),
ZEAH_BLASTMINE_BANK(new WorldPoint(1507, 3856, 0), ZEAH, "Next to the bank in the Lovakengj House blast mine."),
ZEAH_BLASTMINE_NORTH(new WorldPoint(1490, 3883, 0), ZEAH, "Northern part of the Lovakengj House blast mine."),
ZEAH_LOVAKITE_FURNACE(new WorldPoint(1505, 3814, 0), ZEAH, "Next to the lovakite furnace in the Lovakengj House."),
ZEAH_BLASTMINE_BANK(new WorldPoint(1507, 3856, 0), ZEAH, "Next to the bank in the Lovakengj blast mine."),
ZEAH_BLASTMINE_NORTH(new WorldPoint(1490, 3883, 0), ZEAH, "Northern part of the Lovakengj blast mine."),
ZEAH_LOVAKITE_FURNACE(new WorldPoint(1505, 3814, 0), ZEAH, "Next to the lovakite furnace in Lovakengj."),
ZEAH_LOVAKENGJ_MINE(new WorldPoint(1477, 3779, 0), ZEAH, "Next to mithril rock in the Lovakengj mine."),
ZEAH_SULPHR_MINE(new WorldPoint(1428, 3866, 0), ZEAH, "Western entrance in the Lovakengj House's sulphur mine."),
ZEAH_SHAYZIEN_BANK(new WorldPoint(1517, 3603, 0), ZEAH, "South-east of the bank in the Shayzien House."),
ZEAH_OVERPASS(new WorldPoint(1467, 3714, 0), ZEAH, "Overpass between the Lovakengj and Shayzien House."),
ZEAH_LIZARDMAN(new WorldPoint(1493, 3694, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with the Shayzien House."),
ZEAH_SULPHR_MINE(new WorldPoint(1428, 3866, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine."),
ZEAH_SHAYZIEN_BANK(new WorldPoint(1517, 3603, 0), ZEAH, "South-east of the bank in Shayzien."),
ZEAH_OVERPASS(new WorldPoint(1467, 3714, 0), ZEAH, "Overpass between Lovakengj and Shayzien."),
ZEAH_LIZARDMAN(new WorldPoint(1493, 3694, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien."),
ZEAH_COMBAT_RING(new WorldPoint(1557, 3580, 0), ZEAH, "Shayzien, south-east of the Combat Ring."),
ZEAH_SHAYZIEN_BANK_2(new WorldPoint(1494, 3622, 0), ZEAH, "North-west of the bank in the Shayzien House."),
ZEAH_LIBRARY(new WorldPoint(1601, 3842, 0), ZEAH, "North-west of the Arceuus House Library."),
ZEAH_HOUSECHURCH(new WorldPoint(1682, 3792, 0), ZEAH, "By the entrance to the Arceuus Housechurch."),
ZEAH_SHAYZIEN_BANK_2(new WorldPoint(1494, 3622, 0), ZEAH, "North-west of the bank in Shayzien."),
ZEAH_LIBRARY(new WorldPoint(1601, 3842, 0), ZEAH, "North-west of the Arceuus Library."),
ZEAH_HOUSECHURCH(new WorldPoint(1682, 3792, 0), ZEAH, "By the entrance to the Arceuus church."),
ZEAH_DARK_ALTAR(new WorldPoint(1699, 3879, 0), ZEAH, "West of the Dark Altar."),
ZEAH_ARCEUUS_HOUSE(new WorldPoint(1708, 3701, 0), ZEAH, "By the southern entrance to the Arceuus House."),
ZEAH_ARCEUUS_HOUSE(new WorldPoint(1708, 3701, 0), ZEAH, "By the southern entrance to Arceuus."),
ZEAH_ESSENCE_MINE(new WorldPoint(1762, 3852, 0), ZEAH, "By the Arceuus essence mine."),
ZEAH_ESSENCE_MINE_NE(new WorldPoint(1772, 3866, 0), ZEAH, "North-east of the Arceuus essence mine."),
ZEAH_PISCARILUS_MINE(new WorldPoint(1768, 3705, 0), ZEAH, "South of the Piscarilius mine."),
ZEAH_GOLDEN_FIELD_TAVERN(new WorldPoint(1718, 3647, 0), ZEAH, "South of The Golden Field tavern in the northern area of Great Kourend's Hosidius House."),
ZEAH_MESS_HALL(new WorldPoint(1658, 3621, 0), ZEAH, "East of Mess hall."),
ZEAH_GOLDEN_FIELD_TAVERN(new WorldPoint(1718, 3647, 0), ZEAH, "South of The Golden Field tavern in the northern area of Hosidius."),
ZEAH_MESS_HALL(new WorldPoint(1658, 3621, 0), ZEAH, "East of the Mess hall."),
ZEAH_WATSONS_HOUSE(new WorldPoint(1653, 3573, 0), ZEAH, "East of Watson's house."),
ZEAH_VANNAHS_FARM_STORE(new WorldPoint(1806, 3521, 0), ZEAH, "North of Vannah's Farm Store, between the chicken coop and willow trees."),
ZEAH_FARMING_GUILD_W(new WorldPoint(1209, 3737, 0), ZEAH, "West of the Farming Guild."),

View File

@@ -42,4 +42,15 @@ public interface CookingConfig extends Config
{
return 5;
}
@ConfigItem(
position = 2,
keyName = "fermentTimer",
name = "Show wine fermenting timer",
description = "Conifgures if the timer before wines are fermented is shown."
)
default boolean fermentTimer()
{
return true;
}
}

View File

@@ -29,8 +29,8 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.text.DecimalFormat;
import java.time.Instant;
import java.time.Duration;
import java.time.Instant;
import javax.inject.Inject;
import static net.runelite.api.AnimationID.COOKING_FIRE;
import static net.runelite.api.AnimationID.COOKING_RANGE;
@@ -72,7 +72,7 @@ class CookingOverlay extends Overlay
@Override
public Dimension render(Graphics2D graphics)
{
CookingSession session = plugin.getSession();
CookingSession session = plugin.getCookingSession();
if (session == null)
{
return null;

View File

@@ -50,17 +50,25 @@ import net.runelite.client.ui.overlay.OverlayManager;
@PluginDependency(XpTrackerPlugin.class)
public class CookingPlugin extends Plugin
{
private static final String WINE_MESSAGE = "You squeeze the grapes into the jug";
@Inject
private CookingConfig config;
@Inject
private CookingOverlay overlay;
private CookingOverlay cookingOverlay;
@Inject
private FermentTimerOverlay fermentTimerOverlay;
@Inject
private OverlayManager overlayManager;
@Getter(AccessLevel.PACKAGE)
private CookingSession session;
private CookingSession cookingSession;
@Getter(AccessLevel.PACKAGE)
private FermentTimerSession fermentTimerSession;
@Provides
CookingConfig getConfig(ConfigManager configManager)
@@ -71,31 +79,48 @@ public class CookingPlugin extends Plugin
@Override
protected void startUp() throws Exception
{
session = null;
overlayManager.add(overlay);
cookingSession = null;
fermentTimerSession = null;
overlayManager.add(cookingOverlay);
overlayManager.add(fermentTimerOverlay);
}
@Override
protected void shutDown() throws Exception
{
overlayManager.remove(overlay);
session = null;
overlayManager.remove(fermentTimerOverlay);
overlayManager.remove(cookingOverlay);
fermentTimerSession = null;
cookingSession = null;
}
@Subscribe
public void onGameTick(GameTick gameTick)
{
if (session == null || config.statTimeout() == 0)
if (config.statTimeout() == 0)
{
return;
}
Duration statTimeout = Duration.ofMinutes(config.statTimeout());
Duration sinceCut = Duration.between(session.getLastCookingAction(), Instant.now());
if (sinceCut.compareTo(statTimeout) >= 0)
if (cookingSession != null)
{
session = null;
Duration statTimeout = Duration.ofMinutes(config.statTimeout());
Duration sinceCut = Duration.between(cookingSession.getLastCookingAction(), Instant.now());
if (sinceCut.compareTo(statTimeout) >= 0)
{
cookingSession = null;
}
}
if (fermentTimerSession != null)
{
Duration statTimeout = Duration.ofMinutes(config.statTimeout());
Duration sinceCut = Duration.between(fermentTimerSession.getLastWineMakingAction(), Instant.now());
if (sinceCut.compareTo(statTimeout) >= 0)
{
fermentTimerSession = null;
}
}
}
@@ -109,31 +134,41 @@ public class CookingPlugin extends Plugin
final String message = event.getMessage();
if (message.startsWith(WINE_MESSAGE) && config.fermentTimer())
{
if (fermentTimerSession == null)
{
fermentTimerSession = new FermentTimerSession();
}
fermentTimerSession.updateLastWineMakingAction();
}
if (message.startsWith("You successfully cook")
|| message.startsWith("You successfully bake")
|| message.startsWith("You manage to cook")
|| message.startsWith("You roast a")
|| message.startsWith("You cook")
|| message.startsWith("You squeeze the grapes into the jug"))
|| message.startsWith(WINE_MESSAGE))
{
if (session == null)
if (cookingSession == null)
{
session = new CookingSession();
cookingSession = new CookingSession();
}
session.updateLastCookingAction();
session.increaseCookAmount();
cookingSession.updateLastCookingAction();
cookingSession.increaseCookAmount();
}
else if (message.startsWith("You accidentally burn"))
{
if (session == null)
if (cookingSession == null)
{
session = new CookingSession();
cookingSession = new CookingSession();
}
session.updateLastCookingAction();
session.increaseBurnAmount();
cookingSession.updateLastCookingAction();
cookingSession.increaseBurnAmount();
}
}
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (c) 2019, Lucas C <lucas1757@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.cooking;
import com.google.inject.Inject;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.time.Duration;
import java.time.Instant;
import lombok.extern.slf4j.Slf4j;
import static net.runelite.api.AnimationID.COOKING_WINE;
import net.runelite.api.Client;
import static net.runelite.api.MenuAction.RUNELITE_OVERLAY_CONFIG;
import net.runelite.client.ui.overlay.Overlay;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.PanelComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;
@Slf4j
class FermentTimerOverlay extends Overlay
{
private static final int INITIAL_TIME = 12;
private final Client client;
private final CookingPlugin plugin;
private final PanelComponent panelComponent = new PanelComponent();
@Inject
private FermentTimerOverlay(final Client client, final CookingPlugin plugin)
{
super(plugin);
setPosition(OverlayPosition.TOP_LEFT);
this.client = client;
this.plugin = plugin;
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Fermenting Timer overlay"));
}
@Override
public Dimension render(Graphics2D graphics)
{
FermentTimerSession session = plugin.getFermentTimerSession();
if (session == null)
{
return null;
}
panelComponent.getChildren().clear();
if (isMakingWine() || Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds() < INITIAL_TIME)
{
panelComponent.getChildren().add(TitleComponent.builder()
.text("Making Wine")
.color(Color.GREEN)
.build());
panelComponent.getChildren().add(LineComponent.builder()
.left("Ferments in: ")
.right(String.valueOf(INITIAL_TIME - Duration.between(session.getLastWineMakingAction(), Instant.now()).getSeconds()))
.build());
}
else
{
panelComponent.getChildren().add(TitleComponent.builder()
.text("Wine Fermented")
.color(Color.ORANGE)
.build());
}
return panelComponent.render(graphics);
}
private boolean isMakingWine()
{
return (client.getLocalPlayer().getAnimation() == COOKING_WINE);
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) 2019, Lucas C <lucas1757@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.cooking;
import java.time.Instant;
import lombok.AccessLevel;
import lombok.Getter;
class FermentTimerSession
{
@Getter(AccessLevel.PACKAGE)
private Instant lastWineMakingAction;
void updateLastWineMakingAction()
{
this.lastWineMakingAction = Instant.now();
}
}

View File

@@ -63,7 +63,7 @@ public interface DailyTasksConfig extends Config
)
default boolean showEssence()
{
return true;
return false;
}
@ConfigItem(
@@ -74,7 +74,7 @@ public interface DailyTasksConfig extends Config
)
default boolean showRunes()
{
return true;
return false;
}
@ConfigItem(
@@ -85,7 +85,7 @@ public interface DailyTasksConfig extends Config
)
default boolean showSand()
{
return true;
return false;
}
@ConfigItem(
@@ -96,7 +96,7 @@ public interface DailyTasksConfig extends Config
)
default boolean showFlax()
{
return true;
return false;
}
@ConfigItem(
@@ -107,7 +107,7 @@ public interface DailyTasksConfig extends Config
)
default boolean showBonemeal()
{
return true;
return false;
}
@ConfigItem(

View File

@@ -67,7 +67,6 @@ public class DailyTasksPlugin extends Plugin
private static final String BONEMEAL_MESSAGE = "You have bonemeal and slime waiting to be collected from Robin.";
private static final int BONEMEAL_PER_DIARY = 13;
private static final String DYNAMITE_MESSAGE = "You have dynamite waiting to be collected from Thirus.";
private static final String RELOG_MESSAGE = " (May require a relog)";
@Inject
private Client client;
@@ -170,9 +169,11 @@ public class DailyTasksPlugin extends Plugin
private void checkHerbBoxes(boolean dailyReset)
{
if ((client.getAccountType() == AccountType.NORMAL
&& client.getVar(VarPlayer.NMZ_REWARD_POINTS) >= HERB_BOX_COST)
&& (dailyReset || client.getVar(Varbits.DAILY_HERB_BOXES_COLLECTED) < HERB_BOX_MAX))
if (client.getAccountType() == AccountType.NORMAL
&& client.getVar(VarPlayer.NMZ_REWARD_POINTS) >= HERB_BOX_COST
&& (client.getVar(Varbits.DAILY_HERB_BOXES_COLLECTED) < HERB_BOX_MAX
|| dailyReset))
{
sendChatMessage(HERB_BOX_MESSAGE);
}
@@ -180,23 +181,19 @@ public class DailyTasksPlugin extends Plugin
private void checkStaves(boolean dailyReset)
{
if (client.getVar(Varbits.DIARY_VARROCK_EASY) == 1)
if (client.getVar(Varbits.DIARY_VARROCK_EASY) == 1
&& (client.getVar(Varbits.DAILY_STAVES_COLLECTED) == 0
|| dailyReset))
{
if (client.getVar(Varbits.DAILY_STAVES_COLLECTED) == 0)
{
sendChatMessage(STAVES_MESSAGE);
}
else if (dailyReset)
{
sendChatMessage(STAVES_MESSAGE + RELOG_MESSAGE);
}
sendChatMessage(STAVES_MESSAGE);
}
}
private void checkEssence(boolean dailyReset)
{
if ((client.getVar(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1)
&& (dailyReset || client.getVar(Varbits.DAILY_ESSENCE_COLLECTED) == 0))
if (client.getVar(Varbits.DIARY_ARDOUGNE_MEDIUM) == 1
&& (client.getVar(Varbits.DAILY_ESSENCE_COLLECTED) == 0
|| dailyReset))
{
sendChatMessage(ESSENCE_MESSAGE);
}
@@ -204,8 +201,9 @@ public class DailyTasksPlugin extends Plugin
private void checkRunes(boolean dailyReset)
{
if ((client.getVar(Varbits.DIARY_WILDERNESS_EASY) == 1)
&& (dailyReset || client.getVar(Varbits.DAILY_RUNES_COLLECTED) == 0))
if (client.getVar(Varbits.DIARY_WILDERNESS_EASY) == 1
&& (client.getVar(Varbits.DAILY_RUNES_COLLECTED) == 0
|| dailyReset))
{
sendChatMessage(RUNES_MESSAGE);
}
@@ -213,8 +211,9 @@ public class DailyTasksPlugin extends Plugin
private void checkSand(boolean dailyReset)
{
if ((client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE)
&& (dailyReset || client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0))
if (client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE
&& (client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0
|| dailyReset))
{
sendChatMessage(SAND_MESSAGE);
}
@@ -261,16 +260,11 @@ public class DailyTasksPlugin extends Plugin
private void checkDynamite(boolean dailyReset)
{
if (client.getVar(Varbits.DIARY_KOUREND_MEDIUM) == 1)
if (client.getVar(Varbits.DIARY_KOUREND_MEDIUM) == 1
&& (client.getVar(Varbits.DAILY_DYNAMITE_COLLECTED) == 0
|| dailyReset))
{
if (client.getVar(Varbits.DAILY_DYNAMITE_COLLECTED) == 0)
{
sendChatMessage(DYNAMITE_MESSAGE);
}
else if (dailyReset)
{
sendChatMessage(DYNAMITE_MESSAGE);
}
sendChatMessage(DYNAMITE_MESSAGE);
}
}

View File

@@ -88,7 +88,7 @@ enum DiscordGameEventType
// Cities
CITY_AL_KHARID("Al Kharid" , DiscordAreaType.CITIES, 13105, 13106),
CITY_APE_ATOLL("Ape Atoll" , DiscordAreaType.CITIES, 10795, 11051, 10974, 11050),
CITY_ARCEUUS_HOUSE("Arceuus House" , DiscordAreaType.CITIES, 6459, 6715, 6458, 6714),
CITY_ARCEUUS_HOUSE("Arceuus" , DiscordAreaType.CITIES, 6459, 6715, 6458, 6714),
CITY_ARDOUGNE("Ardougne" , DiscordAreaType.CITIES, 10548, 10547, 10292, 10291, 10036, 10035, 9780, 9779),
CITY_BARBARIAN_VILLAGE("Barbarian Village" , DiscordAreaType.CITIES, 12341),
CITY_BANDIT_CAMP("Bandit Camp" , DiscordAreaType.CITIES, 12591),
@@ -106,13 +106,13 @@ 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_HOSIDIUS_HOUSE("Hosidius House" , DiscordAreaType.CITIES, 6713, 6712, 6455, 6711, 6710, 6965, 6966, 7222, 7223, 6967),
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),
CITY_KARAMJA("Karamja" , DiscordAreaType.CITIES, 11569, 11568, 11567, 11566, 11313, 11312, 11311),
CITY_KELDAGRIM("Keldagrim" , DiscordAreaType.CITIES, 11423, 11422, 11679, 11678),
CITY_LLETYA("Lletya" , DiscordAreaType.CITIES, 9265),
CITY_LOVAKENGJ_HOUSE("Lovakengj House" , DiscordAreaType.CITIES, 5692, 5948, 5691, 5947, 6203, 6202, 5690, 5946),
CITY_LOVAKENGJ_HOUSE("Lovakengj" , DiscordAreaType.CITIES, 5692, 5948, 5691, 5947, 6203, 6202, 5690, 5946),
CITY_LUMBRIDGE("Lumbridge" , DiscordAreaType.CITIES, 12850),
CITY_LUNAR_ISLE("Lunar Isle" , DiscordAreaType.CITIES, 8253, 8252, 8509, 8508),
CITY_MEIYERDITCH("Meiyerditch" , DiscordAreaType.CITIES, 14132, 14388, 14387, 14386, 14385),
@@ -128,11 +128,11 @@ enum DiscordGameEventType
CITY_PORT_KHAZARD("Port Khazard" , DiscordAreaType.CITIES, 10545),
CITY_PORT_PHASMATYS("Port Phasmatys" , DiscordAreaType.CITIES, 14646),
CITY_PORT_SARIM("Port Sarim" , DiscordAreaType.CITIES, 12082),
CITY_PISCARILIUS_HOUSE("Piscarilius House" , DiscordAreaType.CITIES, 6971, 7227, 6970, 7226),
CITY_PISCARILIUS_HOUSE("Port Piscarilius" , DiscordAreaType.CITIES, 6971, 7227, 6970, 7226),
CITY_RELLEKKA("Rellekka" , DiscordAreaType.CITIES, 10553),
CITY_RIMMINGTON("Rimmington" , DiscordAreaType.CITIES, 11826, 11570),
CITY_SEERS_VILLAGE("Seers' Village" , DiscordAreaType.CITIES, 10806),
CITY_SHAYZIEN_HOUSE("Shayzien House" , DiscordAreaType.CITIES, 5944, 5943, 6200, 6199, 5688),
CITY_SHAYZIEN_HOUSE("Shayzien" , DiscordAreaType.CITIES, 5944, 5943, 6200, 6199, 5688),
CITY_SHILO_VILLAGE("Shilo Village" , DiscordAreaType.CITIES, 11310),
CITY_SOPHANEM("Sophanem" , DiscordAreaType.CITIES, 13099),
CITY_TAI_BWO_WANNAI("Tai Bwo Wannai" , DiscordAreaType.CITIES, 11056, 11055),

View File

@@ -59,7 +59,7 @@ public enum FairyRings
// C
CIP("(Island) Miscellania"),
CIQ("North-west of Yanille"),
CIS("North of the Arceuus House Library"),
CIS("North of the Arceuus Library"),
CIR("North-east of the Farming Guild", "mount karuulm konar"),
CJR("Sinclair Mansion (east)"),
CKP("Cosmic entity's plane"),

View File

@@ -213,6 +213,7 @@ public class IdleNotifierPlugin extends Plugin
case HERBLORE_MAKE_TAR:
/* Magic */
case MAGIC_CHARGING_ORBS:
case MAGIC_LUNAR_PLANK_MAKE:
case MAGIC_LUNAR_STRING_JEWELRY:
case MAGIC_MAKE_TABLET:
case MAGIC_ENCHANTING_JEWELRY:

View File

@@ -26,7 +26,7 @@
package net.runelite.client.plugins.npchighlight;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Provides;
import java.time.Instant;
import java.util.ArrayList;
@@ -47,6 +47,7 @@ import net.runelite.api.GameState;
import net.runelite.api.GraphicID;
import net.runelite.api.GraphicsObject;
import net.runelite.api.MenuAction;
import static net.runelite.api.MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET;
import net.runelite.api.MenuEntry;
import net.runelite.api.NPC;
import net.runelite.api.coords.WorldPoint;
@@ -83,7 +84,7 @@ public class NpcIndicatorsPlugin extends Plugin
// Option added to NPC menu
private static final String TAG = "Tag";
private static final List<MenuAction> NPC_MENU_ACTIONS = ImmutableList.of(MenuAction.NPC_FIRST_OPTION, MenuAction.NPC_SECOND_OPTION,
private static final Set<MenuAction> NPC_MENU_ACTIONS = ImmutableSet.of(MenuAction.NPC_FIRST_OPTION, MenuAction.NPC_SECOND_OPTION,
MenuAction.NPC_THIRD_OPTION, MenuAction.NPC_FOURTH_OPTION, MenuAction.NPC_FIFTH_OPTION);
@Inject
@@ -251,26 +252,34 @@ public class NpcIndicatorsPlugin extends Plugin
{
MenuEntry[] menuEntries = client.getMenuEntries();
String target = event.getTarget();
if (config.highlightMenuNames() && highlightedNpcs.stream().anyMatch(npc -> npc.getIndex() == event.getIdentifier()))
int type = event.getType();
if (type >= MENU_ACTION_DEPRIORITIZE_OFFSET)
{
MenuEntry menuEntry = menuEntries[menuEntries.length - 1];
// Strip out existing color tag
target.substring(target.indexOf('>') + 1);
target = ColorUtil.prependColorTag(target, config.getHighlightColor());
menuEntry.setTarget(target);
type -= MENU_ACTION_DEPRIORITIZE_OFFSET;
}
if (hotKeyPressed && event.getType() == MenuAction.EXAMINE_NPC.getId())
if (config.highlightMenuNames() &&
NPC_MENU_ACTIONS.contains(MenuAction.of(type)) &&
highlightedNpcs.stream().anyMatch(npc -> npc.getIndex() == event.getIdentifier()))
{
final MenuEntry menuEntry = menuEntries[menuEntries.length - 1];
menuEntry.setTarget(target);
client.setMenuEntries(menuEntries);
}
else if (hotKeyPressed && type == MenuAction.EXAMINE_NPC.getId())
{
// Add tag option
menuEntries = Arrays.copyOf(menuEntries, menuEntries.length + 1);
MenuEntry tagEntry = menuEntries[menuEntries.length - 1] = new MenuEntry();
final MenuEntry tagEntry = menuEntries[menuEntries.length - 1] = new MenuEntry();
tagEntry.setOption(TAG);
tagEntry.setTarget(target);
tagEntry.setTarget(event.getTarget());
tagEntry.setParam0(event.getActionParam0());
tagEntry.setParam1(event.getActionParam1());
tagEntry.setIdentifier(event.getIdentifier());
tagEntry.setType(MenuAction.RUNELITE.getId());
client.setMenuEntries(menuEntries);
}
client.setMenuEntries(menuEntries);
}
@Subscribe

View File

@@ -41,6 +41,7 @@ import static net.runelite.api.widgets.WidgetID.EQUIPMENT_INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.GRAND_EXCHANGE_INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.GUIDE_PRICES_INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.SEED_VAULT_INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.SHOP_INVENTORY_GROUP_ID;
import static net.runelite.api.widgets.WidgetInfo.TO_GROUP;
import net.runelite.api.widgets.WidgetItem;
@@ -92,7 +93,8 @@ public abstract class WidgetItemOverlay extends Overlay
GRAND_EXCHANGE_INVENTORY_GROUP_ID,
GUIDE_PRICES_INVENTORY_GROUP_ID,
EQUIPMENT_INVENTORY_GROUP_ID,
INVENTORY_GROUP_ID);
INVENTORY_GROUP_ID,
SEED_VAULT_INVENTORY_GROUP_ID);
}
protected void showOnBank()

View File

@@ -33,6 +33,9 @@ import net.runelite.api.events.ChatMessage;
import net.runelite.client.ui.overlay.OverlayManager;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -64,6 +67,10 @@ public class CookingPluginTest
@Bind
CookingOverlay cookingOverlay;
@Mock
@Bind
FermentTimerOverlay fermentTimerOverlay;
@Mock
@Bind
OverlayManager overlayManager;
@@ -83,8 +90,30 @@ public class CookingPluginTest
cookingPlugin.onChatMessage(chatMessage);
}
CookingSession cookingSession = cookingPlugin.getSession();
CookingSession cookingSession = cookingPlugin.getCookingSession();
assertNotNull(cookingSession);
assertEquals(COOKING_MESSAGES.length, cookingSession.getCookAmount());
}
@Test
public void testFermentTimerOnChatMessage()
{
when(config.fermentTimer()).thenReturn(true);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", COOKING_MESSAGES[6], "", 0);
cookingPlugin.onChatMessage(chatMessage);
FermentTimerSession fermentTimerSession = cookingPlugin.getFermentTimerSession();
assertNotNull(fermentTimerSession);
}
@Test
public void testFermentTimerOnChatMessage_pluginDisabled()
{
when(config.fermentTimer()).thenReturn(false);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.SPAM, "", COOKING_MESSAGES[6], "", 0);
cookingPlugin.onChatMessage(chatMessage);
FermentTimerSession fermentTimerSession = cookingPlugin.getFermentTimerSession();
assertNull(fermentTimerSession);
}
}