Sales pitch I suppose
You generally use it like normal scripting code, not sure what examples you wanted. Here's an example of "infinite" prayer flicking I suppose
@Override
public void onGameTick() {
super.onGameTick();
final PrayerButton prayer = PrayerButton.THICK_SKIN;
final RS2Widget widget = getPrayerWidget(prayer);
final InvokeHelper ih = new InvokeHelper(this);
if (widget == null) {
return;
}
if (getPrayer().isActivated(prayer)) {
ih.invoke(widget, 0);
ih.invoke(widget, 0);
} else {
ih.invoke(widget, 0);
}
}
private RS2Widget getPrayerWidget(PrayerButton prayer) {
RS2Widget widget = getWidgets().getAll().stream()
.filter(w -> w.getSpriteIndex1() == prayer.getSpriteId())
.findFirst()
.orElse(null);
if (widget != null) {
widget = getWidgets().get(widget.getRootId(), widget.getSecondLevelId());
}
return widget;
}