Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Frame;
- import java.awt.Graphics2D;
- import java.awt.event.KeyEvent;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.PrintWriter;
- import java.util.ArrayList;
- import com.runemate.Boot;
- import com.runemate.game.api.client.paint.PaintListener;
- import com.runemate.game.api.hybrid.input.Keyboard;
- import com.runemate.game.api.hybrid.local.hud.interfaces.InterfaceComponent;
- import com.runemate.game.api.hybrid.local.hud.interfaces.Interfaces;
- import com.runemate.game.api.hybrid.util.calculations.Random;
- import com.runemate.game.api.script.framework.LoopingScript;
- public final class AccountCreator extends LoopingScript implements
- PaintListener {
- private String aSetting, targetName, targetPassword, createdAccounts = "";
- private InterfaceComponent currentTarget;
- ArrayList<Vector> startUp = new ArrayList<Vector>(),
- createCharacter = new ArrayList<Vector>(),
- startCreation = new ArrayList<Vector>(),
- finishCreation = new ArrayList<Vector>();
- String[] fiveWordPW = new String[] {
- "chime", "salvo" };
- String[] sevenWordPW = new String[] { "authors",
- "brachia", };
- String[] accountNames = new String[] { "zerker", "gamer", "gnome", "death",
- "party", "crunch", "broad", "hotty", "baby", "dude", "dood",
- "babe", "babes", "big", "slays", "ninja", "pretty", "guy", "funny",
- "wise", "monkey", "unicorn", "small", "throne", "knight",
- "princess", "magic", "hacker", "hacks", "white", "killz", "tiny",
- "large", "faithful", "lord", "jesus", "saviour", "plasma",
- "crazed", "black", "games", "game", "pizza", "dominos", "grand",
- "Smart" };
- String[] emails = new String[] { "gmail", "yahoo", "hotmail" };
- // create more names
- int[] nums = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- private boolean finishedTyping;
- private boolean savedAccount;
- @Override
- public void onStop() {
- for (Frame f : Frame.getFrames()) {
- f.dispose();
- }
- // com.runemate.game.api.hybrid.Environment.reload();
- try {
- // RunemateController.main(null);
- Boot.main("-login=urGMAIL@gmail.com:passwordHere:RS3", "-sdk",
- "-bot=\"Blakes Account Creator\"");
- } catch (Throwable e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // how to reliably close this connection...?
- }
- @Override
- public void onStart(String... args) {
- // Submit your PaintListener
- getEventDispatcher().addListener(this);
- // Sets the length of time in milliseconds to wait before calling onLoop
- // again
- // first 976, 11 - auto setup wait after click..
- // 744, 124 - do u want to keep these graphics settings? yes..always
- // wait for shit to load..
- // 596, 91 -or- 596, 89 - create free acount..wait for shit to load
- // 1420, 242 - randomize char..? couple times mayb?
- // 1420, 469 - done../continue to enlist --wait here
- // type tab to get you to age32-46, email, password..
- // 1420,97 - no news please..
- // 1420, 202 - randomise char name.. --no wait needed..
- // 744, 150/149/151 for exit to login.. --- 1420, 481 -- yes exit. then
- // create again =]
- // 1420, 459 - login/play now..what if we fail the name..then
- // logout and go again - 1477,69,1 --log -- logout -28,8
- // Mouse.move(new Interactable);
- createVectorTasks();
- setLoopDelay(400, 800);
- // Load script configuration
- aSetting = getSettings().getProperty("setting");
- }
- private void sleep(long i) {
- try {
- java.lang.Thread.sleep(i);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- private void setTargetName(String createdAccounts, String[] accountNames,
- int[] nums) {
- // create more names && make sure the targetName isn't in our
- // farm_accounts file..
- targetName = accountNames[Random.nextInt(0, accountNames.length - 1)]
- + accountNames[Random.nextInt(0, accountNames.length - 1)];
- for (int i = Random.nextInt(2, 4); i > 0; i--) {
- targetName += nums[Random.nextInt(0, nums.length - 1)];
- }
- targetName += "@" + emails[Random.nextInt(0, emails.length - 1)]
- + ".com";
- while (createdAccounts.contains(targetName)) {
- setTargetName(createdAccounts, accountNames, nums);
- }
- }
- private void typeAccountInformation() {
- sleep(250);
- Keyboard.typeKey(KeyEvent.VK_TAB);
- sleep(250);
- Keyboard.type(Random.nextInt(15, 46) + "", true); // + "" ?
- sleep(250);
- createdAccounts = FileReader.readAllLinesExcept("Farm_Accounts.txt",
- "Accounts");
- setTargetName(createdAccounts, accountNames, nums);
- System.out.println("targetName: " + targetName);
- // Keyboard.typeKey(targetName);
- Keyboard.type(targetName, true);
- sleep(700);
- // Keyboard.typeKey(KeyEvent.VK_TAB);
- // Keyboard.pressKey(a)
- targetPassword = sevenWordPW[Random.nextInt(0, sevenWordPW.length - 1)]
- + Random.nextInt(0, 9);
- Keyboard.type(targetPassword, false);
- sleep(600);
- if (Interfaces.getAt(1420, 120).getTextureId() == 19716) { // successfull
- // email =]
- } else {
- // failed
- startCreation.add(new Vector(744, 150));// failed x button
- startCreation.add(new Vector(1420, 483));// failed confirm
- }
- finishedTyping = true;
- System.out.println("finished typing..");
- }
- private void saveNewAccount() {
- if (targetName == null || targetName.isEmpty())
- return;
- createdAccounts = FileReader.readAllLinesExcept("Farm_Accounts.txt",
- "Accounts");
- PrintWriter out = null;
- System.out.println("print out");
- try {
- out = new PrintWriter(new File("Farm_Accounts.txt"));
- out.println("Accounts: ((Account, password))");
- // out.pr
- out.println(createdAccounts);
- out.println("Username: " + targetName + " Password: "
- + targetPassword + " Mousespeed: "
- + Random.nextInt(101, 133) + " Task: \"Tutorial Island\"");
- // could print the created target at the end of list? how do u
- // knowww....
- out.close();
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- System.out.println("failed print out");
- e.printStackTrace();
- }
- }
- private void createVectorTasks() {
- startUp.clear();
- createCharacter.clear();
- finishCreation.clear();
- startUp.add(new Vector(976, 7)); // auto setup...
- startUp.add(new Vector(744, 124)); // do you want to keep these
- // settings? yep.
- createCharacter.add(new Vector(596, 86));// create new account
- createCharacter.add(new Vector(1420, 36));// randomize char, maybe afew
- // times.
- createCharacter.add(new Vector(1420, 469));// done then wait
- // new events once 1420,97 isVisible()
- startCreation.add(new Vector(1420, 207)); // randomize char name //no
- // need 2 wait
- startCreation.add(new Vector(1420, 96));// no news plz
- // randomised char name can be invalid :/
- startCreation.add(new Vector(1420, 469));// login/playnow
- finishCreation.add(new Vector(906, 216));// skip email validation inside
- // lobby...
- finishCreation.add(new Vector(906, 489, 1));// logout directly from
- // looby
- // this button ^^ might not work all the time cause its small.
- // finishCreation.add(new Vector(1477, 69, 1));// logout -x
- // finishCreation.add(new Vector(26, 7));// logout confirm
- finishCreation.add(new Vector(1431, 12));// logout..?
- finishCreation.add(new Vector(1433, 10));// logout..?
- // a 2nd logout method..
- }
- private boolean handleVectors(ArrayList<Vector> vectors) {
- for (Vector v : vectors) {
- currentTarget = v.getInterface();
- if (currentTarget != null && currentTarget.isVisible()) {
- currentTarget.click();
- vectors.remove(v);
- sleep(400);
- return true;
- }
- }
- return false;
- }
- @Override
- public void onLoop() {
- if (handleVectors(startUp))
- return;
- if (isSessionOver())
- return;
- currentTarget = Interfaces.getAt(596, 86); // create account..
- if (currentTarget != null && currentTarget.isVisible()) {
- if (currentTarget.click()) {
- createVectorTasks();
- sleep(800);
- }
- return;
- }
- if (handleVectors(createCharacter)) {
- finishedTyping = false;
- savedAccount = false;
- return;
- }
- currentTarget = Interfaces.getAt(1420, 469);// done with character.
- if (currentTarget != null && currentTarget.isVisible()) {
- currentTarget.click();
- sleep(400);
- }
- if (loggedIn())
- return;
- else if (!finishedTyping) {
- currentTarget = Interfaces.getAt(1420, 75);
- if (currentTarget != null && currentTarget.isVisible()
- && currentTarget.getTextureId() != 19716) {
- Interfaces.getAt(1420, 207).click();
- sleep(1450);
- typeAccountInformation();
- currentTarget = Interfaces.getAt(1420, 79);
- while (currentTarget != null
- && currentTarget.getTextureId() != 19716) {
- Interfaces.getAt(1420, 207).click();// randomise?
- sleep(1200);
- }
- Interfaces.getAt(1420, 96).click();// no news plz
- sleep(250);
- // randomised char name can be invalid :/
- Interfaces.getAt(1420, 469).click();// login/playnow
- currentTarget = Interfaces.getAt(1420, 190);// play button
- // confirm
- int clicks = 0;
- while (!currentTarget.isVisible()) {// play button
- // confirmation..
- Interfaces.getAt(1420, 469).click();// actual play button
- if (++clicks > 3) {
- break;
- }
- sleep(300);
- }
- sleep(2600);
- if (Interfaces.getAt(1420, 190) == null
- || !Interfaces.getAt(1420, 190).isVisible()) {
- currentTarget = Interfaces.getAt(1420, 511);// exit button
- if (currentTarget.isVisible()) {
- currentTarget.click();
- sleep(200);
- Interfaces.getAt(1420, 487).click();// confirmation //
- // button } }
- }
- }
- }
- // exit early method..just gets you banneed
- /*
- * if (currentTarget.isVisible()) { saveNewAccount(); currentTarget
- * = Interfaces.getAt(1420, 511);// exit button if
- * (currentTarget.isVisible()) { currentTarget.click(); sleep(200);
- * Interfaces.getAt(1420, 487).click();// confirmation // button } }
- * else { currentTarget = Interfaces.getAt(1420, 511);// exit button
- * if (currentTarget.isVisible()) { currentTarget.click();
- * sleep(200); Interfaces.getAt(1420, 487).click();// confirmation
- * // button } }
- */// exit early method...
- // } else if (handleVectors(startCreation))
- // return;
- /*
- * } else if (currentTarget != null && currentTarget.isVisible()) {
- * currentTarget = Interfaces.getAt(1420, 511);// exit button if
- * (currentTarget.isVisible()) { currentTarget.click(); sleep(200);
- * Interfaces.getAt(1420, 487).click();// confirmation // button }
- */// exit early method..jsut bans you though
- } else if (Interfaces.getAt(1420, 469) != null
- && Interfaces.getAt(1420, 469).isVisible()) {
- if (Interfaces.getAt(1420, 190) == null
- || !Interfaces.getAt(1420, 190).isVisible()) {
- currentTarget = Interfaces.getAt(1420, 511);// exit button
- if (currentTarget.isVisible()) {
- currentTarget.click();
- sleep(200);
- Interfaces.getAt(1420, 487).click();// confirmation //
- // button } }
- }
- }
- } else if (handleVectors(finishCreation)) {
- System.out.println("current targ: " + currentTarget);
- int logButtonCount = 0;
- for (Vector v : finishCreation) {
- if (v.x == 26 && v.y == 7 || (v.x == 1433 && v.y == 10)) {
- logButtonCount++;
- }
- }
- if (logButtonCount < 2) {
- createVectorTasks();
- }
- return;
- }
- }
- private boolean isSessionOver() {
- InterfaceComponent testFace = Interfaces.getAt(596, 138);
- InterfaceComponent testFace2 = Interfaces.getAt(906, 468);
- if (testFace != null
- && testFace.getText().contains("game session has now")
- || testFace2 != null
- && testFace2.getText().contains("game session has now")) {
- Interfaces.getAt(596, 48).click();
- this.stop();
- return true;
- }
- return false;
- }
- private boolean loggedIn() {
- if (com.runemate.game.api.hybrid.RuneScape.isLoggedIn()) {
- if (!savedAccount) {
- saveNewAccount();
- savedAccount = true;
- }
- currentTarget = Interfaces.getAt(548, 7);// esc button is showing.
- if (currentTarget != null) {
- Interfaces.getAt(548, 7).click();
- sleep(800);
- return true;
- }
- currentTarget = Interfaces.getAt(1433, 10);
- if (currentTarget != null && currentTarget.isVisible()) {
- currentTarget.click();// actual logout
- sleep(Random.nextInt(1000, 1500));
- } else {
- currentTarget = Interfaces.getAt(1431, 12);
- if (currentTarget != null && currentTarget.isVisible()) {
- currentTarget.click();// logout tab
- sleep(900);
- }
- }
- return true;
- } else
- return false;
- }
- @Override
- public void onPaint(Graphics2D g2d) {
- }
- private class Vector {
- int x, y, z;
- Vector(int x, int y) {
- this.x = x;
- this.y = y;
- }
- Vector(int x, int y, int z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
- InterfaceComponent getInterface() {
- if (z != 0)
- return Interfaces.getAt(x, y, z);
- return Interfaces.getAt(x, y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement