use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method getInternalComponent.
private Widget getInternalComponent() {
if (index < 0 || widget.id() < 1) {
return null;
}
final Object[] components;
if (parent != null) {
final Widget parentComponent = parent.getInternalComponent();
components = parentComponent != null ? parentComponent.getComponents() : null;
} else {
components = widget.getInternalComponents();
}
final Client c = ctx.client();
return c != null && components != null && index < components.length ? new Widget(c.reflector, components[index]) : null;
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method childrenCount.
public int childrenCount() {
final Widget component = getInternalComponent();
final Object[] interfaces;
if (component != null && (interfaces = component.getComponents()) != null) {
return interfaces.length;
}
return 0;
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method _visible.
private boolean _visible(final int depth) {
if (depth > RECURSION_DEPTH) {
System.out.printf("WARNING: Visible operation killed -- beyond depth of %d.%n", RECURSION_DEPTH);
return false;
}
final Widget internal = getInternalComponent();
int id = 0;
if (internal != null && valid() && !internal.isHidden()) {
id = parentId();
}
return id == -1 || (id != 0 && ctx.widgets.component(id >> 16, id & 0xffff)._visible(depth + 1));
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method itemName.
public String itemName() {
final Widget component = getInternalComponent();
String name = "";
if (component != null && (name = component.getComponentName()) == null) {
name = "";
}
return StringUtils.stripHtml(name);
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method selectedAction.
public String selectedAction() {
final Widget component = getInternalComponent();
String action = "";
if (component != null && (action = component.getSelectedActionName()) == null) {
action = "";
}
return action;
}