Chichoo 0 Posted January 2, 2019 Hi all, I was wondering how I should go about doing clicks in an inventory full of items, is there a concrete way of doing it or is brute forcing clicks the usual go? When I want to use -> item it'll take a long time to go through the inventory. I would like to mimic a more human speed. If anyone could provide a snippet or point me in the right direction, that would be super helpful! Thank you in advance.
Milasoft 202 Posted January 2, 2019 public void dropItems() { int dropOrder[] = {0,1,2,3,7,6,5,4,8,9,10,11,15,14,13,12,16,17,18,19,23,22,21,20,24,25,26,27}; getKeyboard().pressShift(); for(int i : dropOrder) { Item item = getInventory().getItemInSlot(i); if(item != null && !shouldKeep(item.getName())) { item.interact(); sleep(150, 300); } } getKeyboard().releaseShift(); } public boolean shouldKeep(String itemName) { return itemName.equals("Coins") || itemName.contains(" axe"); } I made this a while ago to shift drop items, you can adapt it to work for you.
Chichoo 0 Author Posted January 2, 2019 Thank you! It works flawlessly! What exactly does the sleep function do?
ExpansionPack 17 Posted January 2, 2019 1 hour ago, Chichoo said: Thank you! It works flawlessly! What exactly does the sleep function do? It sleeps the current thread, which is the ScriptExecutor Thread.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.