Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LEAKED CODE ALERT!
- package com.loudpacks.util;
- import java.util.Locale;
- public final class OSTools
- {
- public static enum OSType {
- Windows, MacOS, Linux;
- };
- protected static OSType detectedOS;
- public static OSType getOperatingSystemType() {
- if (detectedOS == null) {
- String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
- if ((OS.indexOf("mac") >= 0) || (OS.indexOf("darwin") >= 0)) {
- detectedOS = OSType.MacOS;
- } else if (OS.indexOf("win") >= 0) {
- detectedOS = OSType.Windows;
- } else
- detectedOS = OSType.Linux;
- }
- return detectedOS;
- }
- }
- public static void launchClient(String path, String script, String clientUser, String clientPass, String botUser, String botPass, String world, String proxy, String params) {
- ProcessBuilder linuxBuilder = new ProcessBuilder("/bin/bash", "-c",
- "java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params);
- ProcessBuilder windowsBuilder = new ProcessBuilder("cmd.exe", "/c",
- "java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params);
- ProcessBuilder macBuilder = new ProcessBuilder("osascript", "-e",
- "tell application \"Terminal\" to do script \"java -jar " + path + " -Xmx750m -allow norandoms" + proxy + " -login " + clientUser + ":" + clientPass + " -bot " + botUser + ":" + botPass + ":1234" + " -world " + world + " -script " + script + ":" + params + "\"");
- try {
- switch(OSTools.getOperatingSystemType()){
- case Windows:
- Process p1 = windowsBuilder.start();
- break;
- case MacOS:
- Process p2 = macBuilder.start();
- break;
- case Linux:
- Process p3 = linuxBuilder.start();
- break;
- }
- } catch (IOException e1) {
- e1.printStackTrace();
- System.out.println(e1.getMessage());
- }
- }
- Your proxy string will have to include " -proxy ip:port", I did it like that so it can be optional.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement