Jump to content

2 questions


mattpew

Recommended Posts

Is it possible to move the camera while my script is running to bank?

if (getBank().open()){
    getCamera().movePitch(22);
    getCamera().moveYaw(303);
}

currently it runs to the bank and then turns the camera. How can i make it run to the bank and while running turn?

 

2nd question, i want to log my profits in a file onExit()

how can i log to a .txt file and make the name of the file dynamic using the accounts name?

 

thx in advance for any help.

Link to comment
Share on other sites

13 minutes ago, mattpew said:

Is it possible to move the camera while my script is running to bank?


if (getBank().open()){
    getCamera().movePitch(22);
    getCamera().moveYaw(303);
}

currently it runs to the bank and then turns the camera. How can i make it run to the bank and while running turn?

 

2nd question, i want to log my profits in a file onExit()

how can i log to a .txt file and make the name of the file dynamic using the accounts name?

 

thx in advance for any help.


1. Maybe just stop walking when the bank booth is nearby and then call getBank().open(); It will walk there & probably move the camera at the same time:
 

if (getObjects().closest("Bank booth or whatever its called") == null) {
    WebWalkEvent webWalkEvent = new WebWalkEvent(Banks.VARROCK_WEST);
    webWalkEvent.setBreakCondition(new Condition() {
        @Override
        public boolean evaluate() {
            return getObjects().closest("Bank booth or whatever its called") != null;
        }
    });
    execute(webWalkEvent);
} else {
    getBank().open();
}

2. Create a file in the data directory getDirectoryData() with the Player's name myPlayer().getName(), and then write to it. 100s of tutorials online on how to write files with Java.

Edited by Explv
  • Like 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...