Due to the current inbuilt methods being a bit too "botlike", i decided to have a crack and tried to code my own, but introducing common human errors.
Here is what I have:
package com.ggplugins.osFisher;
import java.util.ArrayList;
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.script.Script;
public class Powerfish{
private Script instance;
public Powerfish(Script instance){
this.instance = instance;
}
public void clearInventory(ArrayList<Item> safelist) throws InterruptedException{
for(Item i : instance.inventory.getItems()){
if(!safelist.contains(i)){
switch(MethodProvider.random(0, 200)){
case 25:
instance.inventory.interact("Examine", i.getName());
MethodProvider.sleep(MethodProvider.random(300,600));
instance.inventory.drop(i.getName());
break;
case 50:
instance.inventory.interact("Use", i.getName());
MethodProvider.sleep(MethodProvider.random(300,600));
//Deselect item
instance.inventory.drop(i.getName());
break;
default:
instance.inventory.drop(i.getName());
break;
}
MethodProvider.sleep(MethodProvider.random(350,750));
}
}
}
}
So what happens is, occasionally it will skip items, then it will jump back to them a few drops later, and once it gets down to the last 8 items in the inventory it decides to throw a null pointer on
instance.inventory.drop(i.getName());
In the default case.
So instead of staring at it for another 2 hours, I decided another pair of eyes might just be what I need so I've posted it here.
Any help is appreciated, thanks.