diff --git a/iutils/iutils.gradle.kts b/iutils/iutils.gradle.kts index 9c213515..5adbb3ff 100644 --- a/iutils/iutils.gradle.kts +++ b/iutils/iutils.gradle.kts @@ -23,7 +23,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -version = "4.3.7" +version = "4.3.8" project.extra["PluginName"] = "iUtils" project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation" diff --git a/iutils/src/main/java/net/runelite/client/plugins/iutils/api/Combat.java b/iutils/src/main/java/net/runelite/client/plugins/iutils/api/Combat.java index 68a76924..e56699ad 100644 --- a/iutils/src/main/java/net/runelite/client/plugins/iutils/api/Combat.java +++ b/iutils/src/main/java/net/runelite/client/plugins/iutils/api/Combat.java @@ -3,18 +3,22 @@ package net.runelite.client.plugins.iutils.api; import net.runelite.api.Skill; import net.runelite.client.plugins.iutils.game.Game; import net.runelite.client.plugins.iutils.game.iNPC; +import net.runelite.client.plugins.iutils.scene.Position; import net.runelite.client.plugins.iutils.ui.Prayer; +import net.runelite.client.plugins.iutils.walking.Walking; import javax.inject.Inject; public class Combat { private final Game game; private final Prayers prayers; + private final Walking walking; @Inject public Combat(Game game) { this.game = game; this.prayers = new Prayers(game); + this.walking = new Walking(game); } public void kill(iNPC npc, Prayer... prayers) { @@ -39,11 +43,35 @@ public class Combat { } } + public void kill(iNPC npc, Position safeSpot, Prayer... prayers) { + for (var prayer : prayers) { + this.prayers.setEnabled(prayer, true); + } + + npc.interact("Attack"); + + try { + while (game.npcs().withIndex(npc.index()).withAction("Attack").exists() && !game.npcs().withIndex(npc.index()).withAction("Attack").nearest().isDead()) { + if (game.localPlayer().position().distanceTo(safeSpot) > 0) { + walking.walkTo(safeSpot); + } + heal(); + restorePrayer(); + restoreStats(); + attack(npc); + game.tick(); + } + } finally { + for (var prayer : prayers) { + this.prayers.setEnabled(prayer, false); + } + } + } + public void attack(iNPC npc) { iNPC target = (iNPC) game.localPlayer().target(); - if (target == null || target.index() != npc.index()) { - if (game.localPlayer().target() != null) + if (target == null || target.index() != npc.index() && !target.isDead()) { npc.interact("Attack"); } } diff --git a/plugins.json b/plugins.json index 7df22a13..16181998 100644 --- a/plugins.json +++ b/plugins.json @@ -1 +1 @@ -[{"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"BotUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"botutils-plugin","releases":[{"date":"2021-08-09","sha512sum":"A71C4F1B739303A6B543B80D6F10826A780D86365A495F0FFD3D2EE8A49585C18ADEE0EE59DA4729FEA017055F6C8E52FB46944653DF75681D5354FA62464CF0","version":"5.1.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-5.1.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"Disable Rendering","description":"Illumine - Disable rendering to improve performance","id":"disablerendering-plugin","releases":[{"date":"2021-08-09","sha512sum":"22584C6A481F3A4CBE569BFC7DF053F05BE8A4B6793E173090773E3C6919DBEB5705A205DD27EEC1084BD51571935D3263AB7F6EA2E7B8EDA1A9F7EE45F4683C","version":"1.0.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/disablerendering-1.0.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iBlackjack","description":"Illumine - Blackjack plugin","id":"iblackjack-plugin","releases":[{"date":"2021-08-09","sha512sum":"DE7063171C8DEFD8E17471060111624172D18E05478574C1267E3D62F0D328E2A9520DF3471B6C0A1710D228B4FAC8CB867AE968987C40718FBA32EC47AC0105","version":"2.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iblackjack-2.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iCombination Runecrafter Plugin","description":"Illumine - Combination Runecrafting plugin","id":"icombinationrunecrafterplugin-plugin","releases":[{"date":"2021-08-09","sha512sum":"525470A8CDE1E77C038D16D46FFD32F1E793F9A4F1095FFF11FEE9F682D80B2016EE369C5B0298D33B8C8D2E2404416501AF11856C8739A9D0DE3CB917031FF4","version":"3.1.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/icombinationrunecrafter-3.1.3.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iHerbCleaner","description":"Illumine - Herb Cleaner","id":"iherbcleaner-plugin","releases":[{"date":"2021-08-09","sha512sum":"947E7C27746385BA8B2F84B3900DB483430C94ADB92C0E9A5DF1B608A2B7DB0CC1EBF083FFEFE71095CDB922A407D12ED9E96F2700A33BD23FDE546844EFCAB6","version":"2.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iherbcleaner-2.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iMagic Caster","description":"Illumine automated magic caster","id":"imagiccaster-plugin","releases":[{"date":"2021-08-09","sha512sum":"B201FE2A998CA6584150F551A06BF6F2624DCF88082255EADBF2413A2D24FBA1865E7BAA0DC0B72939E76AD76C7E7B44CFB23C1536E20B350500CB48A14A7DCD","version":"4.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/imagiccaster-4.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iMenu Debugger Plugin","description":"Illumine - Menu Debugger plugin","id":"imenudebuggerplugin-plugin","releases":[{"date":"2021-08-09","sha512sum":"DD01D4D9E518387359031043622FF8E1D9405089C0FB0EFB2670D2FD15EBF6564B502C704AE341CEBE439F9C930C20D1EFB63457B83B52647FE781B0C650A006","version":"2.2.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/imenudebugger-2.2.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iPowerfighter Plugin","description":"Illumine - Powerfighter plugin","id":"ipowerfighterplugin-plugin","releases":[{"date":"2021-08-09","sha512sum":"91C82B66073E942668F888EC9816581C203FA9A69BBD109D694922370543CE1361D9B9608CD450EF4CB9C5B8C41A09D0C5F2525DF7F3749021F696E0A3E60223","version":"4.2.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/ipowerfighter-4.2.4.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iPower Skiller","description":"Illumine auto power skiller plugin","id":"ipowerskiller-plugin","releases":[{"date":"2021-08-09","sha512sum":"A39C5BD79FEF4F8839F406BBACD5162CE3E8CD3A7C0C8B8F13A706810162E9717C8AC0567B4F197DF80AE1DCED70AF8634FA765641D51A9C3A8FDF6249FBF376","version":"6.1.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/ipowerskiller-6.1.3.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuest Assistant","description":"Illumine - Quest Assistant plugin","id":"iquestassistant-plugin","releases":[{"date":"2021-08-09","sha512sum":"E09162B0B58F8653EBFD86FA9E84D813D7C0A060DD34852280D7224E2A52929F6FDBEF16598E0F89C5241F971D7CC78635456BFBBA4697CA0B086C195C157A43","version":"1.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquestassistant-1.0.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuester Free","description":"Illumine - Free Quester plugin.","id":"iquesterfree-plugin","releases":[{"date":"2021-08-09","sha512sum":"B19CED68CBA64F6F37A221045BD178B892E293A30DBCB6C4EBA3E45C88BD2B001E44B1EBACE0C90253FAC80511D97966FB3C4F3424C705C79911B3695921DC25","version":"1.0.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquesterfree-1.0.4.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuick Eater","description":"Illumine - auto eat food, consume potions and equip items","id":"iquickeater-plugin","releases":[{"date":"2021-08-09","sha512sum":"C8D92784447CC5D4726BD22B5B402A8BC9B719FB6381543985D87FCE3F4AAA8BE6BEF3D4369C95E2D179EBDE8E76392E029D9AD3E118A0003F4BDA0AFC42F510","version":"5.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquickeater-5.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iRandom Handler","description":"illumine - Dismiss random events and handle genie","id":"irandomhandler-plugin","releases":[{"date":"2021-08-09","sha512sum":"FAC53D573FC9489E293B0DD19CDAF4A62E2C28874661D0CF4AC8BE1D8756AAD6752144615B21F70B595803C970D109A6C9BBC0E7BF0C57F848573EEE5DA0B04D","version":"3.1.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/irandomhandler-3.1.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iRooftop Agility","description":"Illumine automated rooftop agility plugin","id":"irooftopagility-plugin","releases":[{"date":"2021-08-09","sha512sum":"706A284A3354C409250895398CD68F9EE5D99A88304988E2AAB243BCDCC13D60709AF1C89967E7401629F9FB8FF92CB33E63DBEB896F34800E7BE9823C84BF30","version":"6.1.6","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/irooftopagility-6.1.6.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iTaskTemplate","description":"Illumine - Task Template plugin","id":"itasktemplate-plugin","releases":[{"date":"2021-08-09","sha512sum":"98C262B2D53F0ABDB3DE2961E514BB7DD496EAC9E5B3DB56B302146680BD8B180E91CB11F3F04502F828811AFFB45AFE0DCBBB170105E82BA65D14CAB82A1284","version":"4.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/itasktemplate-4.0.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"iutils-plugin","releases":[{"date":"2021-08-09","sha512sum":"2667987274149319363A4CE66CC156858D448F28F768ED971F64C2E0670B1DA23040DB319303729C91B5017F1E70A8FAF40F47680459850B9C07B9E9EC4D2F5D","version":"4.3.7","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iutils-4.3.7.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iWorld Walker Plugin","description":"Illumine - World Walker plugin","id":"iworldwalkerplugin-plugin","releases":[{"date":"2021-08-09","sha512sum":"F1AAF978D489763F0DDC078CBF9AAD340D16B10B5D60DB02F5D60B38390FCE097380759B7B50558FBFF9DCE804BC11BEBFAE20EDF3A2DF520AA5C6EE785A6981","version":"4.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iworldwalker-4.0.1.jar?raw=true","requires":"^1.0.0"}]}] +[{"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"BotUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"botutils-plugin","releases":[{"date":"2021-08-10","sha512sum":"A71C4F1B739303A6B543B80D6F10826A780D86365A495F0FFD3D2EE8A49585C18ADEE0EE59DA4729FEA017055F6C8E52FB46944653DF75681D5354FA62464CF0","version":"5.1.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/botutils-5.1.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"Disable Rendering","description":"Illumine - Disable rendering to improve performance","id":"disablerendering-plugin","releases":[{"date":"2021-08-10","sha512sum":"22584C6A481F3A4CBE569BFC7DF053F05BE8A4B6793E173090773E3C6919DBEB5705A205DD27EEC1084BD51571935D3263AB7F6EA2E7B8EDA1A9F7EE45F4683C","version":"1.0.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/disablerendering-1.0.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iBlackjack","description":"Illumine - Blackjack plugin","id":"iblackjack-plugin","releases":[{"date":"2021-08-10","sha512sum":"DE7063171C8DEFD8E17471060111624172D18E05478574C1267E3D62F0D328E2A9520DF3471B6C0A1710D228B4FAC8CB867AE968987C40718FBA32EC47AC0105","version":"2.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iblackjack-2.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iCombination Runecrafter Plugin","description":"Illumine - Combination Runecrafting plugin","id":"icombinationrunecrafterplugin-plugin","releases":[{"date":"2021-08-10","sha512sum":"525470A8CDE1E77C038D16D46FFD32F1E793F9A4F1095FFF11FEE9F682D80B2016EE369C5B0298D33B8C8D2E2404416501AF11856C8739A9D0DE3CB917031FF4","version":"3.1.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/icombinationrunecrafter-3.1.3.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iHerbCleaner","description":"Illumine - Herb Cleaner","id":"iherbcleaner-plugin","releases":[{"date":"2021-08-10","sha512sum":"947E7C27746385BA8B2F84B3900DB483430C94ADB92C0E9A5DF1B608A2B7DB0CC1EBF083FFEFE71095CDB922A407D12ED9E96F2700A33BD23FDE546844EFCAB6","version":"2.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iherbcleaner-2.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iMagic Caster","description":"Illumine automated magic caster","id":"imagiccaster-plugin","releases":[{"date":"2021-08-10","sha512sum":"B201FE2A998CA6584150F551A06BF6F2624DCF88082255EADBF2413A2D24FBA1865E7BAA0DC0B72939E76AD76C7E7B44CFB23C1536E20B350500CB48A14A7DCD","version":"4.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/imagiccaster-4.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iMenu Debugger Plugin","description":"Illumine - Menu Debugger plugin","id":"imenudebuggerplugin-plugin","releases":[{"date":"2021-08-10","sha512sum":"DD01D4D9E518387359031043622FF8E1D9405089C0FB0EFB2670D2FD15EBF6564B502C704AE341CEBE439F9C930C20D1EFB63457B83B52647FE781B0C650A006","version":"2.2.0","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/imenudebugger-2.2.0.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iPowerfighter Plugin","description":"Illumine - Powerfighter plugin","id":"ipowerfighterplugin-plugin","releases":[{"date":"2021-08-10","sha512sum":"91C82B66073E942668F888EC9816581C203FA9A69BBD109D694922370543CE1361D9B9608CD450EF4CB9C5B8C41A09D0C5F2525DF7F3749021F696E0A3E60223","version":"4.2.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/ipowerfighter-4.2.4.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iPower Skiller","description":"Illumine auto power skiller plugin","id":"ipowerskiller-plugin","releases":[{"date":"2021-08-10","sha512sum":"A39C5BD79FEF4F8839F406BBACD5162CE3E8CD3A7C0C8B8F13A706810162E9717C8AC0567B4F197DF80AE1DCED70AF8634FA765641D51A9C3A8FDF6249FBF376","version":"6.1.3","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/ipowerskiller-6.1.3.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuest Assistant","description":"Illumine - Quest Assistant plugin","id":"iquestassistant-plugin","releases":[{"date":"2021-08-10","sha512sum":"E09162B0B58F8653EBFD86FA9E84D813D7C0A060DD34852280D7224E2A52929F6FDBEF16598E0F89C5241F971D7CC78635456BFBBA4697CA0B086C195C157A43","version":"1.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquestassistant-1.0.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuester Free","description":"Illumine - Free Quester plugin.","id":"iquesterfree-plugin","releases":[{"date":"2021-08-10","sha512sum":"B19CED68CBA64F6F37A221045BD178B892E293A30DBCB6C4EBA3E45C88BD2B001E44B1EBACE0C90253FAC80511D97966FB3C4F3424C705C79911B3695921DC25","version":"1.0.4","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquesterfree-1.0.4.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iQuick Eater","description":"Illumine - auto eat food, consume potions and equip items","id":"iquickeater-plugin","releases":[{"date":"2021-08-10","sha512sum":"C8D92784447CC5D4726BD22B5B402A8BC9B719FB6381543985D87FCE3F4AAA8BE6BEF3D4369C95E2D179EBDE8E76392E029D9AD3E118A0003F4BDA0AFC42F510","version":"5.1.2","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iquickeater-5.1.2.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iRandom Handler","description":"illumine - Dismiss random events and handle genie","id":"irandomhandler-plugin","releases":[{"date":"2021-08-10","sha512sum":"FAC53D573FC9489E293B0DD19CDAF4A62E2C28874661D0CF4AC8BE1D8756AAD6752144615B21F70B595803C970D109A6C9BBC0E7BF0C57F848573EEE5DA0B04D","version":"3.1.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/irandomhandler-3.1.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iRooftop Agility","description":"Illumine automated rooftop agility plugin","id":"irooftopagility-plugin","releases":[{"date":"2021-08-10","sha512sum":"706A284A3354C409250895398CD68F9EE5D99A88304988E2AAB243BCDCC13D60709AF1C89967E7401629F9FB8FF92CB33E63DBEB896F34800E7BE9823C84BF30","version":"6.1.6","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/irooftopagility-6.1.6.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iTaskTemplate","description":"Illumine - Task Template plugin","id":"itasktemplate-plugin","releases":[{"date":"2021-08-10","sha512sum":"98C262B2D53F0ABDB3DE2961E514BB7DD496EAC9E5B3DB56B302146680BD8B180E91CB11F3F04502F828811AFFB45AFE0DCBBB170105E82BA65D14CAB82A1284","version":"4.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/itasktemplate-4.0.1.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iUtils","description":"Illumine - Utils required for plugins to function with added automation","id":"iutils-plugin","releases":[{"date":"2021-08-10","sha512sum":"015060B4A0831B85572A62D98AF62199BAEA1D7A5B40FFEBB3F00CEC51E32E15AF645EA084ED3AD7D98198AB7D3BE1A35E103436AB0AE4F6A442CF93E2B7C144","version":"4.3.8","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iutils-4.3.8.jar?raw=true","requires":"^1.0.0"}]}, {"projectUrl":"https://discord.gg/9fGzEDR","provider":"illumine","name":"iWorld Walker Plugin","description":"Illumine - World Walker plugin","id":"iworldwalkerplugin-plugin","releases":[{"date":"2021-08-10","sha512sum":"F1AAF978D489763F0DDC078CBF9AAD340D16B10B5D60DB02F5D60B38390FCE097380759B7B50558FBFF9DCE804BC11BEBFAE20EDF3A2DF520AA5C6EE785A6981","version":"4.0.1","url":"https://github.com/illumineawake/illu-plugins/blob/master/release/iworldwalker-4.0.1.jar?raw=true","requires":"^1.0.0"}]}] diff --git a/release/iutils-4.3.7.jar b/release/iutils-4.3.8.jar similarity index 99% rename from release/iutils-4.3.7.jar rename to release/iutils-4.3.8.jar index aebce6ac..9a687ba8 100644 Binary files a/release/iutils-4.3.7.jar and b/release/iutils-4.3.8.jar differ