Jump to content

Selling Loot Script Start


Recommended Posts

Posted

Hi, I am making something fun, a script that sells the loot that I pick up from wherever I might be (i.e. wildy).

I have created two string "groups"

where Item group 5 consists of higher value and Item group 6 consists of lower value.

I want the script to sell the items from group 5 only to a certain number, and then want the script to sell Item group 6, the problem is the way I have written it I believe, for example I do not know how to get it to now go to sell ITEMS6. Where would I insert the code? 

 

Any help is appreciated and I understand this code might not be efficient, still trying to learn :) 

 

Below is the code;

 

if (getInventory().contains(ITEMS5)){
    if (getStore().contains(ITEMS5)){
        if (getStore().getAmount(ITEMS5) <= 4){
            getStore().sell(String.valueOf(ITEMS5), 1);
            new ConditionalSleep(250, 125) {
                @Override
                public boolean condition() throws InterruptedException {
                    return (getStore().getAmount(ITEMS5) >= 5);
                }
            }.sleep();

        }
    } else {
        if(!getStore().contains(ITEMS5)){
            getStore().sell(String.valueOf(ITEMS5), 5);
            new ConditionalSleep(250, 125) {
                @Override
                public boolean condition() throws InterruptedException {
                    return (getStore().getAmount(ITEMS5) >= 5);
                }
            }.sleep();
        }
    }
}

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...