December 31, 20178 yr Is there a way to determine what kind of damage you're taking? For example, one monster I'm fighting might use melee while another one might use ranged. Is there a way to determine how you're getting attacked so I can put on the correct prayer? Thanks!
December 31, 20178 yr Nope, you'd have to use the monsters animation ID to determine what attack it is using
January 1, 20188 yr Author 1 hour ago, Night said: Nope, you'd have to use the monsters animation ID to determine what attack it is using Would it be possible to use projectiles? Of course it wouldn't differentiate ranged/mage, but at least ranged/mage and melee?
January 1, 20188 yr Author 19 minutes ago, Chris said: try projectiles Would there be a more efficient way than doing this? Or is there a way to use a filter with projectiles (doubt it, took a quick look). LinkedList<Projectile> allProj = api.projectiles.getAll(); for (Projectile temp : allProj) { if (temp.getTargetEntity().equals(api.myPlayer()) && Variables.usePrayer && !api.getPrayer().isActivated(PrayerButton.PROTECT_FROM_MISSILES)) { return true; } } My thinking is it checks if any projectile is targeted at me, if it is return true (go to the execution method). Edited January 1, 20188 yr by DrizzyBot
January 1, 20188 yr what npcs/players are you planning on using this one maby we can give a more accurate help
January 1, 20188 yr ad hoc api.projectiles.getAll() .stream() .filter(this::isProjectileTargetingMe) .filter(this::isProjectileARangedAttack) .collect(Collectors.toList()); private boolean isProjectileTargetingMe(Projectile p) { return api.myPlayer().equals(p.getTargetEntity()); } private boolean isProjectileARangedAttack(Projectile p) { return p.getId() == -1; // TODO } get projectiles get only projectiles targeting us get only projectiles with certain ID Then you can mess about figuring out whether you're praying the right prayer. Look into Lambda expressions for Java.
January 2, 20188 yr Author 20 hours ago, TheMcPker said: what npcs/players are you planning on using this one maby we can give a more accurate help It's going to be an AIO fighter, but some areas have multiple monsters with multiple attack types (mountain trolls for example also has thrower trolls that use ranged). 20 hours ago, liverare said: ad hoc api.projectiles.getAll() .stream() .filter(this::isProjectileTargetingMe) .filter(this::isProjectileARangedAttack) .collect(Collectors.toList()); private boolean isProjectileTargetingMe(Projectile p) { return api.myPlayer().equals(p.getTargetEntity()); } private boolean isProjectileARangedAttack(Projectile p) { return p.getId() == -1; // TODO } get projectiles get only projectiles targeting us get only projectiles with certain ID Then you can mess about figuring out whether you're praying the right prayer. Look into Lambda expressions for Java. Perfect, thank you.
Create an account or sign in to comment