Jump to content

Selling Loot Script Start


investmentideas

Recommended Posts

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();
        }
    }
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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