Advertisement
Guest User

Untitled

a guest
Oct 18th, 2016
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.76 KB | None | 0 0
  1. package hashy;
  2.  
  3. import org.dreambot.api.script.AbstractScript;
  4. import org.dreambot.api.script.Category;
  5. import org.dreambot.api.script.ScriptManifest;
  6.  
  7. /**
  8.  * Created by Hashtag on 18.10.2016.
  9.  */
  10. @ScriptManifest(category = Category.MISC, name = "MassAccounts", author = "Hashtag", version = 1.0, description = "Adds mass accounts to the client.")
  11. public class Main extends AbstractScript {
  12.  
  13.     @Override
  14.     public void onStart() {
  15.         new InputAccounts(this);
  16.     }
  17.  
  18.     public void start(String accs) {
  19.         String[] ss = accs.split("\n");
  20.         int i = 0;
  21.         for (String s : ss) {
  22.             String[] info = s.split(":");
  23.             addAccount(info[0],info[1],info[2],info.length > 3 ? info[3] : "");
  24.             log("Added account " + info[0]);
  25.             i++;
  26.         }
  27.         log(i + " accounts added. Reopen client =)");
  28.         stop();
  29.     }
  30.  
  31.     @Override
  32.     public int onLoop() {
  33.         return 200;
  34.     }
  35.  
  36. }
  37.  
  38. ^ MAIN CLASS ^
  39. v  GUI CLASS v
  40.  
  41. package hashy;
  42.  
  43. import javax.swing.*;
  44. import java.awt.*;
  45.  
  46. /**
  47.  * Created by Hashtag on 18.10.2016.
  48.  */
  49. public class InputAccounts extends JFrame {
  50.  
  51.     public InputAccounts(Main main) {
  52.         setTitle("Input accounts");
  53.         setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  54.         setPreferredSize(new Dimension(250, 300));
  55.         setLayout(new GridLayout(2,1));
  56.  
  57.         JTextArea accs = new JTextArea("nickname:email:pass:pin\nnickname:email:pass:\nnickname:email:pass");
  58.         getContentPane().add(accs);
  59.  
  60.         JButton btn = new JButton("Start adding");
  61.         btn.addActionListener(l -> {
  62.             main.start(accs.getText());
  63.             dispose();
  64.         });
  65.         getContentPane().add(btn);
  66.         pack();
  67.         setVisible(true);
  68.     }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement