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
  • Enable Shift Drop Setting


    None

    Recommended Posts


    final static int shiftDrop = 0b100000000000000000; // or final static int shiftDrop = 1 << 17
    public boolean dropShift() {
    return (getPlayerSettings().getConfig(1055) & shiftDrop) == shiftDrop;
    }


    if (!dropShift()) {
    if (!getTabs().isOpen(Tab.OPTIONS)) {
    if (getTabs().open(Tab.OPTIONS))
    sleepUntil(() -> getTabs().isOpen(Tab.OPTIONS), 3000);
    } else if (getWidgets().getWidgetChild(261, 65) == null
    || !getWidgets().getWidgetChild(261, 65).isVisible()) {
    if (getWidgets().getWidgetChild(261, 1, 7) != null) {
    if(getWidgets().getWidgetChild(261, 1, 7).interact("Controls"))
    sleep(1000,1500);
    }
    } else {
    if (getWidgets().getWidgetChild(261, 65).interact())
    sleepUntil(() -> dropShift(), 3000);
    }
    }

     

    Link to comment
    Share on other sites

    thanks

     

     

    Edit:

     

    Changing

    final static int shiftDrop = 0b100000000000000000;

     

    to

    final static int shiftDrop = 1 << 17;

     

    makes it easier to read imo

    added to the snippit :) thanks for the input

    Link to comment
    Share on other sites

    A better version:

     public boolean quickDropActive() {
            return ((getPlayerSettings().getConfig(1055) >> 17) & 0x1) == 1;
     }
    
        public boolean activateQuickDropping() {
            if (quickDropActive())
                return true;
            if (!getTabs().isOpen(Tab.OPTIONS))
                return getTabs().open(Tab.OPTIONS) && activateQuickDropping();
            WidgetChild settings = getWidgets().getWidgetChild(261, 65);
            if (settings != null && settings.isVisible() && settings.interact()) {
                return (settings == null) && activateQuickDropping();
            }
            WidgetChild controls = getWidgets().getWidgetChild(261, 1, 7);
            return (controls != null) && controls.interact("Controls");
        }
    

    I would also strongly recommend splitting these things up for more accuracy/fluency, hence why I opted for a recursive solution.

    In short: I would split it up in opening up the sub-menu in the settings tab, and have it interact with it. 

    I just wrote it in a suboptimal way to respect the OP's solving logic! 

     

    Not sure why there was opted for a << 17 solution as that does sound as the reverse way of solving things.

    Link to comment
    Share on other sites

    A better version:

     public boolean quickDropActive() {
            return ((getPlayerSettings().getConfig(1055) >> 17) & 0x1) == 1;
     }
    
        public boolean activateQuickDropping() {
            if (quickDropActive())
                return true;
            if (!getTabs().isOpen(Tab.OPTIONS))
                return getTabs().open(Tab.OPTIONS) && activateQuickDropping();
            WidgetChild settings = getWidgets().getWidgetChild(261, 65);
            if (settings != null && settings.isVisible() && settings.interact()) {
                return (settings == null) && activateQuickDropping();
            }
            WidgetChild controls = getWidgets().getWidgetChild(261, 1, 7);
            return (controls != null) && controls.interact("Controls") && quickDropActive();
        }
    

    I would also strongly recommend splitting these things up for more accuracy/fluency, hence why I opted for a recursive solution.

    In short: I would split it up in opening up the sub-menu in the settings tab, and have it interact with it. 

    I just wrote it in a suboptimal way to respect the OP's solving logic! 

     

    Not sure why there was opted for a << 17 solution as that does sound as the reverse way of solving things.

    my method is split up with the else ifs it will do 1 action per loop, open tab...reloop...click button...reloop....activate...reloop

    Link to comment
    Share on other sites

    my method is split up with the else ifs it will do 1 action per loop, open tab...reloop...click button...reloop....activate...reloop, yours is actually more prone to  fail if it lags due to the if if if structure

     

    Allow me to educate young grasshopper.

     

    The whole point of me using recursion is because it is guaranteed to reach the end-goal. I'm not saying that recursion is the solution (considering that is not how this type of API is constructed) as I'm sure that is what you're referring to but I have kept things in a singular "block" to respect the way you wrote it.

     

    I did not refer to splitting up as in splitting it up in control statements (if/else/else if), but as in splitting it up in different fields. One would be openSettings(SettingSubTab.CONTROLS) and the other would be activating the actual shift drop. 

     

    Feel free to test it out, I think you'll find that yours is more prone to failure than mine.

    Link to comment
    Share on other sites

    A better version:

     public boolean quickDropActive() {
            return ((getPlayerSettings().getConfig(1055) >> 17) & 0x1) == 1;
     }
    
        public boolean activateQuickDropping() {
            if (quickDropActive())
                return true;
            if (!getTabs().isOpen(Tab.OPTIONS))
                return getTabs().open(Tab.OPTIONS) && activateQuickDropping();
            WidgetChild settings = getWidgets().getWidgetChild(261, 65);
            if (settings != null && settings.isVisible() && settings.interact()) {
                return (settings == null) && activateQuickDropping();
            }
            WidgetChild controls = getWidgets().getWidgetChild(261, 1, 7);
            return (controls != null) && controls.interact("Controls");
        }
    

    I would also strongly recommend splitting these things up for more accuracy/fluency, hence why I opted for a recursive solution.

    In short: I would split it up in opening up the sub-menu in the settings tab, and have it interact with it. 

    I just wrote it in a suboptimal way to respect the OP's solving logic! 

     

    Not sure why there was opted for a << 17 solution as that does sound as the reverse way of solving things.

     

     

    Inb4 something breaks in the API and you get stuck in the recursive loop so you have to end the program through task manager.

    Link to comment
    Share on other sites

    Allow me to educate young grasshopper.

     

    The whole point of me using recursion is because it is guaranteed to reach the end-goal. I'm not saying that recursion is the solution (considering that is not how this type of API is constructed) as I'm sure that is what you're referring to but I have kept things in a singular "block" to respect the way you wrote it.

     

    I did not refer to splitting up as in splitting it up in control statements (if/else/else if), but as in splitting it up in different fields. One would be openSettings(SettingSubTab.CONTROLS) and the other would be activating the actual shift drop. 

     

    Feel free to test it out, I think you'll find that yours is more prone to failure than mine.

     

    I dont mean to sound rude but if you think you have a snippit that is better than mine, please post it on a different thread. 

     

    i dont have the energy to argue over 15 lines of code...

    Link to comment
    Share on other sites

    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.