November 27, 20169 yr I kind of assumed it would be handled in the webwalking since it's so fancy. However, if you walk by draynor, and it runs into one of the tree npcs, it will literally just kill you in that spot over and over. Anyone have a workaround? Bring an axe and chop 'em down
November 27, 20169 yr I have made something for the exact same problem, Because setBreakCondition isn't triggered often enough, I have a seperate thread that does the following: Find all trees near me within 1 tile away, If tree found, interrupt() the main thread The interrupt interrupts the web walker, so my code falls back into the main onLoop() There I have some logic that checks for the trees again, if one is found it walks around it or else continues webWalking Edited November 27, 20169 yr by Abuse
November 28, 20169 yr Author I have made something for the exact same problem, Because setBreakCondition isn't triggered often enough, I have a seperate thread that does the following: Find all trees near me within 1 tile away, If tree found, interrupt() the main thread The interrupt interrupts the web walker, so my code falls back into the main onLoop() There I have some logic that checks for the trees again, if one is found it walks around it or else continues webWalking Thank you yes that is a workaround however seems really haxxy
November 28, 20169 yr Thank you yes that is a workaround however seems really haxxy There is no better responsive way atm.
November 28, 20169 yr Author There is no better responsive way atm. This isn't the only npc that halts your movement. Like the guy in the chair in falador castle, and others. It would be nice to see the web walking realize that it is not actually walking, and then evaluate() The thread polling solution is rather cumbersome for such a simple task. Edited November 28, 20169 yr by dmm_slaver
November 29, 20169 yr Author Solution: Thread shitTree = new Thread() { { setDaemon(true); setPriority(Thread.MIN_PRIORITY); setName("Shit tree handler 0"); } @[member=Override] public void run() { do { Player i = myPlayer(); if (i != null) { if (i.isHitBarVisible()) { interrupt = true; NPC tree = npcs.closest(4418); if (tree != null) { log("under attack tree"); if (tree.getY() > myPlayer().getY() && am.dist(tree, myPlayer()) < 2) { Position p = myPosition().translate(am.gauss(3), 0); p.interact(bot, "Walk here"); am.delay(am.gaussp(1200, 600)); continue; } } } else { interrupt = false; } } am.delay(50); } while (running); } };
November 29, 20169 yr Solution: Thread shitTree = new Thread() { { setDaemon(true); setPriority(Thread.MIN_PRIORITY); setName("Shit tree handler 0"); } @[member='Override'] public void run() { do { Player i = myPlayer(); if (i != null) { if (i.isHitBarVisible()) { interrupt = true; NPC tree = npcs.closest(4418); if (tree != null) { log("under attack tree"); if (tree.getY() > myPlayer().getY() && am.dist(tree, myPlayer()) < 2) { Position p = myPosition().translate(am.gauss(3), 0); p.interact(bot, "Walk here"); am.delay(am.gaussp(1200, 600)); continue; } } } else { interrupt = false; } } am.delay(50); } while (running); } }; It'd be cool if they added support for this so people weren't creating a separate thread just to check for tree npc's
November 29, 20169 yr Author It'd be cool if they added support for this so people weren't creating a separate thread just to check for tree npc's All they need is to be able to set a maximum wait time before running evaluate() Also note, my solution only works if you're walking from south to north always. However it would be easy to modify it to work for other directions.
Create an account or sign in to comment