MattGP Posted March 30, 2016 Share Posted March 30, 2016 import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.webwalk.INodeRouteFinder; import org.osbot.rs07.event.WebWalkEvent; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.utility.Condition; public class Runtoblurite extends Task { public void WebWalkCustom(Position p){ INodeRouteFinder nrf = INodeRouteFinder.createAdvanced(); WebWalkEvent e = new WebWalkEvent(nrf, p); e.setBreakCondition(new Condition() { @Override public boolean evaluate() { boolean flag = false; if(api.getSkills().getDynamic(Skill.HITPOINTS) <= api.getSkills().getStatic(Skill.HITPOINTS)*.7&& !(api.myPlayer().getPosition() == new Position(3059,9565,0))){ flag = true; } return flag; //stops when true } }); api.execute(e); } public Runtoblurite(MethodProvider api) { super(api); } @Override public boolean canProcess() { boolean flag = false; if(api.settings.getConfigs().get(122) == 6 && this.api.getSkills().getDynamic(Skill.MINING)>= 10 && !api.inventory.contains("Portrait")&& !api.inventory.contains("Blurite ore")&&!api.inventory.contains("Blurite sword")){ flag = true; } return flag; } @Override public void process() { api.log("Running to mine"); WebWalkCustom(new Position(3059,9565,0)); } } Hey there INodeRouteFinder caused a memory leak for me and used up all my heap space Link to comment Share on other sites More sharing options...
Isolate Posted March 30, 2016 Share Posted March 30, 2016 (edited) This INodeRouteFinder.createAdvanced(); only ever do it once in a script. Like in your onStart Edited March 30, 2016 by Isolate 1 Link to comment Share on other sites More sharing options...
Vilius Posted March 30, 2016 Share Posted March 30, 2016 The issue is that you are creating the inoderoutefinder every time you walk. You need to make one only onStart() once. Then maybe add it to your class that contains your variables public class test extends Script{ INodeRouteFinder nrf; public void onStart(){ nrf = INodeRouteFinder.createAdvanced(); } } Link to comment Share on other sites More sharing options...
MattGP Posted March 30, 2016 Author Share Posted March 30, 2016 This INodeRouteFinder.createAdvanced(); only ever do it once in a script. Like in your onStart thanks mate Link to comment Share on other sites More sharing options...