Jammer Posted November 27, 2016 Share Posted November 27, 2016 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 Quote Link to comment Share on other sites More sharing options...
Abuse Posted November 27, 2016 Share Posted November 27, 2016 (edited) 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, 2016 by Abuse Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted November 28, 2016 Author Share Posted November 28, 2016 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 Quote Link to comment Share on other sites More sharing options...
Abuse Posted November 28, 2016 Share Posted November 28, 2016 Thank you yes that is a workaround however seems really haxxy There is no better responsive way atm. Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted November 28, 2016 Author Share Posted November 28, 2016 (edited) 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, 2016 by dmm_slaver Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted November 29, 2016 Author Share Posted November 29, 2016 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); } }; Quote Link to comment Share on other sites More sharing options...
Thunderwaffe Posted November 29, 2016 Share Posted November 29, 2016 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 Quote Link to comment Share on other sites More sharing options...
dmmslaver Posted November 29, 2016 Author Share Posted November 29, 2016 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. Quote Link to comment Share on other sites More sharing options...