use of org.powerbot.bot.rt6.client.Client in project powerbot by powerbot.
the class Player method valid.
@Override
public boolean valid() {
final Client client = ctx.client();
if (client == null || player == null) {
return false;
}
final org.powerbot.bot.rt4.client.Player[] arr = client.getPlayers();
for (final org.powerbot.bot.rt4.client.Player a : arr) {
if (player.equals(a)) {
return true;
}
}
return false;
}
use of org.powerbot.bot.rt6.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 org.powerbot.bot.rt6.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 org.powerbot.bot.rt6.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 org.powerbot.bot.rt6.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;
}
Aggregations