I have the following code
package Tasks;
import org.osbot.rs07.api.Quests;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.MethodProvider;
public class GetMilk extends Task {
Area area = new Area(x1, y1, x2, y2);
public GetMilk(MethodProvider api) {
super(api);
}
@Override
public boolean activate() {
return !api.getQuests().isComplete(Quests.Quest.COOKS_ASSISTANT)
&& api.getInventory().getItem("Bucket") != null;
}
@Override
public void execute() {
if (!area.contains(api.myPosition())) {
api.getWalking().webWalk(area.getRandomPosition());
return;
}
api.getNpcs().closest("Dairy cow").interact();
}
}
The walking works, however my script starts spamming NPE when It gets to the Dairy Cow part.
Any ideas why this is happening?