Search in sources :

Example 1 with CombatStatus

use of org.powerbot.bot.rt6.client.CombatStatus 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;
}
Also used : CombatStatus(org.powerbot.bot.rt6.client.CombatStatus) LinkedListNode(org.powerbot.bot.rt6.client.LinkedListNode) CombatStatusData(org.powerbot.bot.rt6.client.CombatStatusData) Client(org.powerbot.bot.rt6.client.Client) Point(java.awt.Point)

Example 2 with CombatStatus

use of org.powerbot.bot.rt6.client.CombatStatus 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;
}
Also used : CombatStatus(org.powerbot.bot.rt4.client.CombatStatus) Node(org.powerbot.bot.rt4.client.Node) CombatStatusData(org.powerbot.bot.rt4.client.CombatStatusData) Client(org.powerbot.bot.rt4.client.Client) Point(java.awt.Point)

Aggregations

Point (java.awt.Point)2 Client (org.powerbot.bot.rt4.client.Client)1 CombatStatus (org.powerbot.bot.rt4.client.CombatStatus)1 CombatStatusData (org.powerbot.bot.rt4.client.CombatStatusData)1 Node (org.powerbot.bot.rt4.client.Node)1 Client (org.powerbot.bot.rt6.client.Client)1 CombatStatus (org.powerbot.bot.rt6.client.CombatStatus)1 CombatStatusData (org.powerbot.bot.rt6.client.CombatStatusData)1 LinkedListNode (org.powerbot.bot.rt6.client.LinkedListNode)1