diff --git a/botutils/botutils.gradle.kts b/botutils/botutils.gradle.kts index 4b01df14..bb593f20 100644 --- a/botutils/botutils.gradle.kts +++ b/botutils/botutils.gradle.kts @@ -25,7 +25,7 @@ import ProjectVersions.openosrsVersion * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -version = "2.8.5" +version = "2.9.0" project.extra["PluginName"] = "BotUtils" project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation" diff --git a/botutils/src/main/java/net/runelite/client/plugins/botutils/BotUtils.java b/botutils/src/main/java/net/runelite/client/plugins/botutils/BotUtils.java index c74ecd7a..1e531b33 100644 --- a/botutils/src/main/java/net/runelite/client/plugins/botutils/BotUtils.java +++ b/botutils/src/main/java/net/runelite/client/plugins/botutils/BotUtils.java @@ -405,7 +405,7 @@ public class BotUtils extends Plugin } @Nullable - public GameObject findNearestBank(Collection bankIDs) + public GameObject findNearestBank() { assert client.isClientThread(); @@ -932,6 +932,30 @@ public class BotUtils extends Plugin return null; } + public MenuEntry getInventoryItemMenu(ItemManager itemManager, String menuOption, int opcode, Collection ignoreIDs) + { + Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY); + if (inventoryWidget != null) + { + Collection items = inventoryWidget.getWidgetItems(); + for (WidgetItem item : items) + { + if (ignoreIDs.contains(item.getId())) + continue; + String[] menuActions = itemManager.getItemDefinition(item.getId()).getInventoryActions(); + for (String action : menuActions) + { + if (action != null && action.equals(menuOption)) + { + MenuEntry menuEntry = new MenuEntry("", "", item.getId(), opcode, item.getIndex(), 9764864, false); + return menuEntry; + } + } + } + } + return null; + } + public WidgetItem getInventoryWidgetItemMenu(ItemManager itemManager, String menuOption, int opcode) { Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY); @@ -1392,6 +1416,40 @@ public class BotUtils extends Plugin clickRandomPointCenter(-100, 100); } + public void depositAllOfItems(Collection itemIDs) + { + if (!isBankOpen()) + { + return; + } + Collection inventoryItems = getAllInventoryItems(); + List depositedItems = new ArrayList<>(); + executorService.submit(() -> + { + try + { + iterating = true; + for (WidgetItem item : inventoryItems) + { + if (itemIDs.contains(item.getId()) && !depositedItems.contains(item.getId())) //6512 is empty widget slot + { + log.info("depositing item: " + item.getId()); + depositAllOfItem(item); + sleep(80, 170); + depositedItems.add(item.getId()); + } + } + iterating = false; + depositedItems.clear(); + } + catch (Exception e) + { + iterating = false; + e.printStackTrace(); + } + }); + } + public void withdrawAllItem(Widget bankItemWidget) { targetMenu = new MenuEntry("Withdraw-All", "", 1, MenuOpcode.CC_OP.getId(), bankItemWidget.getIndex(), 786444, false); diff --git a/plugins.json b/plugins.json index 3e3b7d22..b7d443ce 100644 --- a/plugins.json +++ b/plugins.json @@ -1 +1 @@ -[{"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"BotUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"botutils-plugin","releases":[{"date":"2020-07-22","sha512sum":"EC791D781F9EA056FE8B1B25E2905BB44F0D95371779800121CCDF61703EA55A395009D7D8B4D951D78443B9633E406E2EF8C60BE0D4E178D552F5781336508F","version":"2.8.5","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-2.8.5.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Combination Runecrafter Plugin","description":"Illumine - Combination Runecrafting plugin","id":"combinationrunecrafterplugin-plugin","releases":[{"date":"2020-07-22","sha512sum":"21A41E8B101F34BCF497A73325922142151C4B5A8987FB964ABD5BB89F7CCF0F74A7C5493B03C15DA49BAB57F3648DB7FE27B2919E6E16DE708A15EE01169657","version":"1.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/combinationrunecrafter-1.0.1.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Magic Splasher","description":"Illumine automated magic splasher","id":"magicsplasher-plugin","releases":[{"date":"2020-07-22","sha512sum":"7159B20AD740A3580E7DE5A518DE0E6394258C8185C91F346BD78F47DDE5CBB153A33754B7B9EAD7585FB4A1F98E1F759B4409057EE12EBD9431085621F337FF","version":"1.9.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/magicsplasher-1.9.3.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Power Skiller","description":"Illumine auto power skiller plugin","id":"powerskiller-plugin","releases":[{"date":"2020-07-22","sha512sum":"9E3A7C2CC590F7E36DD3B09CE7CEBC58171F1E729170D4E1D5A86A2690E50419708A306DFE1456740AD81C9816745C6397125D65D8B96C07BE8A6956921AF4F2","version":"2.9.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/powerskiller-2.9.3.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Quick Eater","description":"Illumine - auto eat food below configured HP","id":"quickeater-plugin","releases":[{"date":"2020-07-22","sha512sum":"299DAF1DB8EEB3F9A8E5033F2228788B3366F5718AD199E299789E51C49D6ACCF604FB07D347ED678D1D3CA2D7A63A4F4D3FA78A1054EBEB831AF4745E20B0F7","version":"1.7.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/quickeater-1.7.2.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Rooftop Agility","description":"Illumine automated rooftop agility plugin","id":"rooftopagility-plugin","releases":[{"date":"2020-07-22","sha512sum":"D3454D07E055B6115200D36ADB22202B30BB245080B674E0AB2CF365B40A3B2B207413367C1EEFC11C1B37FCD36494D609DD59B50776437300F5DD2E17A2FAF2","version":"2.6.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/rooftopagility-2.6.4.jar?raw=true","requires":"0.0.1"}]}] +[{"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"BotUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"botutils-plugin","releases":[{"date":"2020-07-22","sha512sum":"0ED1238294D1B46055A87EBC4BCEF29609A46D76AFD97B49CA1C90730DF82CF3B25C30BA40869D42675B9D3537A68918C3CC22C48DB9752A6DA344A38E8DAE4D","version":"2.9.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-2.9.0.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Combination Runecrafter Plugin","description":"Illumine - Combination Runecrafting plugin","id":"combinationrunecrafterplugin-plugin","releases":[{"date":"2020-07-22","sha512sum":"21A41E8B101F34BCF497A73325922142151C4B5A8987FB964ABD5BB89F7CCF0F74A7C5493B03C15DA49BAB57F3648DB7FE27B2919E6E16DE708A15EE01169657","version":"1.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/combinationrunecrafter-1.0.1.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Magic Splasher","description":"Illumine automated magic splasher","id":"magicsplasher-plugin","releases":[{"date":"2020-07-22","sha512sum":"7159B20AD740A3580E7DE5A518DE0E6394258C8185C91F346BD78F47DDE5CBB153A33754B7B9EAD7585FB4A1F98E1F759B4409057EE12EBD9431085621F337FF","version":"1.9.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/magicsplasher-1.9.3.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Power Skiller","description":"Illumine auto power skiller plugin","id":"powerskiller-plugin","releases":[{"date":"2020-07-22","sha512sum":"1C830D6EF55F2D43F317F6DB9632FB073E367D7DD1A166C918C198422634856D6200EC8986078290D573CD3DCA2AF194B78302491E40941E8814EEC8200B2246","version":"3.0.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/powerskiller-3.0.0.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Quick Eater","description":"Illumine - auto eat food below configured HP","id":"quickeater-plugin","releases":[{"date":"2020-07-22","sha512sum":"2EB0E288B76990E40A62D4A54901A4E563A83393CD08394267744E1E167375F38F2FAEDDB5FE73BE1128F2EDB913133DC481A737339AE4AADCC52C354FE8CF51","version":"1.8.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/quickeater-1.8.0.jar?raw=true","requires":"0.0.1"}]}, {"projectUrl":"https://discord.gg/YUHHsE","provider":"illumine","name":"Rooftop Agility","description":"Illumine automated rooftop agility plugin","id":"rooftopagility-plugin","releases":[{"date":"2020-07-22","sha512sum":"D3454D07E055B6115200D36ADB22202B30BB245080B674E0AB2CF365B40A3B2B207413367C1EEFC11C1B37FCD36494D609DD59B50776437300F5DD2E17A2FAF2","version":"2.6.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/rooftopagility-2.6.4.jar?raw=true","requires":"0.0.1"}]}] diff --git a/powerskiller/powerskiller.gradle.kts b/powerskiller/powerskiller.gradle.kts index 41a0211a..829c3825 100644 --- a/powerskiller/powerskiller.gradle.kts +++ b/powerskiller/powerskiller.gradle.kts @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -version = "2.9.3" +version = "3.0.0" project.extra["PluginName"] = "Power Skiller" project.extra["PluginDescription"] = "Illumine auto power skiller plugin" diff --git a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerConfiguration.java b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerConfiguration.java index ec001cea..a9d019db 100644 --- a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerConfiguration.java +++ b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerConfiguration.java @@ -271,9 +271,20 @@ public interface PowerSkillerConfiguration extends Config return ""; } + @ConfigItem( + keyName = "bankItems", + name = "Bank gathered items (Beta)", + description = "Enable to bank your items instead of drop", + position = 89 + ) + default boolean bankItems() + { + return false; + } + @ConfigItem( keyName = "dropInventory", - name = "Drop entire inventory", + name = "Drop/Bank entire inventory", description = "Enable to drop your entire inventory", position = 90 ) @@ -296,8 +307,8 @@ public interface PowerSkillerConfiguration extends Config @ConfigItem( keyName = "items", - name = "Item IDs to drop/not drop", - description = "Separate with comma, enable below option to not drop these IDs.", + name = "Item IDs to drop/not drop or Bank", + description = "Separate with comma, enable below option to not drop/bank these IDs.", position = 110, hide = "dropInventory" ) @@ -308,8 +319,8 @@ public interface PowerSkillerConfiguration extends Config @ConfigItem( keyName = "dropExcept", - name = "Drop all except above IDs", - description = "Enable to drop all items except the given IDs", + name = "Drop/Bank all except above IDs", + description = "Enable to drop/Bank all items except the given IDs", position = 120, hide = "dropInventory" ) diff --git a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerPlugin.java b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerPlugin.java index 83282064..6a03e0b4 100644 --- a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerPlugin.java +++ b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerPlugin.java @@ -257,6 +257,44 @@ public class PowerSkillerPlugin extends Plugin } } + private PowerSkillerState getBankState() + { + if (!utils.isBankOpen()) + { + return FIND_BANK; + } + if(config.dropInventory() && !utils.inventoryEmpty()) + { + return DEPOSIT_ALL; + } + if(config.dropExcept()) + { + return DEPOSIT_EXCEPT; + } + if(utils.inventoryContains(itemIds)) + { + return DEPOSIT_ITEMS; + } + return BANK_NOT_FOUND; + } + + private void openBank() + { + GameObject bank = utils.findNearestBank(); + if (bank != null) + { + targetMenu = new MenuEntry("", "", bank.getId(), + MenuOpcode.GAME_OBJECT_SECOND_OPTION.getId(), bank.getSceneMinLocation().getX(), + bank.getSceneMinLocation().getY(), false); + handleMouseClick(); + } + else + { + utils.sendGameMessage("Bank not found, stopping"); + startPowerSkiller = false; + } + } + public PowerSkillerState getState() { if (timeout > 0) @@ -271,8 +309,17 @@ public class PowerSkillerPlugin extends Plugin { return MISSING_ITEMS; } + if (utils.isMoving(beforeLoc)) + { + timeout = 2 + tickDelay(); + return MOVING; + } if (utils.inventoryFull()) { + if(config.bankItems()) + { + return getBankState(); + } if (config.dropInventory()) { return DROP_ALL; @@ -287,11 +334,6 @@ public class PowerSkillerPlugin extends Plugin } return (!utils.inventoryContains(itemIds)) ? INVALID_DROP_IDS : DROP_ITEMS; } - if (utils.isMoving(beforeLoc)) - { - timeout = 2 + tickDelay(); - return MOVING; - } if (client.getLocalPlayer().getAnimation() == -1 || npcMoved) { return (config.type() == PowerSkillerType.GAME_OBJECT) ? @@ -330,6 +372,18 @@ public class PowerSkillerPlugin extends Plugin interactNPC(); npcMoved = false; return; + case FIND_BANK: + openBank(); + break; + case DEPOSIT_ALL: + utils.depositAll(); + break; + case DEPOSIT_EXCEPT: + utils.depositAllExcept(requiredIds); + break; + case DEPOSIT_ITEMS: + utils.depositAllOfItems(itemIds); + break; case ANIMATING: timeout = tickDelay(); return; diff --git a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerState.java b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerState.java index d7d334d2..f31a8ef9 100644 --- a/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerState.java +++ b/powerskiller/src/main/java/net/runelite/client/plugins/powerskiller/PowerSkillerState.java @@ -3,9 +3,14 @@ package net.runelite.client.plugins.powerskiller; public enum PowerSkillerState { ANIMATING, + BANK_NOT_FOUND, + DEPOSIT_ALL, + DEPOSIT_EXCEPT, + DEPOSIT_ITEMS, DROP_ALL, DROP_EXCEPT, DROP_ITEMS, + FIND_BANK, FIND_GAME_OBJECT, FIND_NPC, INVALID_DROP_IDS, diff --git a/quickeater/quickeater.gradle.kts b/quickeater/quickeater.gradle.kts index ec069a59..ea43b099 100644 --- a/quickeater/quickeater.gradle.kts +++ b/quickeater/quickeater.gradle.kts @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -version = "1.7.2" +version = "1.8.0" project.extra["PluginName"] = "Quick Eater" project.extra["PluginDescription"] = "Illumine - auto eat food below configured HP" diff --git a/quickeater/src/main/java/net/runelite/client/plugins/quickeater/QuickEaterPlugin.java b/quickeater/src/main/java/net/runelite/client/plugins/quickeater/QuickEaterPlugin.java index 7ccb574d..3659bdea 100644 --- a/quickeater/src/main/java/net/runelite/client/plugins/quickeater/QuickEaterPlugin.java +++ b/quickeater/src/main/java/net/runelite/client/plugins/quickeater/QuickEaterPlugin.java @@ -26,15 +26,20 @@ package net.runelite.client.plugins.quickeater; import com.google.inject.Provides; +import java.util.List; +import java.util.Set; import javax.inject.Inject; import lombok.extern.slf4j.Slf4j; import net.runelite.api.Client; +import net.runelite.api.ItemID; import net.runelite.api.MenuEntry; +import net.runelite.api.MenuOpcode; import net.runelite.api.Skill; import net.runelite.api.TileObject; import net.runelite.api.events.HitsplatApplied; import net.runelite.api.events.MenuOptionClicked; import net.runelite.api.queries.GameObjectQuery; +import net.runelite.api.widgets.WidgetItem; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.game.ItemManager; @@ -52,7 +57,7 @@ import org.pf4j.Extension; name = "Quick Eater", enabledByDefault = false, description = "Illumine - auto eat food below configured HP", - tags = {"illumine","auto","bot","eat","food"}, + tags = {"illumine", "auto", "bot", "eat", "food"}, type = PluginType.UTILITY ) @Slf4j @@ -75,6 +80,9 @@ public class QuickEaterPlugin extends Plugin MenuEntry targetMenu; + private Set DRINK_SET = Set.of(ItemID.JUG_OF_WINE, ItemID.SARADOMIN_BREW1, ItemID.SARADOMIN_BREW2, + ItemID.SARADOMIN_BREW3, ItemID.SARADOMIN_BREW4); + @Provides QuickEaterConfiguration provideConfig(ConfigManager configManager) { @@ -101,16 +109,20 @@ public class QuickEaterPlugin extends Plugin { return; } - if (utils.getInventoryItemMenu(itemManager, "Eat", 33) != null) + if (utils.getInventoryItemMenu(itemManager, "Eat", 33, Set.of(ItemID.ROCK_CAKE)) != null) { targetMenu = utils.getInventoryItemMenu(itemManager, "Eat", 33); utils.clickRandomPointCenter(-100, 100); - TileObject tileObject = new GameObjectQuery().idEquals(12345).result(client).nearestTo(client.getLocalPlayer()); + return; } - else + if (utils.inventoryContains(DRINK_SET)) { - utils.sendGameMessage("Health is below theshold but we're out of food"); + WidgetItem item = utils.getInventoryWidgetItem(DRINK_SET); + targetMenu = new MenuEntry("", "", item.getId(), MenuOpcode.ITEM_FIRST_OPTION.getId(), item.getIndex(), 9764864, false); + utils.clickRandomPointCenter(-100, 100); + return; } + utils.sendGameMessage("Health is below theshold but we're out of food"); } @Subscribe diff --git a/release/botutils-2.8.5.jar b/release/botutils-2.8.5.jar deleted file mode 100644 index 56559559..00000000 Binary files a/release/botutils-2.8.5.jar and /dev/null differ diff --git a/release/botutils-2.9.0.jar b/release/botutils-2.9.0.jar new file mode 100644 index 00000000..764622ac Binary files /dev/null and b/release/botutils-2.9.0.jar differ diff --git a/release/powerskiller-2.9.3.jar b/release/powerskiller-2.9.3.jar deleted file mode 100644 index 360c122a..00000000 Binary files a/release/powerskiller-2.9.3.jar and /dev/null differ diff --git a/release/powerskiller-3.0.0.jar b/release/powerskiller-3.0.0.jar new file mode 100644 index 00000000..d76f9cb5 Binary files /dev/null and b/release/powerskiller-3.0.0.jar differ diff --git a/release/quickeater-1.7.2.jar b/release/quickeater-1.7.2.jar deleted file mode 100644 index 0b0df9f4..00000000 Binary files a/release/quickeater-1.7.2.jar and /dev/null differ diff --git a/release/quickeater-1.8.0.jar b/release/quickeater-1.8.0.jar new file mode 100644 index 00000000..db7b65af Binary files /dev/null and b/release/quickeater-1.8.0.jar differ