Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Holding Shift


    Zenarchist

    Recommended Posts

    Hey guys, I'm having a bit of trouble getting shift-drop to work in my scripts. I just can't seem to get shift to hold properly no matter what I try.

    There is no information on the DreamBot API about key holding so I am just trying to wing it using IntelliJ's code suggestions:

    // Check if quick drop is activated, otherwise use menu to drop
    if(action.equals("Drop") && quickDropActive() && gui.getBoolean("shift")) {
        final int idx = i;
        getKeyboard().holdShift(() -> getInventory().getItemInSlot(CLICK_ORDER[idx]) == null, r(250, 500));
        //s.getKeyboard().setHoldingShift(true);
        getMouse().move(getInventory().getItemInSlot(CLICK_ORDER[i]).getDestination());
        sleep(1, 25);
        getMouse().click();
    } else
        getInventory().slotInteract(CLICK_ORDER[i], r(0, 100) < 1 && action.equals("Drop") ? "Examine" : action);
    

    Neither getKeyboard().holdShift() nor getKeyboard().setHoldingShift() seem to have any affect on my script, it just keeps clicking items and using them on each other 😕 what am I doing wrong?

    Link to comment
    Share on other sites

    This is a very simplified version of what I use:

    main.getKeyboard().pressShift();
    for(Item item : itemsToDrop) {
    	item.interact("Drop");
    }
    main.getKeyboard().releaseShift();

     

    Link to comment
    Share on other sites

    • 2 weeks later...

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.