powerskiller: addition of get 1 drop 1 functionality for tick manipulation

This commit is contained in:
illumineawake 2020-07-27 19:26:15 +10:00
parent 9bd45747c9
commit dd3898f8f9
10 changed files with 57 additions and 34 deletions

View File

@ -25,7 +25,7 @@ import ProjectVersions.openosrsVersion
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "2.9.9"
version = "3.0.0"
project.extra["PluginName"] = "BotUtils"
project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation"

View File

@ -853,26 +853,6 @@ public class BotUtils extends Plugin
return null;
}
public List<WidgetItem> getItems(List<Integer> ids)
{
Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
List<WidgetItem> matchedItems = new ArrayList<>();
if (inventoryWidget != null)
{
Collection<WidgetItem> items = inventoryWidget.getWidgetItems();
for (WidgetItem item : items)
{
if (ids.contains(item.getId()))
{
matchedItems.add(item);
}
}
return matchedItems;
}
return null;
}
public Collection<WidgetItem> getAllInventoryItems()
{
Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
@ -1095,7 +1075,7 @@ public class BotUtils extends Plugin
return false;
}
public void dropItems(Collection<Integer> ids, int minDelayBetween, int maxDelayBetween)
public void dropItems(Collection<Integer> ids, boolean dropAll, int minDelayBetween, int maxDelayBetween)
{
if (isBankOpen() || isDepositBoxOpen())
{
@ -1116,6 +1096,8 @@ public class BotUtils extends Plugin
sleep(minDelayBetween, maxDelayBetween);
targetMenu = new MenuEntry("", "", item.getId(), MenuOpcode.ITEM_DROP.getId(), item.getIndex(), 9764864, false);
clickRandomPointCenter(-100, 100);
if (!dropAll)
break;
}
}
iterating = false;
@ -1128,7 +1110,7 @@ public class BotUtils extends Plugin
});
}
public void dropAllExcept(Collection<Integer> ids, int minDelayBetween, int maxDelayBetween)
public void dropAllExcept(Collection<Integer> ids, boolean dropAll, int minDelayBetween, int maxDelayBetween)
{
if (isBankOpen() || isDepositBoxOpen())
{
@ -1151,6 +1133,8 @@ public class BotUtils extends Plugin
sleep(minDelayBetween, maxDelayBetween);
targetMenu = new MenuEntry("", "", item.getId(), MenuOpcode.ITEM_DROP.getId(), item.getIndex(), 9764864, false);
clickRandomPointCenter(-100, 100);
if (!dropAll)
break;
}
iterating = false;
}
@ -1162,7 +1146,7 @@ public class BotUtils extends Plugin
});
}
public void dropInventory(int minDelayBetween, int maxDelayBetween)
public void dropInventory(boolean dropAll, int minDelayBetween, int maxDelayBetween)
{
if (isBankOpen() || isDepositBoxOpen())
{
@ -1181,6 +1165,8 @@ public class BotUtils extends Plugin
sleep(minDelayBetween, maxDelayBetween);
targetMenu = new MenuEntry("", "", item.getId(), MenuOpcode.ITEM_DROP.getId(), item.getIndex(), 9764864, false);
clickRandomPointCenter(-100, 100);
if (!dropAll)
break;
}
iterating = false;
}

View File

@ -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-27","sha512sum":"CB5A59246DD62F39F36125A906809A4AAB3A46CABC0CFC66292859C9EB2D2C9EB164561D8126E8B08418459C41A6E5AECA28B4608C6FC3067FD362116A82B6D6","version":"2.9.9","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-2.9.9.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-27","sha512sum":"2F0F1289799517C95EA6A3DB6F3EA088F0AB9A560A286EF841AEB92D26A393E23242DED3068309CC2FEEFFDEFB3021F3EB4671BCF23669E224396903C07EB2D3","version":"1.0.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/combinationrunecrafter-1.0.3.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-27","sha512sum":"9552353CF2934BB960936994AC7D616B132FEB81B5E54DC180BE45A05DCF059347F3FD4E4FBB90EA1036E26AFD0911EEF30B011149525A14B37C64B60E23F5F9","version":"1.9.5","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/magicsplasher-1.9.5.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-27","sha512sum":"DD99AD1279045BDD56249371A24A7DA7FFEA1CC4AEC1E0F4F621DDC6922EA1F1861B7ABC42692A1D1092C4B120F3ABA7CA923E794D50566019C75DEA0506F342","version":"3.3.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/powerskiller-3.3.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-27","sha512sum":"A13C2B4EF80BD5E48D202566F6C1E44E41C2540D315F6CE3372AF09024975427C4F2615A3B437CC5A57F438919E2969264E796DF7391978CFED3EB6874D2BE4E","version":"1.9.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/quickeater-1.9.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-27","sha512sum":"8AFF7C91326684F1D06E79CD3A56163EE2DB748CACDA0CBC80B64BB4E75105DA506C9EA7ADBAEA94789302A76E29F0B4765B4A8824DF4BB97E8799486762EEA5","version":"2.7.6","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/rooftopagility-2.7.6.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-27","sha512sum":"11B62D7C45836DC10CB66E1100AAA0183A22D2C07E73E56D70C08389B9BA80B1C87C7D305931FFFECFFD1CE5657B559152105DBC91C208807EACEDE869A0030D","version":"3.0.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-3.0.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-27","sha512sum":"2F0F1289799517C95EA6A3DB6F3EA088F0AB9A560A286EF841AEB92D26A393E23242DED3068309CC2FEEFFDEFB3021F3EB4671BCF23669E224396903C07EB2D3","version":"1.0.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/combinationrunecrafter-1.0.3.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-27","sha512sum":"9552353CF2934BB960936994AC7D616B132FEB81B5E54DC180BE45A05DCF059347F3FD4E4FBB90EA1036E26AFD0911EEF30B011149525A14B37C64B60E23F5F9","version":"1.9.5","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/magicsplasher-1.9.5.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-27","sha512sum":"699582FD9FFEC687CBE6C94C719D5DE6F95B85172FF77EF268D63DC0752992248E3A01C01E63C30589F5318948334B6055A3687E1C6DB6FDD54ECD27D7E650D2","version":"3.4.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/powerskiller-3.4.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-27","sha512sum":"A13C2B4EF80BD5E48D202566F6C1E44E41C2540D315F6CE3372AF09024975427C4F2615A3B437CC5A57F438919E2969264E796DF7391978CFED3EB6874D2BE4E","version":"1.9.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/quickeater-1.9.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-27","sha512sum":"8AFF7C91326684F1D06E79CD3A56163EE2DB748CACDA0CBC80B64BB4E75105DA506C9EA7ADBAEA94789302A76E29F0B4765B4A8824DF4BB97E8799486762EEA5","version":"2.7.6","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/rooftopagility-2.7.6.jar?raw=true","requires":"0.0.1"}]}]

View File

@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "3.3.0"
version = "3.4.0"
project.extra["PluginName"] = "Power Skiller"
project.extra["PluginDescription"] = "Illumine auto power skiller plugin"

View File

@ -330,6 +330,17 @@ public interface PowerSkillerConfiguration extends Config
return true;
}
@ConfigItem(
keyName = "dropOne",
name = "Get 1 Drop 1",
description = "Tick manipulation",
position = 121
)
default boolean dropOne()
{
return false;
}
@Range(
min = 1,
max = 60

View File

@ -45,11 +45,8 @@ import net.runelite.api.MenuOpcode;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldArea;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ConfigButtonClicked;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.GameObjectDespawned;
import net.runelite.api.events.MenuOptionClicked;
import net.runelite.api.events.NpcDefinitionChanged;
import net.runelite.api.events.*;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
@ -423,13 +420,13 @@ public class PowerSkillerPlugin extends Plugin
timeout--;
return;
case DROP_ALL:
utils.dropInventory(config.sleepMin(), config.sleepMax());
utils.dropInventory(true,config.sleepMin(), config.sleepMax());
return;
case DROP_EXCEPT:
utils.dropAllExcept(itemIds, config.sleepMin(), config.sleepMax());
utils.dropAllExcept(itemIds, true, config.sleepMin(), config.sleepMax());
return;
case DROP_ITEMS:
utils.dropItems(itemIds, config.sleepMin(), config.sleepMax());
utils.dropItems(itemIds, true, config.sleepMin(), config.sleepMax());
return;
case FIND_GAME_OBJECT:
interactObject();
@ -524,4 +521,33 @@ public class PowerSkillerPlugin extends Plugin
npcMoved = true;
}
}
@Subscribe
private void onItemContainerChanged(ItemContainerChanged event)
{
if (event.getContainerId() != 93 || !startPowerSkiller || !config.dropOne())
{
return;
}
if (config.dropInventory())
{
utils.dropInventory(false, config.sleepMin(), config.sleepMax());
return;
}
if (config.dropExcept() && !config.dropInventory())
{
if (!itemIds.containsAll(requiredIds))
{
itemIds.addAll(requiredIds);
}
if (utils.inventoryContainsExcept(itemIds)) {
utils.dropAllExcept(itemIds, false, config.sleepMin(), config.sleepMax());
}
return;
}
if (utils.inventoryContains(itemIds))
{
utils.dropItems(itemIds, false, config.sleepMin(), config.sleepMax());
}
}
}

Binary file not shown.

BIN
release/botutils-3.0.0.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.