menu modifier change

This commit is contained in:
Kyleeld
2019-05-25 20:23:22 +01:00
parent e1ffee6671
commit d55cd1a605
20 changed files with 2125 additions and 2108 deletions

View File

@@ -1,893 +0,0 @@
/*
* Copyright (c) 2018, Alan Baumgartner <https://github.com/alanbaumgartner>
* Copyright (c) 2018, https://runelitepl.us
* Copyright (c) 2018, Kyle <https://github.com/kyleeld>
* Copyright (c) 2018, Owain van Brakel <https://github.com/Owain94>
* 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.easyscape;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.plugins.easyscape.util.DuelingRingMode;
import net.runelite.client.plugins.easyscape.util.GamesNecklaceMode;
import net.runelite.client.plugins.easyscape.util.GloryMode;
import net.runelite.client.plugins.easyscape.util.MaxCapeMode;
import net.runelite.client.plugins.easyscape.util.SkillsNecklaceMode;
import net.runelite.client.plugins.easyscape.util.NecklaceOfPassageMode;
import net.runelite.client.plugins.easyscape.util.DigsitePendantMode;
import net.runelite.client.plugins.easyscape.util.CombatBraceletMode;
import net.runelite.client.plugins.easyscape.util.SlayerRingMode;
import net.runelite.client.plugins.easyscape.util.BurningAmuletMode;
import net.runelite.client.plugins.easyscape.util.XericsTalismanMode;
import net.runelite.client.plugins.easyscape.util.RingOfWealthMode;
@ConfigGroup("easyscape")
public interface EasyscapeConfig extends Config
{
@ConfigItem(
keyName = "withdrawOne",
name = "Withdraw/Deposit One",
description = "",
position = 0,
group = "Banking"
)
default boolean getWithdrawOne()
{
return false;
}
@ConfigItem(
keyName = "withdrawOneItems",
name = "Items",
description = "",
position = 1,
group = "Banking",
hidden = true,
unhide = "withdrawOne"
)
default String getWithdrawOneItems()
{
return "";
}
@ConfigItem(
keyName = "withdrawFive",
name = "Withdraw/Deposit Five",
description = "",
position = 2,
group = "Banking"
)
default boolean getWithdrawFive()
{
return false;
}
@ConfigItem(
keyName = "withdrawFiveItems",
name = "Items",
description = "",
position = 3,
group = "Banking",
hidden = true,
unhide = "withdrawFive"
)
default String getWithdrawFiveItems()
{
return "";
}
@ConfigItem(
keyName = "withdrawTen",
name = "Withdraw/Deposit Ten",
description = "",
position = 4,
group = "Banking"
)
default boolean getWithdrawTen()
{
return false;
}
@ConfigItem(
keyName = "withdrawTenItems",
name = "Items",
description = "",
position = 5,
group = "Banking",
hidden = true,
unhide = "withdrawTen"
)
default String getWithdrawTenItems()
{
return "";
}
@ConfigItem(
keyName = "withdrawX",
name = "Withdraw/Deposit X",
description = "",
position = 6,
group = "Banking"
)
default boolean getWithdrawX()
{
return false;
}
@ConfigItem(
keyName = "withdrawXAmount",
name = "Amount",
description = "",
position = 7,
group = "Banking",
hidden = true,
unhide = "withdrawX"
)
default String getWithdrawXAmount()
{
return "";
}
@ConfigItem(
keyName = "withdrawXItems",
name = "Items",
description = "",
position = 8,
group = "Banking",
hidden = true,
unhide = "withdrawX"
)
default String getWithdrawXItems()
{
return "";
}
@ConfigItem(
keyName = "withdrawAll",
name = "Withdraw/Deposit All",
description = "",
position = 9,
group = "Banking"
)
default boolean getWithdrawAll()
{
return false;
}
@ConfigItem(
keyName = "withdrawAllItems",
name = "Items",
description = "",
position = 10,
group = "Banking",
hidden = true,
unhide = "withdrawAll"
)
default String getWithdrawAllItems()
{
return "";
}
// ----------------------------------------------------------- //
@ConfigItem(
keyName = "removeObjects",
name = "Remove Objects",
description = "Removes interaction with the listed objects.",
position = 12,
group = "Miscellaneous easyscape"
)
default boolean getRemoveObjects()
{
return false;
}
@ConfigItem(
keyName = "removedObjects",
name = "Objects",
description = "Objects listed here will have all interaction be removed.",
position = 13,
group = "Miscellaneous easyscape",
hidden = true,
unhide = "removeObjects"
)
default String getRemovedObjects()
{
return "";
}
// ----------------------------------------------------------- //
@ConfigItem(
keyName = "swapBuyOne",
name = "Swappable Buy One",
description = "",
position = 14,
group = "Shop / stores"
)
default boolean getSwapBuyOne()
{
return false;
}
@ConfigItem(
keyName = "buyOneItems",
name = "Items",
description = "",
position = 15,
group = "Shop / stores",
hidden = true,
unhide = "swapBuyOne"
)
default String getBuyOneItems()
{
return "";
}
@ConfigItem(
keyName = "swapBuyFive",
name = "Swappable Buy Five",
description = "",
position = 16,
group = "Shop / stores"
)
default boolean getSwapBuyFive()
{
return false;
}
@ConfigItem(
keyName = "buyFiveItems",
name = "Items",
description = "",
position = 17,
group = "Shop / stores",
hidden = true,
unhide = "swapBuyFive"
)
default String getBuyFiveItems()
{
return "";
}
@ConfigItem(
keyName = "swapBuyTen",
name = "Swappable Buy Ten",
description = "",
position = 18,
group = "Shop / stores"
)
default boolean getSwapBuyTen()
{
return false;
}
@ConfigItem(
keyName = "buyTenItems",
name = "Items",
description = "",
position = 19,
group = "Shop / stores",
hidden = true,
unhide = "swapBuyTen"
)
default String getBuyTenItems()
{
return "";
}
@ConfigItem(
keyName = "swapBuyFifty",
name = "Swappable Buy Fifty",
description = "",
position = 20,
group = "Shop / stores"
)
default boolean getSwapBuyFifty()
{
return false;
}
@ConfigItem(
keyName = "buyFiftyItems",
name = "Items",
description = "",
position = 21,
group = "Shop / stores",
hidden = true,
unhide = "swapBuyFifty"
)
default String getBuyFiftyItems()
{
return "";
}
@ConfigItem(
keyName = "swapSellOne",
name = "Swappable Sell One",
description = "",
position = 22,
group = "Shop / stores"
)
default boolean getSwapSellOne()
{
return false;
}
@ConfigItem(
keyName = "sellOneItems",
name = "Items",
description = "",
position = 23,
group = "Shop / stores",
hidden = true,
unhide = "swapSellOne"
)
default String getSellOneItems()
{
return "";
}
@ConfigItem(
keyName = "swapSellFive",
name = "Swappable Sell Five",
description = "",
position = 24,
group = "Shop / stores"
)
default boolean getSwapSellFive()
{
return false;
}
@ConfigItem(
keyName = "sellFiveItems",
name = "Items",
description = "",
position = 25,
group = "Shop / stores",
hidden = true,
unhide = "swapSellFive"
)
default String getSellFiveItems()
{
return "";
}
@ConfigItem(
keyName = "swapSellTen",
name = "Swappable Sell Ten",
description = "",
position = 26,
group = "Shop / stores"
)
default boolean getSwapSellTen()
{
return false;
}
@ConfigItem(
keyName = "sellTenItems",
name = "Items",
description = "",
position = 27,
group = "Shop / stores",
hidden = true,
unhide = "swapSellTen"
)
default String getSellTenItems()
{
return "";
}
@ConfigItem(
keyName = "swapSellFifty",
name = "Swappable Sell Fifty",
description = "",
position = 28,
group = "Shop / stores"
)
default boolean getSwapSellFifty()
{
return false;
}
@ConfigItem(
keyName = "sellFiftyItems",
name = "Items",
description = "",
position = 29,
group = "Shop / stores",
hidden = true,
unhide = "swapSellFifty"
)
default String getSellFiftyItems()
{
return "";
}
// ----------------------------------------------------------- //
@ConfigItem(
keyName = "easyConstruction",
name = "Easy Construction",
description = "Makes \"Remove\"/\"Build\" the default option for listed item ID's in build mode.<br>Tip: Use dev tools \"Game Objects\" to find out the ID!",
position = 30,
group = "Miscellaneous swapper"
)
default boolean getEasyConstruction()
{
return false;
}
@ConfigItem(
keyName = "constructionItems",
name = "Construction Items",
description = "Makes \"Remove\"/\"Build\" the default option for listed item ID's in build mode.<br>Tip: Use dev tools \"Game Objects\" to find out the ID, and seperate values with a ','",
position = 31,
group = "Miscellaneous swapper",
hidden = true,
unhide = "easyConstruction"
)
default String getConstructionItems()
{
return "";
}
@ConfigItem(
keyName = "swapSmithing",
name = "Swap Smithing",
description = "Enables swapping of smith-1 and smith-all options.",
position = 32,
group = "Miscellaneous swapper"
)
default boolean getSwapSmithing()
{
return false;
}
@ConfigItem(
keyName = "swapTanning",
name = "Swap Tanning",
description = "Enables swapping of tan-1 and tan-all options.",
position = 33,
group = "Miscellaneous swapper"
)
default boolean getSwapTanning()
{
return false;
}
@ConfigItem(
keyName = "swapSawmill",
name = "Swap Sawmill Operator",
description = "Makes Buy-plank the default option on the sawmill operator.",
position = 34,
group = "Miscellaneous swapper"
)
default boolean getSwapSawmill()
{
return false;
}
@ConfigItem(
keyName = "swapSawmillPlanks",
name = "Swap Buy Planks",
description = "Makes Buy All the default option in buy planks.",
position = 35,
group = "Miscellaneous swapper"
)
default boolean getSwapSawmillPlanks()
{
return false;
}
@ConfigItem(
keyName = "swapPuroPuro",
name = "Swap Puro Puro Wheat",
description = "",
position = 36,
group = "Miscellaneous swapper"
)
default boolean getSwapPuro()
{
return false;
}
// ----------------------------------------------------------- //
@ConfigItem(
keyName = "swapGamesNecklace",
name = "Swap Games Necklace",
description = "",
position = 37,
group = "Jewellery swapper"
)
default boolean getGamesNecklace()
{
return false;
}
@ConfigItem(
keyName = "gamesNecklaceMode",
name = "Mode",
description = "",
position = 38,
group = "Jewellery swapper",
hidden = true,
unhide = "swapGamesNecklace"
)
default GamesNecklaceMode getGamesNecklaceMode()
{
return GamesNecklaceMode.BURTHORPE;
}
@ConfigItem(
keyName = "swapDuelingRing",
name = "Swap Dueling Ring",
description = "",
position = 39,
group = "Jewellery swapper"
)
default boolean getDuelingRing()
{
return false;
}
@ConfigItem(
keyName = "duelingRingMode",
name = "Mode",
description = "",
position = 40,
group = "Jewellery swapper",
hidden = true,
unhide = "swapDuelingRing"
)
default DuelingRingMode getDuelingRingMode()
{
return DuelingRingMode.DUEL_ARENA;
}
@ConfigItem(
keyName = "swapGlory",
name = "Swap Glory",
description = "",
position = 41,
group = "Jewellery swapper"
)
default boolean getGlory()
{
return false;
}
@ConfigItem(
keyName = "gloryMode",
name = "Mode",
description = "",
position = 42,
group = "Jewellery swapper",
hidden = true,
unhide = "swapGlory"
)
default GloryMode getGloryMode()
{
return GloryMode.EDGEVILLE;
}
@ConfigItem(
keyName = "swapSkill",
name = "Swap Skill",
description = "",
position = 43,
group = "Jewellery swapper"
)
default boolean getSkillsNecklace()
{
return false;
}
@ConfigItem(
keyName = "skillsnecklacemode",
name = "Mode",
description = "",
position = 44,
group = "Jewellery swapper",
hidden = true,
unhide = "swapSkill"
)
default SkillsNecklaceMode getSkillsNecklaceMode()
{
return SkillsNecklaceMode.FARMING_GUILD;
}
@ConfigItem(
keyName = "swapPassage",
name = "Swap Passage",
description = "",
position = 45,
group = "Jewellery swapper"
)
default boolean getNecklaceofPassage()
{
return false;
}
@ConfigItem(
keyName = "necklaceofpassagemode",
name = "Mode",
description = "",
position = 46,
group = "Jewellery swapper",
hidden = true,
unhide = "swapPassage"
)
default NecklaceOfPassageMode getNecklaceofPassageMode()
{
return NecklaceOfPassageMode.WIZARDS_TOWER;
}
@ConfigItem(
keyName = "swapDigsite",
name = "Swap Digsite",
description = "",
position = 47,
group = "Jewellery swapper"
)
default boolean getDigsitePendant()
{
return false;
}
@ConfigItem(
keyName = "digsitependantmode",
name = "Mode",
description = "",
position = 48,
group = "Jewellery swapper",
hidden = true,
unhide = "swapDigsite"
)
default DigsitePendantMode getDigsitePendantMode()
{
return DigsitePendantMode.FOSSIL_ISLAND;
}
@ConfigItem(
keyName = "swapCombat",
name = "Swap Combat",
description = "",
position = 49,
group = "Jewellery swapper"
)
default boolean getCombatBracelet()
{
return false;
}
@ConfigItem(
keyName = "combatbraceletmode",
name = "Mode",
description = "",
position = 50,
group = "Jewellery swapper",
hidden = true,
unhide = "swapCombat"
)
default CombatBraceletMode getCombatBraceletMode()
{
return CombatBraceletMode.WARRIORS_GUILD;
}
@ConfigItem(
keyName = "swapslayer",
name = "Swap slayer",
description = "",
position = 51,
group = "Jewellery swapper"
)
default boolean getSlayerRing()
{
return false;
}
@ConfigItem(
keyName = "slayerringmode",
name = "Mode",
description = "",
position = 52,
group = "Jewellery swapper",
hidden = true,
unhide = "swapslayer"
)
default SlayerRingMode getSlayerRingMode()
{
return SlayerRingMode.CHECK;
}
@ConfigItem(
keyName = "swapburning",
name = "Swap burning",
description = "",
position = 53,
group = "Jewellery swapper"
)
default boolean getBurningAmulet()
{
return false;
}
@ConfigItem(
keyName = "burningamuletmode",
name = "Mode",
description = "",
position = 54,
group = "Jewellery swapper",
hidden = true,
unhide = "swapburning"
)
default BurningAmuletMode getBurningAmuletMode()
{
return BurningAmuletMode.BANDIT_CAMP;
}
@ConfigItem(
keyName = "swapxeric",
name = "Swap xeric",
description = "",
position = 55,
group = "Jewellery swapper"
)
default boolean getXericsTalisman()
{
return false;
}
@ConfigItem(
keyName = "xericstalismanmode",
name = "Mode",
description = "",
position = 56,
group = "Jewellery swapper",
hidden = true,
unhide = "swapxeric"
)
default XericsTalismanMode getXericsTalismanMode()
{
return XericsTalismanMode.XERICS_LOOKOUT;
}
@ConfigItem(
keyName = "swapwealth",
name = "Swap wealth",
description = "",
position = 57,
group = "Jewellery swapper"
)
default boolean getRingofWealth()
{
return false;
}
@ConfigItem(
keyName = "ringofwealthmode",
name = "Mode",
description = "",
position = 58,
group = "Jewellery swapper",
hidden = true,
unhide = "swapwealth"
)
default RingOfWealthMode getRingofWealthMode()
{
return RingOfWealthMode.GRAND_EXCHANGE;
}
// ----------------------------------------------------------- //
@ConfigItem(
keyName = "swapMax",
name = "Swap max cape",
description = "Enables swapping max cape options in worn interface",
position = 59,
group = "Equipment swapper"
)
default boolean swapMax()
{
return false;
}
@ConfigItem(
keyName = "maxMode",
name = "Max cape mode",
description = "",
position = 60,
group = "Equipment swapper"
)
default MaxCapeMode maxMode()
{
return MaxCapeMode.CRAFTING_GUILD;
}
@ConfigItem(
keyName = "swapArdougneCape",
name = "Swap Ardougne Cape",
description = "Enables swapping of teleport and wear.",
position = 59,
group = "Equipment swapper"
)
default boolean getSwapArdougneCape()
{
return false;
}
@ConfigItem(
keyName = "swapConstructionCape",
name = "Swap Construction Cape",
description = "Enables swapping of teleport and wear.",
position = 60,
group = "Equipment swapper"
)
default boolean getSwapConstructionCape()
{
return true;
}
@ConfigItem(
keyName = "swapCraftingCape",
name = "Swap Crafting Cape",
description = "Enables swapping of teleport and wear.",
position = 61,
group = "Equipment swapper"
)
default boolean getSwapCraftingCape()
{
return true;
}
@ConfigItem(
keyName = "swapMagicCape",
name = "Swap Magic Cape",
description = "Enables swapping of spellbook and wear.",
position = 62,
group = "Equipment swapper"
)
default boolean getSwapMagicCape()
{
return true;
}
@ConfigItem(
keyName = "swapExplorersRing",
name = "Swap Explorers Ring",
description = "Enables swapping of spellbook and wear.",
position = 63,
group = "Equipment swapper"
)
default boolean getSwapExplorersRing()
{
return true;
}
}

View File

@@ -1,549 +0,0 @@
/*
* Copyright (c) 2018, Alan Baumgartner <https://github.com/alanbaumgartner>
* Copyright (c) 2018, https://runelitepl.us
* Copyright (c) 2018, Kyle <https://github.com/kyleeld>
* Copyright (c) 2018, Owain van Brakel <https://github.com/Owain94>
* 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.easyscape;
import com.google.common.base.Strings;
import com.google.inject.Provides;
import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.MenuAction;
import static net.runelite.api.MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET;
import static net.runelite.api.MenuAction.WALK;
import net.runelite.api.MenuEntry;
import net.runelite.api.Player;
import static net.runelite.api.Varbits.BUILDING_MODE;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ConfigChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.MenuEntryAdded;
import net.runelite.api.events.VarbitChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.menus.MenuManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import static net.runelite.client.util.MenuUtil.swap;
import net.runelite.client.util.Text;
import org.apache.commons.lang3.ArrayUtils;
@PluginDescriptor(
name = "Easyscape",
type = PluginType.UTILITY
)
public class EasyscapePlugin extends Plugin
{
private static final int PURO_PURO_REGION_ID = 10307;
private MenuEntry[] entries;
private final Set<Integer> leftClickConstructionIDs = new HashSet<>();
private boolean buildingMode;
@Inject
private Client client;
@Inject
private EasyscapeConfig config;
@Inject
private MenuManager menuManager;
@Provides
EasyscapeConfig provideConfig(ConfigManager configManager)
{
return configManager.getConfig(EasyscapeConfig.class);
}
@Override
public void startUp()
{
addSwaps();
loadConstructionIDs(config.getConstructionItems());
}
@Override
public void shutDown()
{
removeSwaps();
loadConstructionIDs("");
}
@Subscribe
public void onGameStateChanged(GameStateChanged event)
{
if (client.getGameState() != GameState.LOGGED_IN)
{
return;
}
loadConstructionIDs(config.getConstructionItems());
}
@Subscribe
public void onVarbitChanged(VarbitChanged event)
{
buildingMode = client.getVar(BUILDING_MODE) == 1;
}
@Subscribe
public void onMenuEntryAdded(MenuEntryAdded event)
{
if (client.getGameState() != GameState.LOGGED_IN)
{
return;
}
final String option = Text.standardize(event.getOption());
final String target = Text.standardize(event.getTarget());
entries = client.getMenuEntries();
if (option.contains("withdraw") || option.contains("deposit"))
{
if (config.getWithdrawOne())
{
for (String item : Text.fromCSV(config.getWithdrawOneItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Withdraw-1", option, target);
swap(client, "Deposit-1", option, target);
}
}
}
if (config.getWithdrawFive())
{
for (String item : Text.fromCSV(config.getWithdrawFiveItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Withdraw-5", option, target);
swap(client, "Deposit-5", option, target);
}
}
}
if (config.getWithdrawTen())
{
for (String item : Text.fromCSV(config.getWithdrawTenItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Withdraw-10", option, target);
swap(client, "Deposit-10", option, target);
}
}
}
if (config.getWithdrawX())
{
for (String item : Text.fromCSV(config.getWithdrawXItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Withdraw-" + config.getWithdrawXAmount(), option, target);
swap(client, "Deposit-" + config.getWithdrawXAmount(), option, target);
}
}
}
if (config.getWithdrawAll())
{
for (String item : Text.fromCSV(config.getWithdrawAllItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Withdraw-All", option, target);
swap(client, "Deposit-All", option, target);
}
}
}
}
if (option.contains("buy"))
{
if (config.getSwapBuyOne() && !config.getBuyOneItems().equals(""))
{
for (String item : Text.fromCSV(config.getBuyOneItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Buy 1", option, target);
}
}
}
if (config.getSwapBuyFive() && !config.getBuyFiveItems().equals(""))
{
for (String item : Text.fromCSV(config.getBuyFiveItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Buy 5", option, target);
}
}
}
if (config.getSwapBuyTen() && !config.getBuyTenItems().equals(""))
{
for (String item : Text.fromCSV(config.getBuyTenItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Buy 10", option, target);
}
}
}
if (config.getSwapBuyFifty() && !config.getBuyFiftyItems().equals(""))
{
for (String item : Text.fromCSV(config.getBuyFiftyItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Buy 50", option, target);
}
}
}
}
else if (option.contains("sell"))
{
if (config.getSwapSellOne() && !config.getSellOneItems().equals(""))
{
for (String item : Text.fromCSV(config.getSellOneItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Sell 1", option, target);
}
}
}
if (config.getSwapSellFive() && !Strings.isNullOrEmpty(config.getSellFiveItems()))
{
for (String item : Text.fromCSV(config.getSellFiveItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Sell 5", option, target);
}
}
}
if (config.getSwapSellTen() && !Strings.isNullOrEmpty(config.getSellTenItems()))
{
for (String item : Text.fromCSV(config.getSellTenItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Sell 10", option, target);
}
}
}
if (config.getSwapSellFifty() && !Strings.isNullOrEmpty(config.getSellFiftyItems()))
{
for (String item : Text.fromCSV(config.getSellFiftyItems()))
{
if (target.equals(Text.standardize(item)))
{
swap(client, "Sell 50", option, target);
}
}
}
}
if (config.getRemoveObjects() && !config.getRemovedObjects().equals(""))
{
for (String removed : Text.fromCSV(config.getRemovedObjects()))
{
removed = Text.standardize(removed);
if (target.contains("(") && target.split(" \\(")[0].equals(removed))
{
delete(event.getIdentifier());
}
else if (target.contains("->"))
{
String trimmed = target.split("->")[1].trim();
if (trimmed.length() >= removed.length() && trimmed.substring(0, removed.length()).equalsIgnoreCase(removed))
{
delete(event.getIdentifier());
break;
}
}
else if (target.length() >= removed.length() && target.substring(0, removed.length()).equalsIgnoreCase(removed))
{
delete(event.getIdentifier());
break;
}
}
}
if (config.getSwapPuro() && isPuroPuro())
{
if (event.getType() == WALK.getId())
{
MenuEntry menuEntry = entries[entries.length - 1];
menuEntry.setType(MenuAction.WALK.getId() + MENU_ACTION_DEPRIORITIZE_OFFSET);
}
else if (option.equalsIgnoreCase("examine"))
{
swap(client, "push-through", option, target);
}
else if (option.equalsIgnoreCase("use"))
{
swap(client, "escape", option, target);
}
}
else if (config.getSwapSmithing() && option.contains("smith"))
{
if (option.equalsIgnoreCase("Smith 1"))
{
swap(client, "Smith All", option, target);
}
else if (option.equalsIgnoreCase("Smith 1 Set"))
{
swap(client, "Smith All Sets", option, target);
}
}
else if (config.getSwapTanning() && option.equalsIgnoreCase("Tan 1"))
{
swap(client, "Tan All", option, target);
}
else if (config.getSwapSawmill() && target.equalsIgnoreCase("Sawmill operator"))
{
swap(client, "Buy-plank", option, target);
}
else if (config.getSwapSawmillPlanks() && option.equalsIgnoreCase("Buy 1"))
{
swap(client, "Buy All", option, target);
}
else if (option.equalsIgnoreCase("Clear-All") && target.equalsIgnoreCase("Bank Filler"))
{
swap(client, "Clear", option, target);
}
else if (target.contains("ardougne cloak") && config.getSwapArdougneCape())
{
swap(client, "Kandarin Monastery", option, target);
swap(client, "Monastery Teleport", option, target);
}
else if (target.contains("crafting cape") && config.getSwapCraftingCape())
{
swap(client, "Teleport", option, target);
}
else if (target.contains("construct. cape") && config.getSwapConstructionCape())
{
swap(client, "Tele to poh", option, target);
}
else if (target.contains("magic cape") && config.getSwapMagicCape())
{
swap(client, "Spellbook", option, target);
}
else if (target.contains("explorer's ring") && config.getSwapExplorersRing())
{
swap(client, "Teleport", option, target);
}
}
@Subscribe
public void onConfigChanged(ConfigChanged event)
{
if (!"easyscape".equals(event.getGroup()))
{
return;
}
loadConstructionIDs(config.getConstructionItems());
removeSwaps();
addSwaps();
}
private void addSwaps()
{
if (config.getBurningAmulet())
{
menuManager.addSwap("remove", "burning amulet", config.getBurningAmuletMode().toString());
}
if (config.getCombatBracelet())
{
menuManager.addSwap("remove", "combat bracelet", config.getCombatBraceletMode().toString());
}
if (config.getGamesNecklace())
{
menuManager.addSwap("remove", "games necklace", config.getGamesNecklaceMode().toString());
}
if (config.getDuelingRing())
{
menuManager.addSwap("remove", "ring of dueling", config.getDuelingRingMode().toString());
}
if (config.getGlory())
{
menuManager.addSwap("remove", "amulet of glory", config.getGloryMode().toString());
menuManager.addSwap("remove", "amulet of eternal glory", config.getGloryMode().toString());
}
if (config.getSkillsNecklace())
{
menuManager.addSwap("remove", "skills necklace", config.getSkillsNecklaceMode().toString());
}
if (config.getNecklaceofPassage())
{
menuManager.addSwap("remove", "necklace of passage", config.getNecklaceofPassageMode().toString());
}
if (config.getDigsitePendant())
{
menuManager.addSwap("remove", "digsite pendant", config.getDigsitePendantMode().toString());
}
if (config.getSlayerRing())
{
menuManager.addSwap("remove", "slayer ring", config.getSlayerRingMode().toString());
}
if (config.getXericsTalisman())
{
menuManager.addSwap("remove", "xeric's talisman", config.getXericsTalismanMode().toString());
}
if (config.getRingofWealth())
{
menuManager.addSwap("remove", "ring of wealth", config.getRingofWealthMode().toString());
}
if (config.swapMax())
{
menuManager.addSwap("remove", "max cape", config.maxMode().toString());
}
}
private void removeSwaps()
{
menuManager.removeSwaps("burning amulet");
menuManager.removeSwaps("combat bracelet");
menuManager.removeSwaps("games necklace");
menuManager.removeSwaps("ring of dueling");
menuManager.removeSwaps("amulet of glory");
menuManager.removeSwaps("amulet of eternal glory");
menuManager.removeSwaps("skills necklace");
menuManager.removeSwaps("necklace of passage");
menuManager.removeSwaps("digsite pendant");
menuManager.removeSwaps("slayer ring");
menuManager.removeSwaps("xeric's talisman");
menuManager.removeSwaps("ring of wealth");
}
private void delete(int target)
{
for (int i = entries.length - 1; i >= 0; i--)
{
if (entries[i].getIdentifier() == target)
{
entries = ArrayUtils.remove(entries, i);
i--;
}
}
client.setMenuEntries(entries);
}
private boolean isPuroPuro()
{
Player player = client.getLocalPlayer();
if (player == null)
{
return false;
}
else
{
WorldPoint location = player.getWorldLocation();
return location.getRegionID() == PURO_PURO_REGION_ID;
}
}
private void loadConstructionIDs(String from)
{
if (client.getGameState() != GameState.LOGGED_IN
|| Strings.isNullOrEmpty(from) && leftClickConstructionIDs.isEmpty())
{
return;
}
if (!leftClickConstructionIDs.isEmpty())
{
for (int i : leftClickConstructionIDs)
{
menuManager.toggleLeftClick("build", i, true);
menuManager.toggleLeftClick("remove", i, true);
}
leftClickConstructionIDs.clear();
}
if (config.getEasyConstruction() &&
!Strings.isNullOrEmpty(from) &&
buildingMode)
{
for (String s : Text.fromCSV(from))
{
int id = Integer.parseInt(s.replaceAll("[^0-9]", ""));
if (leftClickConstructionIDs.contains(id))
{
continue;
}
if (menuManager.toggleLeftClick("build", id, false)
|| menuManager.toggleLeftClick("remove", id, false))
{
leftClickConstructionIDs.add(id);
}
}
}
}
}

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum BurningAmuletMode
{

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum CombatBraceletMode
{

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum DigsitePendantMode
{

View File

@@ -22,7 +22,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum DuelingRingMode
{

View File

@@ -22,7 +22,7 @@
* (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.menuentryswapper;
package net.runelite.client.plugins.menuentryswapper.util;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View File

@@ -22,7 +22,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum GamesNecklaceMode
{
@@ -30,7 +30,7 @@ public enum GamesNecklaceMode
BARBARIAN_OUTPOST("Barbarian Outpost"),
CORPOREAL_BEAST("Corporeal Beast"),
TEARS_OF_GUTHIX("Tears of Guthix"),
WINTERTODT("Wintertodt Camp");
WINTER("Wintertodt Camp");
private final String name;

View File

@@ -22,7 +22,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum GloryMode
{

View File

@@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.menuentryswapper;
package net.runelite.client.plugins.menuentryswapper.util;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View File

@@ -1,4 +1,4 @@
package net.runelite.client.plugins.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum MaxCapeMode
{

View File

@@ -23,13 +23,13 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum NecklaceOfPassageMode
{
WIZARDS_TOWER("Wizard's Tower"),
WIZARDS_TOWER("Wizards' Tower"),
THE_OUTPOST("The Outpost"),
EAGLES_EYRIE("Eagle's Eyrie");
EAGLES_EYRIE("Eagles' Eyrie");
private final String name;

View File

@@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.menuentryswapper;
package net.runelite.client.plugins.menuentryswapper.util;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View File

@@ -22,7 +22,7 @@
* (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.menuentryswapper;
package net.runelite.client.plugins.menuentryswapper.util;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum RingOfWealthMode
{

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum SkillsNecklaceMode
{

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum SlayerRingMode
{

View File

@@ -23,7 +23,7 @@
* (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.easyscape.util;
package net.runelite.client.plugins.menuentryswapper.util;
public enum XericsTalismanMode
{