Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Problems with running a script with ScriptManager


    Potbelly

    Recommended Posts

    Hey!

     

    I've been trying to run a new script from another script.

    This line of code gives me an error:

    Client.getInstance().getScriptManager().start("Name");

    image.png.1e0d563f67f478aa26c4103854015fc0.png

    Any clues to fixing it?

    I'm running this line of code in a private void.

    Link to comment
    Share on other sites

    Okay, I got more info from this post 


    My final code looks like this. Notice that the start function has to have a second parameter, even if you don't want to give any arguments

        ScriptManager sm = Client.getInstance().getScriptManager();
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(() -> {
            try{
                TimeUnit.SECONDS.sleep(3);
                sm.start("Cow Tanner", "");
            } catch(Exception e) { }
        });
        this.stop();

    Hope this helps someone!

    Link to comment
    Share on other sites

    • 10 months later...
    On 10/26/2022 at 5:52 PM, Potbelly said:

    Okay, I got more info from this post 


    My final code looks like this. Notice that the start function has to have a second parameter, even if you don't want to give any arguments

        ScriptManager sm = Client.getInstance().getScriptManager();
        ExecutorService executor = Executors.newSingleThreadExecutor();
        executor.submit(() -> {
            try{
                TimeUnit.SECONDS.sleep(3);
                sm.start("Cow Tanner", "");
            } catch(Exception e) { }
        });
        this.stop();

    Hope this helps someone!

    Thank you so much!!!

    Link to comment
    Share on other sites

    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
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.