Jump to content

How to set up cli parameters?


nowster

Recommended Posts

java -jar "osbot 2.4.81.jar" -login xx:xx -bot zz:zz:1234 -debug 5005 -script tests:10,20

    String pars;
    String[] parsSplitted;

    @[member='Override']
    public void onStart() throws InterruptedException {
        if (getParameters() != null) {

            pars = getParameters();
            parsSplitted = pars.split(",");

            log("First param: " + parsSplitted[0]);
            log("Second param: " + parsSplitted[1]);

        }

    }

After logging in im getting this: 

[INFO][Bot #1][08/06 01:38:27 PM]: Terminating script tests...java.lang.NullPointerException


[INFO][Bot #1][08/06 01:38:27 PM]: Script tests has exited!     at main.onStart(main.java:37)


        at org.osbot.rs07.event.ScriptExecutor.IIIIIiiIIiIi(vi:251)

        at org.osbot.rs07.event.ScriptExecutor.start(vi:10)

        at org.osbot.C.run(ur:39)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

        at java.lang.Thread.run(Unknown Source)

[INFO][Bot #1][08/06 01:38:27 PM]: Started script : tests

Edited by nowster
Link to comment
Share on other sites

  • 3 weeks later...

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