Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package hashy;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- /**
- * Created by Hashtag on 18.10.2016.
- */
- @ScriptManifest(category = Category.MISC, name = "MassAccounts", author = "Hashtag", version = 1.0, description = "Adds mass accounts to the client.")
- public class Main extends AbstractScript {
- @Override
- public void onStart() {
- new InputAccounts(this);
- }
- public void start(String accs) {
- String[] ss = accs.split("\n");
- int i = 0;
- for (String s : ss) {
- String[] info = s.split(":");
- addAccount(info[0],info[1],info[2],info.length > 3 ? info[3] : "");
- log("Added account " + info[0]);
- i++;
- }
- log(i + " accounts added. Reopen client =)");
- stop();
- }
- @Override
- public int onLoop() {
- return 200;
- }
- }
- ^ MAIN CLASS ^
- v GUI CLASS v
- package hashy;
- import javax.swing.*;
- import java.awt.*;
- /**
- * Created by Hashtag on 18.10.2016.
- */
- public class InputAccounts extends JFrame {
- public InputAccounts(Main main) {
- setTitle("Input accounts");
- setDefaultCloseOperation(DISPOSE_ON_CLOSE);
- setPreferredSize(new Dimension(250, 300));
- setLayout(new GridLayout(2,1));
- JTextArea accs = new JTextArea("nickname:email:pass:pin\nnickname:email:pass:\nnickname:email:pass");
- getContentPane().add(accs);
- JButton btn = new JButton("Start adding");
- btn.addActionListener(l -> {
- main.start(accs.getText());
- dispose();
- });
- getContentPane().add(btn);
- pack();
- setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement