Dot Posted November 12, 2018 Posted November 12, 2018 I'm writing an AIO fighter and I want my script to open doors if the closest attackable NPC is behind one (eg: Al-Kharid Warriors, some cunt closes a door in my face). Is there a better method for this than webwalking to the NPC's position? target = npcs.closest(n -> n.getName().equals(targetName) && n.exists() && n.getHealthPercent() > 0 && !myPlayer().isInteracting(n) && !n.isUnderAttack() && n != null); if (!map.canReach(target)) getWalking().webWalk(target.getPosition()); else { // do combat stuff } ^^ that's sort of what I'm using but webWalk is heavy on resources and I feel this is a really sloppy use of it. Is there a better way that is universal?
jca Posted November 12, 2018 Posted November 12, 2018 (edited) 2 minutes ago, Dot said: I'm writing an AIO fighter and I want my script to open doors if the closest attackable NPC is behind one (eg: Al-Kharid Warriors, some cunt closes a door in my face). Is there a better method for this than webwalking to the NPC's position? target = npcs.closest(n -> n.getName().equals(targetName) && n.exists() && n.getHealthPercent() > 0 && !myPlayer().isInteracting(n) && !n.isUnderAttack() && n != null); if (!map.canReach(target)) getWalking().webWalk(target.getPosition()); else { // do combat stuff } ^^ that's sort of what I'm using but webWalk is heavy on resources and I feel this is a really sloppy use of it. Is there a better way that is universal? getDoorHandler().handleNextObstacle(target) Edited November 12, 2018 by jca 1
Dot Posted November 12, 2018 Author Posted November 12, 2018 5 minutes ago, jca said: getDoorHandler().handleNextObstacle(target) Wow thanks. Didn't think it would be that simple.
Juggles Posted November 12, 2018 Posted November 12, 2018 simple way would be to if (!map.canReach(npc) { walking.webWalk(INSIDE_AREA); } else { //kill shit }
Dot Posted November 12, 2018 Author Posted November 12, 2018 3 minutes ago, Juggles said: simple way would be to if (!map.canReach(npc) { walking.webWalk(INSIDE_AREA); } else { //kill shit } That's basically what I was using already but I want it to work when the area isn't necessarily known (hence using getPosition() as the area). Also webWalk makes the client lag super hard.
Juggles Posted November 12, 2018 Posted November 12, 2018 17 minutes ago, Dot said: That's basically what I was using already but I want it to work when the area isn't necessarily known (hence using getPosition() as the area). Also webWalk makes the client lag super hard. Oops sorry didn't read your code fully xD