Jump to content

Banking script issue


Chris

Recommended Posts

I want it to withdraw food from this array

    public static String[] food = { "Shrimp","Trout","Salmon","Tuna","Lobster","Swordfish","Monkfish","Shark" };

im calling it this way and (may not be the best way but is an example)

if (s.bank.isOpen()){
            //do banking
           if (!s.inventory.contains(food)){
               if (s.getBank().contains(food)){
                    s.bank.withdrawAll(food);
               }
           }

        }

and i get this error

 

ecdae3d3db.png

 

 

i tried fixing it with intelj but this does not work
 

0669071121.png

Edited by Sinatra
Link to comment
Share on other sites

I want it to withdraw food from this array

    public static String[] food = { "Shrimp","Trout","Salmon","Tuna","Lobster","Swordfish","Monkfish","Shark" };

im calling it this way

if (s.bank.isOpen()){
            //do banking
           if (!s.inventory.contains(food)){
               if (s.getBank().contains(food)){
                    s.bank.withdrawAll(food);
               }
           }

        }

and i get this error

 

ecdae3d3db.png

 

 

i tried fixing it with intelj but this does not work

 

0669071121.png

 

You are passing an array to a method that only takes a String parameter.

 

b5bc93bc8d7963411b64c71a5b1f840c.png

 

Possible solution:

for(String f; food) {

if(!getBank().contains(f)) continue;

else {
getBank().withdrawAll(f);
break;
}

}
Link to comment
Share on other sites

Slow stepping.

Find item using item container.

Item item = Bank.getItem (food);

Bank.withdrawAll(item.getName ());

Just do a null check on the item.

hmm okay ill work with this and thanks for the fast response :wub:

  

You are passing an array to a method that only takes a String parameter.

 

b5bc93bc8d7963411b64c71a5b1f840c.png

 

Possible solution:

for(String f; food) {

if(!getBank().contains(f)) continue;

else {
getBank().withdrawAll(f);
break;
}

}
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...