use of client.Client in project powerbot by powerbot.
the class Players method get.
@Override
public List<Player> get() {
final List<Player> r = new CopyOnWriteArrayList<Player>();
final Client client = ctx.client();
if (client == null) {
return r;
}
final int[] indices = client.getPlayerIndices();
final org.powerbot.bot.rt4.client.Player[] players = client.getPlayers();
if (indices == null || players == null) {
return r;
}
for (int index = 0; index < Math.min(client.getPlayerCount(), indices.length); index++) {
final int k = indices[index];
final org.powerbot.bot.rt4.client.Player p = players[k];
if (p.obj.get() != null) {
r.add(new Player(ctx, p));
}
}
return r;
}
use of client.Client in project powerbot by powerbot.
the class Skills method experiences.
public int[] experiences() {
final Client c = ctx.client();
final int[] arr = c != null ? c.getSkillExps() : new int[0];
return arr != null ? arr : new int[0];
}
use of client.Client in project powerbot by powerbot.
the class Widget method valid.
/**
* {@inheritDoc}
*/
@Override
public boolean valid() {
if (index < 1) {
return false;
}
final Client client = ctx.client();
final org.powerbot.bot.rt4.client.Widget[][] arr = client != null ? client.getWidgets() : null;
return arr != null && index > -1 && index < arr.length && arr[index] != null && arr[index].length > 0;
}
use of client.Client in project powerbot by powerbot.
the class Widget method componentCount.
public int componentCount() {
final Client client = ctx.client();
final org.powerbot.bot.rt4.client.Widget[][] arr = client != null ? client.getWidgets() : null;
if (arr != null && index < arr.length) {
final org.powerbot.bot.rt4.client.Widget[] comps = arr[index];
return comps != null ? comps.length : 0;
}
return 0;
}
use of client.Client in project powerbot by powerbot.
the class Widgets method get.
/**
* {@inheritDoc}
*/
@Override
protected List<Widget> get() {
final Client client = ctx.client();
final org.powerbot.bot.rt4.client.Widget[][] a = client != null ? client.getWidgets() : null;
final int len = a != null ? a.length : 0;
if (len <= 0) {
return new ArrayList<Widget>(0);
}
widget(len - 1);
return new ArrayList<Widget>(Arrays.asList(Arrays.copyOf(sparseCache, len)));
}
Aggregations