iutils: walking no longer attempts to eat rock cakes if low health (360noscope3dchessAI), add withoutNamePart to InventoryItemStream
This commit is contained in:
parent
e3aaa83349
commit
c21b1cab43
|
@ -23,7 +23,7 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
version = "4.4.0"
|
||||
version = "4.4.1"
|
||||
|
||||
project.extra["PluginName"] = "iUtils"
|
||||
project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation"
|
||||
|
|
|
@ -76,6 +76,14 @@ public class InventoryItemStream extends RandomizedStreamAdapter<InventoryItem,
|
|||
return filter(o -> Arrays.stream(names).anyMatch(name -> o.name().toLowerCase().contains(name.toLowerCase())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream consisting of the elements of this stream that don't match
|
||||
* any of the given {@link InventoryItem#name()}s
|
||||
*/
|
||||
public InventoryItemStream withoutNamePart(String... names) {
|
||||
return filter(o -> Arrays.stream(names).noneMatch(name -> o.name().toLowerCase().contains(name.toLowerCase())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a stream consisting of the elements of this stream with
|
||||
* any of the given {@link InventoryItem#actions()}s
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package net.runelite.client.plugins.iutils.walking;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.client.plugins.iutils.game.Game;
|
||||
import net.runelite.client.plugins.iutils.game.iTile;
|
||||
|
@ -333,7 +334,7 @@ public class Walking {
|
|||
}
|
||||
|
||||
if (game.modifiedLevel(Skill.HITPOINTS) < 8 || game.modifiedLevel(Skill.HITPOINTS) < game.baseLevel(Skill.HITPOINTS) - 22) {
|
||||
var food = game.inventory().withAction("Eat").first();
|
||||
var food = game.inventory().withoutId(ItemID.DWARVEN_ROCK_CAKE_7510).withAction("Eat").first();
|
||||
|
||||
if (food != null) {
|
||||
food.interact("Eat");
|
||||
|
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue