Example: 
public static void webWalkEvent(final INodeRouteFinder routeFinder, final Position position, final int treshold, final MethodProvider script) {
	WebWalkEvent event = new WebWalkEvent(routeFinder, position);
	event.setBreakCondition(new Condition() {
		@Override
		public boolean evaluate() {
                        // Return when you want the event to break.
			return script.getMap().distance(position) <= treshold;
		}
	});
	script.execute(event);
}