Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!
RuneMate will permanently shut down on August 7, 2026
due to events outside our control. You can continue using RuneMate until this date after which it will no longer be available. Thank you to everyone that contributed to RuneMate's success and to the community for the opportunity to serve you all these years.

  • Learn about RuneMate Vault and how its zero knowledge local encryption already protects your sensitive information.
  • Edit or delete your RuneMate account from your Account Settings.
  • All account upgrade subscriptions have been cancelled. No action required.

Question How do you drag items in inventory to a certain spot?

Joined
May 1, 2017
Messages
7
I am creating an high alch bot, but i'm having trouble with finding how you can drag a certain item to a certain spot in your inventory?
 
Joined
Oct 3, 2024
Messages
370
This should be a very good hint :p, tarLocation is the index

Java:
SpriteItem tar = Inventory.getItems(SWAMP_TAR).first();
InteractableRectangle rect = Inventory.getBoundsOf(tarLocation);
Mouse.drag(tar, rect);
 
Misfits
Joined
Nov 21, 2016
Messages
1,592
Code:
 public static void moveItem(String itemName, int indexGoal) {
        SpriteItem item = Inventory.newQuery().names(itemName).results().first();
        if (item != null) {
            if (item.getIndex() != indexGoal) {
                Interactable start = item.getBounds();
                Interactable end = Inventory.getBoundsOf(indexGoal);
                if (start != null && end != null) {
                    log.info("Dragging " + item + " from " + item.getIndex() + " to " + indexGoal);
                    if (Mouse.drag(start, end)) {
                       // delay
                    }
                } else {
                    log.warn("Failed to locate the item or bounds of goal index location");
                }
            }
        }
    }
 
Top