November 12, 20187 yr 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?
November 12, 20187 yr 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, 20187 yr by jca
November 12, 20187 yr Author 5 minutes ago, jca said: getDoorHandler().handleNextObstacle(target) Wow thanks. Didn't think it would be that simple.
November 12, 20187 yr simple way would be to if (!map.canReach(npc) { walking.webWalk(INSIDE_AREA); } else { //kill shit }
November 12, 20187 yr Author 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.
November 12, 20187 yr 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
Create an account or sign in to comment