Jump to content

Custom Script Skeleton,


subpars

Recommended Posts

Hi,

I was wondering if somebody could potentially make a script skeleton for me - so I can add to and finish? 

 

There's some tasks I'm having a hard time with and wondered if someone could help? 

 

  • Walk to nearest Bank 
  • Opens Bank
  • Check for array of items
  • Withdraws Items
  • Walk to specific area

From there I can hopefully learn the functions of the API and start building my ideas - I'd really appreciate any support.

Link to comment
Share on other sites

21 minutes ago, subpars said:

Walk to nearest Bank 

Here ya go
 

Spoiler
    private Area[] banks;

    @Override
    public void onStart() {
        setBanks();
    }

    private void setBanks() {
        final List<Area> banksList = new ArrayList<>();

        for (final Field bank : Banks.class.getDeclaredFields()) {
            try {
                banksList.add((Area) bank.get(Banks.class));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }

        banks = banksList.toArray(new Area[0]);
    }

 

And can be used like this to walk to nearest bank

getWalking().webWalk(banks);
  • Sad 1
  • Heart 1
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...