I do something like this...
Code:final Location playerLocation = client.getLocation(); CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() { @Override public void execute(CycleEventContainer container) { if (!playerLocation.equals(player.getLocation())) { container.stop(); return; } //TODO skilling stuff here } }, 5);