Yo, so during my late night scripting sessions, I was making a fisher for someone and the OSBot dropping method kind of sucks because it looks, well, bot like as fuck. Most players use AHK/MouseKeys and i have't seen a nice snippet for it, so me and @Isolate made one.
Now, OSBot count's inventory spaces like this... Provided crudely with this picture made is MSPaint.
THIS WILL DEFINE WHAT ORDER, AND WHAT INVENTORY SPACES YOU WANT TO DROP
I LEFT OUT SPACES 26 AND 27 DUE TO THEM CONTAINING MY ROD/FEATHERS (FISHING)
YOU CAN KEEP ALL SPACES OR TAKE OUT THE ONES YOU WISH DEPENDING ON WHAT
KIND OF DROPPING YOU ARE DOING
public static final int[] VERTICAL_DROP = new int[]{
0,4,8,12,16,20,24,1,5,9,13,17,21,25,2,6,10,14,18,22,3,7,11,15,19,23};
Next, When wanting to drop, do this.
Note: I am using a Task system made by @Vilius So you will have to implement it into your own code.
public void process() {
// Here is my order just saved in case: 0,4,8,12,16,20,24,1,5,9,13,17,21,25,2,6,10,14,18,22,3,7,11,15,19,23
for(int i : VERTICAL_DROP){
api.getInventory().interact(i, "Drop");
}
Or by using a lambda provided by @Vilius
VERTICAL_DROP.forEach(s -> api.getInventory().interact(s, "Drop"));
And voila, it does this (or it should, I hope, I kind of suck at this coding thing)