Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Start bot in java application

Featured Replies

I use this code to start the bot in a java application:

        String completeCLI = "java -jar \"root/Desktop/osbot.jar\"";
        System.out.println(completeCLI);
        Process proc = Runtime.getRuntime().exec(completeCLI);
        proc.waitFor();

This works in Windows, but not in Ubuntu. Anyone knows how I can start my client in Ubuntu?

 

11 minutes ago, The Undefeated said:

I use this code to start the bot in a java application:


        String completeCLI = "java -jar \"root/Desktop/osbot.jar\"";
        System.out.println(completeCLI);
        Process proc = Runtime.getRuntime().exec(completeCLI);
        proc.waitFor();

This works in Windows, but not in Ubuntu. Anyone knows how I can start my client in Ubuntu?

 

 

Tested and seems to work:

ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", "/home/user/explv/Downloads/OSBot 2.4.121.jar");
processBuilder.start();

 

Edited by Explv

  • Author
14 minutes ago, Explv said:

 

Tested and seems to work:


ProcessBuilder processBuilder = new ProcessBuilder("java", "-jar", "/home/user/explv/Downloads/OSBot 2.4.121.jar");
processBuilder.start();

 

But how can I add CLI parameters to it now? Can't figure that out.

ProcessBuilder doesn't allow a 3rd argument.

Edited by The Undefeated

16 minutes ago, The Undefeated said:

But how can I add CLI parameters to it now? Can't figure that out.

ProcessBuilder doesn't allow a 3rd argument.

The ProcessBuilder constructor accepts either a List<String> or String...

Each item in the List or String[] is one parameter of the command.

So, for example:

List<String> command = new ArrayList<>();
Collections.addAll(command, "java", "-jar", "/path/to/osbot.jar", "-script", "890:none");
ProcessBuilder pBuilder = new ProcessBuilder(command);

or

String[] command = {"java", "-jar", "/path/to/osbot.jar", "-script", "890:none"};
ProcessBuilder pBuilder = new ProcessBuilder(command);

or

ProcessBuilder pBuilder = new ProcessBuilder("java", "-jar", "/path/to/osbot.jar", "-script", "890:none");

 

Edited by Explv

  • Author
33 minutes ago, Explv said:

The ProcessBuilder constructor accepts either a List<String> or String...

Each item in the List or String[] is one parameter of the command.

So, for example:


List<String> command = new ArrayList<>();
Collections.addAll(command, "java", "-jar", "/path/to/osbot.jar", "-script", "890:none");
ProcessBuilder pBuilder = new ProcessBuilder(command);

or


String[] command = {"java", "-jar", "/path/to/osbot.jar", "-script", "890:none"};
ProcessBuilder pBuilder = new ProcessBuilder(command);

or


ProcessBuilder pBuilder = new ProcessBuilder("java", "-jar", "/path/to/osbot.jar", "-script", "890:none");

 

This only starts the bot and doesn't log it in.

String[] command = {"java","-jar","osbot.jar","-login \"The Undefeated\":password"};
        ProcessBuilder pBuilder = new ProcessBuilder(command);
        pBuilder.start();

Edited by The Undefeated

20 minutes ago, The Undefeated said:

This only starts the bot and doesn't log it in.


String[] command = {"java","-jar","osbot.jar","-login \"The Undefeated\":password"};
        ProcessBuilder pBuilder = new ProcessBuilder(command);
        pBuilder.start();

"-login" and "username:password" should be two separate items in the array:

String[] command = {"java","-jar","osbot.jar","-login", "\"The Undefeated\":password"};

 

  • Author
8 minutes ago, Explv said:

"-login" and "username:password" should be two separate items in the array:


String[] command = {"java","-jar","osbot.jar","-login", "\"The Undefeated\":password"};

 

Forgot to mention I already tested that and didn't even start, might be caused by the space in my name. Even tried it like this but won't start either.

String[] command = {"java","-jar","osbot.jar","-login", "\"The", "Undefeated\":password"};

 

Edited by The Undefeated

33 minutes ago, The Undefeated said:

Shows the exact same behavior as I stated in my comment above.

 

Oh sorry I thought you knew. You need your own login handler since all randoms are disabled, or if your using non-cli paramters and just using this to start simple scripts then you can remove the -norandoms flag in my code.

If you end up using the custom login handler, you will need to pass the bot login info as parameters since you cant access those hidden fields normally. You can make your own or I think Explv may have a snippet of some somewhere on here.

Edited by LoudPacks

  • Author
10 hours ago, LoudPacks said:

Oh sorry I thought you knew. You need your own login handler since all randoms are disabled, or if your using non-cli paramters and just using this to start simple scripts then you can remove the -norandoms flag in my code.

If you end up using the custom login handler, you will need to pass the bot login info as parameters since you cant access those hidden fields normally. You can make your own or I think Explv may have a snippet of some somewhere on here.

If you read my post above I said the whole client doesn't even start. I know what norandoms does and I have my own login handler but those make no sense if I can't even open the client.

EDIT: Got it working by putting my username in quotation marks.

 

Edited by The Undefeated

13 hours ago, The Undefeated said:

Forgot to mention I already tested that and didn't even start, might be caused by the space in my name. Even tried it like this but won't start either.


String[] command = {"java","-jar","osbot.jar","-login", "\"The", "Undefeated\":password"};

 

 

Try:

String[] command = {"java", "-jar", "osbot.jar", "-login", "\"\\\"The Undefeated\\\":password\""};

 

 

 

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.