Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package masterbots;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.concurrent.ExecutionException;
- import java.util.concurrent.ExecutorService;
- import java.util.concurrent.Executors;
- import java.util.concurrent.Future;
- import accounts.Account;
- import accounts.World;
- import dropbots.DropBotLogic;
- import dropbots.DropBotUILauncher;
- import masterbots.LootBotLauncher;
- import realmrelay.data.Valuable;
- public class FULLINVBOTREGISTERER implements Runnable {
- private Account accountToVerify;
- public FULLINVBOTREGISTERER(Account account) {
- accountToVerify = account;
- }
- public int current;
- public int total;
- private static int poolSize = 40;
- public static boolean isRunning = false;
- public static ArrayList<Account> waitingForAnswer = new ArrayList<Account>();
- static int maxWaitingForAnswer = 0;
- @SuppressWarnings({ "rawtypes", "unchecked" }) // I truly dont know
- public static void getAllMulesWithValuableItems() throws ExecutionException, InterruptedException {
- maxWaitingForAnswer = 0;
- System.out.println("Running inventory checker...");
- waitingForAnswer.clear();
- ExecutorService service = Executors.newFixedThreadPool(poolSize);
- List<Future<Runnable>> futures = new ArrayList<Future<Runnable>>();
- try (BufferedReader br = new BufferedReader(new FileReader(LootBotLauncher.AccountFile))) {
- for (String line; (line = br.readLine()) != null;) {
- if (line.contains("'")) {
- maxWaitingForAnswer++;
- String email = line.substring(1, line.indexOf("': '"));
- String password = line.substring(line.indexOf("': '") + 4, line.indexOf("',"));
- Account e = new Account(email, password);
- Future f = service.submit(new FULLINVBOTREGISTERER(e));
- futures.add(f);
- } else {
- System.out.println("Found invalid line " + line);
- }
- }
- return;
- } catch (IOException e) {
- e.printStackTrace();
- }
- for (Future<Runnable> f : futures) {
- f.get();
- }
- System.out.println("Ended");
- service.shutdownNow();
- }
- public void run() {
- waitingForAnswer.add(accountToVerify);
- String charList;
- String email = accountToVerify.email;
- String password = accountToVerify.password;
- try {
- String emailBuff = email;
- String damnSon = email.replace("+", "%2B");
- email = emailBuff;
- URL url = new URL(
- "http://realmofthemadgodhrd.appspot.com/char/list?guid=" + damnSon + "&password=" + password);
- BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
- charList = in.readLine();
- in.close();
- if (charList.contains("<Equipment>")) {
- String s = charList.substring(charList.indexOf("<Equipment>") + 11, charList.indexOf("</Equipment>"));
- String s2[] = s.split(",");
- int numberOfItems = 0;
- for (int i = 4; i < s2.length; i++) {
- int item = Integer.parseInt(s2[i]);
- if (item != -1) {
- numberOfItems++;
- }
- }
- if (numberOfItems == 6) {
- for (Account yeezus : World.availableMasterBots) {
- if (yeezus.email.equals(accountToVerify.email)) {
- World.availableMasterBots.remove(yeezus);
- System.out.println("Removed " + accountToVerify.email + " becuz full inv bot");
- }
- }
- }
- }
- waitingForAnswer.remove(accountToVerify);
- } catch (Exception ex) {
- System.err.println("ERROR ");
- ex.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement