Hel Posted November 22, 2016 Posted November 22, 2016 public void vertical(){ for(int i = 0; i < 28; i = i + 4){ if(inventory.getItemInSlot(i) != null){ inventory.getItemInSlot(i).interact("drop"); } } } The result of using the above mentioned code is this: I've been fiddling around for the past hour with this, tried completely different methods, tried adding in sleep functions, nothing seems to work, any help would be greatly appreciated
Team Cape Posted November 22, 2016 Posted November 22, 2016 think about that logic. you're going to go through: 0 4 8 12 16 20 24 and you (would) only drop those items. beside that, you're trying to drop the actual Item which is crucially different from the item in the slot. You would want to do something like: inventory.interact(i, "Drop") 1
Hel Posted November 22, 2016 Author Posted November 22, 2016 (edited) Ah, I understand my error, foolish me, thankyou for your help Edited November 22, 2016 by viri 1
Muffins Posted November 22, 2016 Posted November 22, 2016 http://osbot.org/forum/topic/95710-autohotkey-like-vertical-droppingcustom-dropping/ might be helpful
Juggles Posted November 22, 2016 Posted November 22, 2016 Credits to this nub ^^^ http://osbot.org/forum/topic/95710-autohotkey-like-vertical-droppingcustom-dropping/
Hel Posted November 22, 2016 Author Posted November 22, 2016 (edited) For those interested, I ended up going with the following code: for (int rep = 0; rep < 4; rep++) { for (int i = rep; i < 28; i = i + 4) { if (inventory.getItemInSlot(i) != null) { inventory.interact(i, "drop"); } } } Edited November 22, 2016 by viri 1