Chichoo 0 Share 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. Link to comment Share on other sites More sharing options...
Milasoft 202 Share 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. sr24, Chichoo and 7804364 3 Link to comment Share on other sites More sharing options...
Chichoo 0 Author Share Posted January 2, 2019 Thank you! It works flawlessly! What exactly does the sleep function do? Link to comment Share on other sites More sharing options...
ExpansionPack 17 Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now