Jump to content

2 questions


Recommended Posts

Posted

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.

Posted (edited)
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

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