use of org.powerbot.bot.rt6.client.CombatStatusData in project powerbot by powerbot.
the class Actor method getBarData.
private CombatStatusData[] getBarData() {
final LinkedListNode[] nodes = getBarNodes();
final Client client = ctx.client();
if (nodes == null || client == null) {
return null;
}
final CombatStatusData[] data = new CombatStatusData[nodes.length];
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] == null || nodes[i].isNull() || !nodes[i].isTypeOf(CombatStatus.class)) {
data[i] = null;
continue;
}
final CombatStatus status = new CombatStatus(nodes[i].reflector, nodes[i]);
final org.powerbot.bot.rt6.client.LinkedList statuses;
try {
statuses = status.getList();
} catch (final IllegalArgumentException ignored) {
continue;
}
if (statuses == null) {
data[i] = null;
continue;
}
final LinkedListNode node = statuses.getSentinel().getNext();
if (node.isNull() || !node.isTypeOf(CombatStatusData.class)) {
data[i] = null;
continue;
}
data[i] = new CombatStatusData(node.reflector, node);
}
return data;
}
use of org.powerbot.bot.rt6.client.CombatStatusData in project powerbot by powerbot.
the class Actor method inCombat.
/**
* Whether or not the entity has a health bar displayed over their head. This is
* used to determine whether or not the entity is currently in combat.
*
* @return {@code true} if the health bar is visible, {@code false} otherwise.
*/
public boolean inCombat() {
final Client client = ctx.client();
if (client == null) {
return false;
}
final CombatStatusData[] data = getBarData();
return data != null && data[1] != null && data[1].getCycleEnd() < client.getCycle();
}
use of org.powerbot.bot.rt6.client.CombatStatusData in project powerbot by powerbot.
the class Actor method getBarData.
private CombatStatusData[] getBarData() {
final Node[] nodes = getBarNodes();
final Client client = ctx.client();
if (nodes == null || client == null) {
return null;
}
final CombatStatusData[] data = new CombatStatusData[nodes.length];
for (int i = 0; i < nodes.length; i++) {
if (nodes[i] == null || nodes[i].isNull() || !nodes[i].isTypeOf(CombatStatus.class)) {
data[i] = null;
continue;
}
final CombatStatus status = new CombatStatus(nodes[i].reflector, nodes[i]);
final org.powerbot.bot.rt4.client.LinkedList statuses;
try {
statuses = status.getList();
} catch (final IllegalArgumentException ignored) {
continue;
}
if (statuses == null) {
data[i] = null;
continue;
}
final Node node = statuses.getSentinel().getNext();
if (node.isNull() || !node.isTypeOf(CombatStatusData.class)) {
data[i] = null;
continue;
}
data[i] = new CombatStatusData(node.reflector, node);
}
return data;
}
use of org.powerbot.bot.rt6.client.CombatStatusData in project powerbot by powerbot.
the class Actor method inCombat.
public boolean inCombat() {
final Client client = ctx.client();
if (client == null) {
return false;
}
final CombatStatusData[] data = getBarData();
return data != null && data[1] != null && data[1].getCycleEnd() < client.getCycle();
}
Aggregations