powerbot/RSBot — Issue #667: trade.tradePlayer();
Author: wyn10
Created: 2011-10-11 15:17:37+00:00
State: open

TradePlayer() throws java.lang.ArrayIndexOutOfBoundsException when in a crowded group.

It works fine with few people on screen.

Example usage:

String l;
RSPlayer dude = players.getNearest(l);
if (dude != null) {
trade.tradePlayer(dude);
sleep(random(2000, 3000));
}

Error thrown:

[INFO] Mon Oct 10 22:52:16 EDT 2011: *****: Script started.
[WARNING] Mon Oct 10 22:58:37 EDT 2011: *****: Uncaught exception from task: java.lang.ArrayIndexOutOfBoundsException: 1518
at org.rsbot.script.wrappers.RSCharacterModel.update(Unknown Source)
at org.rsbot.script.wrappers.RSModel.getPoint(Unknown Source)
at org.rsbot.script.wrappers.RSModel.interact(Unknown Source)
at org.rsbot.script.wrappers.RSCharacter.interact(Unknown Source)
at org.rsbot.script.methods.Trade.tradePlayer(Unknown Source)
at org.rsbot.script.methods.Trade.tradePlayer(Unknown Source)
at *****.loop(*****.java:385)
at org.rsbot.script.task.LoopTask.runOnce(Unknown Source)
at org.rsbot.script.Script.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)