Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color;
- import java.awt.Font;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.util.Map;
- import org.rsbot.bot.Bot;
- import java.io.*;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.wrappers.RSNPC;
- @ScriptManifest( authors = { "Botter118" }, category = "CCTools", name = "AccountCreator", description = "Account Creator"
- + "An asterisk next to a name in SucceededNames.txt means we skipped the tutorial")
- public class AccountCreator extends Script implements PaintListener {
- public String pass;
- public String[] letter1 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String[] letter2 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
- public String[] letter3 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
- public String[] letter4 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", " ", " ", " ", " ", " " };
- public String[] letter5 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m"};
- public String[] letter6 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", " ", " ", " ", " ", " ", "_" };
- public String[] letter7 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] letter8 = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", " ", " ", " ", " ", " ", " ", " ", " " };
- public String[] letter9 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String[] letter10 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String[] letter11 = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] letter12 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String name;
- public String[] usedNames = new String[100000];
- public int usedNamesNextPoint = 0;
- public Boolean accountUsed = false;
- public String[] pass1 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String[] pass2 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
- public String[] pass3 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" };
- public String[] pass4 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] pass5 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m"};
- public String[] pass6 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] pass7 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] pass8 = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"};
- public String[] pass9 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public String[] pass10 = { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", "z", "x", "c", "v", "b", "n", "m" };
- public RSInterfaceChild tutText = getInterface(896, 6);
- public RSInterfaceChild tutClick = getInterface(896, 4);
- public Boolean shouldSkip = true;
- public Boolean skipped = false;
- public RSNPC vant, goblin, vant2, roddeck;
- public int[] NPCIDs = {8850, 8862, 8848, 8867};
- public int[] armoursonfloor = {1117, 1173, 1277};
- public RSTile referenceTile;
- public void getUsedNames() {
- try{
- File file = new File("TriedNames.txt");
- @SuppressWarnings("unused")
- boolean create = file.createNewFile();
- BufferedReader br = new BufferedReader(new FileReader("TriedNames.txt"));
- String thisLine = br.readLine();
- while(thisLine != null) {
- String aName = thisLine;
- usedNames[usedNamesNextPoint] = aName;
- usedNamesNextPoint++;
- thisLine = br.readLine();
- }
- try{
- if(br != null)
- br.close();
- }catch(IOException e) {
- }
- }catch(IOException e) {
- }
- }
- public boolean checkNames() {
- for(int i = 0; i == usedNames.length; i++) {
- if(usedNames[i].equalsIgnoreCase(name)) {
- log("Avoiding " + name + ", we've already tried it!");
- return false;
- }
- }
- return true;
- }
- public void newName() {
- name = letter1[random(0, letter1.length-1)].toUpperCase();
- name = name + letter2[random(0, letter2.length-1)];
- name = name + letter3[random(0, letter3.length-1)];
- name = name + letter4[random(0, letter4.length-1)];
- name = name + letter5[random(0, letter5.length-1)].toUpperCase();
- name = name + letter6[random(0, letter6.length-1)];
- name = name + letter7[random(0, letter7.length-1)];
- name = name + letter8[random(0, letter8.length-1)];
- name = name + letter9[random(0, letter9.length-1)].toUpperCase();
- if(random(1, 3) == 1) {
- name = name + letter10[random(0, letter10.length-1)];
- name = name + letter11[random(0, letter11.length-1)];
- name = name + letter12[random(0, letter12.length-1)];
- }else if(random(1, 2) == 1) {
- name = name + letter10[random(0, letter10.length-1)];
- name = name + letter11[random(0, letter11.length-1)];
- }else{
- name = name + letter10[random(0, letter10.length-1)];
- }
- log("The name of the next account is: " + name);
- }
- public void newPass() {
- if(random(1, 6) == 1) {
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- pass = pass + pass6[random(0, pass6.length-1)];
- pass = pass + pass7[random(0, pass7.length-1)];
- pass = pass + pass8[random(0, pass8.length-1)];
- pass = pass + pass9[random(0, pass9.length-1)];
- pass = pass + pass10[random(0, letter10.length-1)];
- }else if(random(1, 5) ==1 ) {
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- pass = pass + pass6[random(0, pass6.length-1)];
- pass = pass + pass7[random(0, pass7.length-1)];
- pass = pass + pass8[random(0, pass8.length-1)];
- pass = pass + pass9[random(0, pass9.length-1)];
- }else if(random(1, 4) == 1) {
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- pass = pass + pass6[random(0, pass6.length-1)];
- pass = pass + pass7[random(0, pass7.length-1)];
- pass = pass + pass8[random(0, pass8.length-1)];
- }else if(random(1, 3) == 1) {
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- pass = pass + pass6[random(0, pass6.length-1)];
- pass = pass + pass7[random(0, pass7.length-1)];
- }else if(random(1, 2) == 1) {
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- pass = pass + pass6[random(0, pass6.length-1)];
- }else{
- pass = pass1[random(0, pass1.length-1)];
- pass = pass + pass2[random(0, pass2.length-1)];
- pass = pass + pass3[random(0, pass3.length-1)];
- pass = pass + pass4[random(0, pass4.length-1)];
- pass = pass + pass5[random(0, pass5.length-1)];
- }
- log("The password for the next account is: " + pass);
- }
- public void createAccount(String name2) {
- sendText(name2, false);
- wait(random(200, 1000));
- moveMouse(389, 224, 170, 10);
- wait(random(0, 100));
- clickMouse(true);
- wait(random(2000, 3200));
- if(getInterface(673, 12).getText().length() > 16) {
- accountUsed = true;
- return;
- }
- sendText(pass, false);
- moveMouse(389, 297, 170, 10);
- wait(random(0, 100));
- clickMouse(true);
- wait(random(700, 800));
- sendText(pass, false);
- wait(random(200, 400));
- moveMouse(198, 407, 367, 30);
- wait(random(0, 500));
- clickMouse(true);
- wait(random(700, 1500));
- moveMouse(261, 297, 240, 30);
- wait(random(0, 300));
- clickMouse(true);
- }
- public void login(String name2) {
- moveMouse(255, 215, 255, 17);
- wait(random(0, 500));
- clickMouse(true);
- wait(random(0, 300));
- sendText(name2, false);
- wait(random(0, 200));
- moveMouse(255, 267, 255, 17);
- wait(random(0, 500));
- clickMouse(true);
- wait(random(0, 300));
- sendText(pass, false);
- wait(random(0, 20));
- moveMouse(253, 308, 253, 30);
- wait(random(0, 200));
- clickMouse(true);
- wait(random(700, 1300));
- moveMouse(269, 296, 228, 20);
- wait(random(20, 700));
- clickMouse(true);
- }
- public void logoutToLogin() {
- while (!isOnLogoutTab()) {
- atInterface(548, 175);
- while (!isOnLogoutTab()) {
- wait(random(200, 400));
- }
- }
- atInterface(182, 15);
- wait(random(1500, 2000));
- }
- public Boolean doTut() { //Original code - Frederick
- if(tutText.isValid() && shouldSkip) {
- atInterface(tutClick);
- wait(random(600, 800));
- if(getInterface(212, 1).containsText("Warning")) {
- skipped = true;
- moveMouse(138, 452, 230, 6);
- wait(random(30, 600));
- clickMouse(true);
- wait(random(400, 700));
- moveMouse(196, 398, 200, 7);
- wait(random(30, 600));
- clickMouse(true);
- wait(random(7000, 9000));
- return true;
- }else{
- shouldSkip = false;
- return false;
- }
- }
- if (interfaceThatContains("Controls") != null) {
- int key = java.awt.event.KeyEvent.VK_UP;
- Bot.getInputManager().pressKey((char) key);
- wait(random(1000, 1500));
- Bot.getInputManager().releaseKey((char) key);
- key = (random(0, 2) == 0) ? java.awt.event.KeyEvent.VK_LEFT : java.awt.event.KeyEvent.VK_RIGHT;
- Bot.getInputManager().pressKey((char) key);
- wait(random(1000, 1500));
- Bot.getInputManager().releaseKey((char) key);
- return false;
- }
- if (interfaceThatContains("Rotate the camera using the arrow") != null || interfaceThatContains("Talk to Sir vant to find out") != null) {
- if (interfaceThatContains("Great, you've got the dragon in the right place") != null) {
- vant = getNearestNPCByID(NPCIDs[2]);
- }else{
- vant = getNearestNPCByID(NPCIDs[0]);
- }
- if (vant == null) {
- return false;
- }
- if (!pointOnScreen(vant.getScreenLocation())) {
- walkTo(vant.getLocation());
- waitUntilNotMoving();
- }
- if(interfaceThatContains("Rotate the camera using the arrow") != null) {
- atNPC(vant, "Talk");
- waitUntilNotMoving();
- wait(random(200, 1000));
- moveMouse(138, 450, 50, 10);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(600, 900));
- moveMouse(138, 450, 50, 10);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(9000, 13000));
- moveMouse(138, 450, 50, 10);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(400, 500));
- }else{
- atNPC(vant, "Talk");
- waitUntilNotMoving();
- wait(random(200, 1000));
- moveMouse(138, 450, 50, 10);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(600, 900));
- }
- return false;
- }
- if (interfaceThatContains("Right-click on the items on the floor") != null) {
- RSItemTile stuff = getNearestGroundItemByID(armoursonfloor);
- while (stuff != null) {
- atTile(stuff, "Take");
- wait(random(500, 750));
- stuff = getNearestGroundItemByID(armoursonfloor);
- }
- return false;
- }
- if (interfaceThatContains("Click on the flashing") != null) {
- if (interfaceThatContains("worn items") != null) {
- openTab(TAB_EQUIPMENT);
- } else if (interfaceThatContains("quest journal") != null) {
- openTab(TAB_QUESTS);
- } else if (interfaceThatContains("objectives") != null) {
- atInterface(interfaceThatHasActions("Objectives"));
- } else if (interfaceThatContains("stats") != null) {
- openTab(TAB_STATS);
- } else {
- openTab(TAB_INVENTORY);
- }
- return false;
- }
- if (interfaceThatContains("Right-click on an item in your inventory") != null) {
- while (getInventoryCount(1117) == 1) {
- atInventoryItem(1117, "Wear");
- wait(random(500, 750));
- }
- while (getInventoryCount(1173) == 1) {
- atInventoryItem(1173, "Wield");
- wait(random(500, 750));
- }
- while (getInventoryCount(1277) == 1) {
- atInventoryItem(1277, "Wield");
- wait(random(500, 750));
- }
- return false;
- }
- if (interfaceThatContains("Your worn items screen shows you") != null) {
- while ((goblin = getNearestNPCByID(NPCIDs[1])) != null) {
- if (goblin.getAnimation() == 6182) {
- break;
- }
- if (!pointOnScreen(goblin.getScreenLocation())) {
- walkTo(goblin.getLocation());
- waitUntilNotMoving();
- }
- if (!getMyPlayer().isInCombat()) {
- atNPC(goblin, "Attack");
- wait(random(3000, 4000));
- }
- }
- return false;
- }
- if (interfaceThatContains("You'll see that Unstable Foundations is") != null) {
- moveMouse(random(564, 664), random(309, 314));
- clickMouse(true);
- return false;
- }
- if (interfaceThatContains("Now click on the world map") != null) {
- atInterface(interfaceThatHasActions("World Map"));
- return false;
- }
- if (interfaceThatContains("Click on the compass") != null) {
- while (RSInterface.getChildInterface(755, 0).getComponents().length > 0) {
- wait(random(100, 200));
- }
- atInterface(interfaceThatHasActions("Face North"));
- return false;
- }
- if (interfaceThatContains("Time to get on with the quest") != null) {
- if (interfaceThatContains("You'll need to climb over") != null) {
- RSObject hole = getNearestObjectByID(45603);
- atObject(hole, "Climb");
- return false;
- }
- RSObject bag = getNearestObjectByID(45783);
- while (getInventoryCount(15277) == 0) {
- if (!tileOnScreen(bag.getLocation())) {
- walkTo(bag.getLocation());
- waitUntilNotMoving();
- }
- atObject(bag, "Search");
- wait(random(6000, 7000));
- }
- return false;
- }
- if (interfaceThatContains("The wall is too high") != null) {
- RSObject plank = getNearestObjectByID(45652);
- setCameraAltitude(true);
- atObject(plank, "Take");
- return false;
- }
- if (interfaceThatContains("Right-click on the plank in your inventory") != null) {
- RSObject hole = getNearestObjectByID(45603);
- openTab(TAB_INVENTORY);
- while (getInventoryCount(15276) == 1) {
- atInventoryItem(15276, "Use");
- wait(random(750, 1000));
- atObject(hole, "Use");
- wait(random(2000, 3000));
- }
- wait(random(1000, 1500));
- return false;
- }
- if (interfaceThatContains("The ramp should make it possible for you") != null) {
- RSObject hole = getNearestObjectByID(45603);
- RSTile currentTile = getMyPlayer().getLocation();
- while (getMyPlayer().getLocation().getY() == currentTile.getY()) {
- atObject(hole, "Climb");
- wait(random(1000, 1500));
- while (getMyPlayer().getAnimation() != -1) {
- wait(100);
- }
- }
- wait(random(2000, 3000));
- return false;
- }
- if (getNearestObjectByID(45795) != null) {
- if (distanceTo(getNearestObjectByID(45795).getLocation()) < 5) {
- while (getInventoryCount(15277) == 1) {
- atInventoryItem(15277, "Use");
- wait(random(300, 500));
- atObject(getNearestObjectByID(45795), "Use");
- wait(random(3000, 5000));
- }
- return false;
- }
- }
- if (interfaceThatContains("Explore the cellar until") != null) {
- referenceTile = getNearestObjectByID(45563).getLocation();
- if (distanceTo(new RSTile(referenceTile.getX() - 1, referenceTile.getY() + 17)) > 5 && getMyPlayer().getLocation().getY() < referenceTile.getY() + 17) {
- walkTo(new RSTile(referenceTile.getX() - 1, referenceTile.getY() + 17));
- waitUntilNotMoving();
- setRun(true);
- walkTo(new RSTile(referenceTile.getX() - 1, referenceTile.getY() + 17));
- waitUntilNotMoving();
- }
- walkTo(new RSTile(referenceTile.getX() - 15, referenceTile.getY() + 24));
- waitUntilNotMoving();
- return false;
- }
- if (interfaceThatContains("Check the quest journal") != null) {
- setCameraAltitude(true);
- if (getInventoryCount(590) == 0) {
- RSObject bag = getNearestObjectByID(45783);
- while (getInventoryCount(590) == 0) {
- if (!tileOnScreen(bag.getLocation())) {
- walkTo(bag.getLocation());
- waitUntilNotMoving();
- }
- atObject(bag, "Search");
- wait(random(6000, 7000));
- }
- wait(random(500, 750));
- return false;
- }
- if (getInventoryCount(15278) == 1) {
- atInventoryItem(15278, "Rip");
- wait(random(500, 750));
- return false;
- }
- if (getInventoryCount(15280) > 0) {
- atInventoryItem(15284, "Use");
- wait(random(500, 750));
- atInventoryItem(15280, "Use");
- wait(random(500, 750));
- return false;
- }
- RSObject Pillar = getNearestObjectByID(45564);
- if (getInventoryCount(15281) == 2) {
- atInventoryItem(15281, "Use");
- wait(random(500, 750));
- atObject(Pillar, "Use");
- wait(random(1000, 1500));
- return false;
- }
- if (getInventoryCount(15282) == 1) {
- atInventoryItem(15282, "Use");
- wait(random(500, 750));
- atObject(Pillar, "Use");
- wait(random(1000, 1500));
- return false;
- }
- Pillar = getNearestObjectByID(45565);
- if (!tileOnScreen(Pillar.getLocation())) {
- walkTo(Pillar.getLocation());
- waitUntilNotMoving();
- wait(random(500, 750));
- return false;
- }
- if (getInventoryCount(15281) == 1) {
- atInventoryItem(15281, "Use");
- wait(random(500, 750));
- atObject(Pillar, "Use");
- wait(random(1000, 1500));
- return false;
- }
- if (getInventoryCount(15283) == 1) {
- atInventoryItem(15283, "Use");
- wait(random(500, 750));
- atObject(Pillar, "Use");
- wait(random(1000, 1500));
- return false;
- }
- }
- if (interfaceThatContains("give Sir vant a tinderbox") != null) {
- setCameraAltitude(true);
- vant = getNearestNPCByID(NPCIDs[2]);
- if (vant == null) {
- wait(random(500, 750));
- return false;
- }
- if (!pointOnScreen(vant.getScreenLocation())) {
- walkTo(vant.getLocation());
- waitUntilNotMoving();
- }
- while (getInventoryCount(590) > 1) {
- atInventoryItem(590, "Use");
- wait(random(500, 750));
- atNPC(vant, "Use");
- wait(random(2000, 3000));
- return false;
- }
- }
- if (interfaceThatContains("Use your tinderbox on the pillar") != null) {
- setCameraAltitude(true);
- RSObject Pillar = getNearestObjectByID(45565);
- if (!tileOnScreen(Pillar.getLocation())) {
- walkTo(Pillar.getLocation());
- waitUntilNotMoving();
- }
- atInventoryItem(590, "Use");
- wait(random(500, 750));
- atObject(Pillar, "Use");
- wait(random(3000, 400));
- return false;
- }
- if (interfaceThatContains("RUN! RUN! RUN!") != null) {
- RSObject Pillar = getNearestObjectByID(45565);
- walkTo(new RSTile(Pillar.getLocation().getX() + 7, Pillar.getLocation().getY()));
- wait(random(2000, 3000));
- return false;
- }
- if (interfaceThatContains("Congratulations, the dragon's dead!") != null) {
- roddeck = getNearestNPCByID(NPCIDs[3]);
- atNPC(roddeck, "Talk");
- wait(random(1000, 1500));
- return false;
- }
- if (interfaceThatContains("Click on the question mark button") != null) {
- atInterface(interfaceThatHasActions("Advisor"));
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("Sir vant wants his squire's kit back") != null) {
- openTab(TAB_EQUIPMENT);
- wait(random(500, 750));
- while (equipmentContains(1117)) {
- atEquippedItem(1117, "Remove");
- }
- while (equipmentContains(1173)) {
- atEquippedItem(1173, "Remove");
- }
- while (equipmentContains(1277)) {
- atEquippedItem(1277, "Remove");
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("To give Sir vant an item") != null) {
- openTab(TAB_INVENTORY);
- wait(random(500, 750));
- vant = getNearestNPCByID(NPCIDs[2]);
- if (!pointOnScreen(vant.getScreenLocation())) {
- walkTo(vant.getLocation());
- waitUntilNotMoving();
- }
- while (getInventoryCount(590) == 1) {
- atInventoryItem(590, "Use");
- wait(random(500, 750));
- atNPC(vant, "Use");
- wait(random(5000, 6000));
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("Okay, I'll get on with it") != null) {
- atInterface(interfaceThatContains("Okay, I'll get on with it"));
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("I'll mine through the rocks") != null) {
- atInterface(interfaceThatContains("I'll chop through the roots"));
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("Speak to roddeck, your advisor, about breaking") != null) {
- setCameraAltitude(true);
- roddeck = getNearestNPCByID(NPCIDs[3]);
- if (!pointOnScreen(roddeck.getScreenLocation())) {
- walkTo(roddeck.getLocation());
- waitUntilNotMoving();
- }
- atNPC(roddeck, "Talk");
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("While you've got a pickaxe") != null) {
- RSObject damagedWallRock = getNearestObjectByID(45595);
- if (!tileOnScreen(damagedWallRock.getLocation())) {
- walkTo(damagedWallRock.getLocation());
- waitUntilNotMoving();
- }
- atObject(damagedWallRock, "Mine");
- wait(random(5000, 6000));
- return false;
- }
- if (interfaceThatContains("While you've got a hatchet") != null) {
- RSObject roots = getNearestObjectByID(45598);
- if (!tileOnScreen(roots.getLocation())) {
- walkTo(roots.getLocation());
- waitUntilNotMoving();
- }
- atObject(roots, "Chop");
- wait(random(5000, 6000));
- return false;
- }
- if (interfaceThatContains("Your current objective is to raise your Mining level") != null) {
- setCameraAltitude(true);
- RSObject Rocks = getNearestObjectByID(45580);
- if (!tileOnScreen(Rocks.getLocation())) {
- walkTo(Rocks.getLocation());
- waitUntilNotMoving();
- }
- while (skills.getCurrentSkillLevel(STAT_MINING) < 2) {
- atObject(Rocks, "Mine");
- wait(random(2000, 3000));
- while (getMyPlayer().getAnimation() == 6747) {
- wait(random(100, 200));
- }
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("Your current objective is to raise your Woodcutting level") != null) {
- setCameraAltitude(true);
- RSObject treeRoots = getObjectAt(getNearestObjectByID(45589).getLocation().getX(), getNearestObjectByID(45589).getLocation().getY() + 1);
- if (!tileOnScreen(treeRoots.getLocation())) {
- walkTo(treeRoots.getLocation());
- waitUntilNotMoving();
- }
- while (skills.getCurrentSkillLevel(STAT_WOODCUTTING) < 2) {
- atObject(treeRoots, "Chop");
- wait(random(2000, 3000));
- while (getMyPlayer().getAnimation() == 879) {
- wait(random(100, 200));
- }
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("set yourself an objective") != null) {
- atInterface(interfaceThatHasActions("Objectives"));
- wait(random(1000, 1500));
- if (interfaceThatContains("Increase Woodcutting from") == null) {
- atInterface(interfaceThatHasActions("Give random objective"));
- }
- wait(random(1000, 1500));
- atInterface(interfaceThatContains("Increase Woodcutting from"));
- wait(random(500, 750));
- if (interfaceThatContains("Advisor") == null) {
- atInterface(interfaceThatHasActions("Advisor"));
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("advisor button") != null) {
- if (interfaceThatContains("How can I raise my") == null) {
- atInterface(interfaceThatHasActions("Advisor"));
- }
- wait(random(1000, 1500));
- if (interfaceThatContains("How can I raise my") == null) {
- wait(random(500, 750));
- return false;
- }
- atInterface(interfaceThatContains("How can I raise my"));
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("Your Mining level is now high enough") != null) {
- RSObject damagedWallRock = getNearestObjectByID(45595);
- if (damagedWallRock != null) {
- if (!tileOnScreen(damagedWallRock.getLocation())) {
- walkTo(damagedWallRock.getLocation());
- waitUntilNotMoving();
- }
- atObject(damagedWallRock, "Mine");
- wait(random(500, 750));
- return false;
- } else {
- damagedWallRock = getNearestObjectByID(45597);
- if (damagedWallRock == null) {
- return false;
- }
- atObject(damagedWallRock, "Climb");
- wait(random(750, 1000));
- while (getMyPlayer().getAnimation() == 12280 || getMyPlayer().isMoving()) {
- wait(random(100, 200));
- }
- wait(random(500, 750));
- return false;
- }
- }
- if (interfaceThatContains("Your Woodcutting level is now high enough") != null) {
- RSObject root = getNearestObjectByID(45598);
- if (root != null) {
- if (!tileOnScreen(root.getLocation())) {
- walkTo(root.getLocation());
- waitUntilNotMoving();
- }
- atObject(root, "Chop");
- wait(random(500, 750));
- return false;
- } else {
- root = getNearestObjectByID(45600);
- if (root == null) {
- return false;
- }
- atObject(root, "Climb");
- wait(random(750, 1000));
- while (getMyPlayer().isMoving()) {
- wait(random(100, 200));
- }
- wait(random(500, 750));
- return false;
- }
- }
- if (interfaceThatContains("Escape up the ladder to freedom!") != null) {
- openTab(TAB_INVENTORY);
- while (inventoryContains(15286)) {
- atInventoryItem(15286, "Drop");
- wait(random(500, 750));
- clickContinue();
- }
- while (inventoryContains(15285)) {
- atInventoryItem(15285, "Drop");
- wait(random(500, 750));
- clickContinue();
- }
- RSObject ladder = getNearestObjectByID(45784);
- if (ladder == null) {
- wait(random(500, 750));
- return false;
- }
- atInterface(interfaceThatHasActions("Face North"));
- if (distanceTo(ladder.getLocation()) > 3) {
- walkTo(ladder.getLocation());
- waitUntilNotMoving();
- }
- while (interfaceThatContains("Thank you again") == null) {
- ladder = getNearestObjectByID(45784);
- if (ladder == null) {
- break;
- }
- atTile(ladder.getLocation(), random(20, 50), 0.5, 1, "Climb");
- }
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("You're out!") != null) {
- vant = getNearestNPCByID(NPCIDs[2]);
- if (vant == null) {
- moveMouse(random(188, 332), random(444, 453));
- clickMouse(true);
- wait(random(500, 750));
- return false;
- }
- if (vant.isMoving()) {
- moveMouse(random(188, 332), random(444, 453));
- clickMouse(true);
- wait(random(500, 750));
- return false;
- }
- walkTo(vant.getLocation());
- setCameraAltitude(true);
- waitUntilNotMoving();
- if (!pointOnScreen(vant.getScreenLocation())) {
- walkTo(vant.getLocation());
- waitUntilNotMoving();
- }
- atNPC(vant, "Talk");
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("roddeck would like to offer you some") != null) {
- setCameraAltitude(true);
- roddeck = getNearestNPCByID(NPCIDs[3]);
- if (!pointOnScreen(roddeck.getScreenLocation())) {
- walkTo(roddeck.getLocation());
- waitUntilNotMoving();
- }
- atNPC(roddeck, "Talk");
- wait(random(500, 750));
- return false;
- }
- if (interfaceThatContains("You may now leave via the door") != null) {
- atInterface(interfaceThatHasActions("Face North"));
- RSObject door = getNearestObjectByID(45801);
- if (door == null) {
- return false;
- }
- atTile(door.getLocation(), random(20, 50), random(0.0, 1.0), 0, "Open");
- wait(random(500, 750));
- return false;
- }
- if (distanceTo(new RSTile(3204, 3246)) < 8) {
- return true;
- }
- return false;
- }
- public void waitUntilNotMoving() {
- wait(random(500, 600));
- while(getMyPlayer().isMoving()) {
- wait(random(200, 300));
- }
- wait(random(200, 600));
- }
- public int[] interfaceIDThatContains(String str) {
- if(Bot.getClient().getRSInterfaceCache() == null) {
- return null;
- }
- for(int i = 0; i < RSInterface.getAllInterfaces().length; i++) {
- if(RSInterface.getAllInterfaces()[i].isValid()) {
- for(int o = 0; o < RSInterface.getAllInterfaces()[i].getChildren().length; o++) {
- if(RSInterface.getAllInterfaces()[i].getChildren()[o].isValid()) {
- if(RSInterface.getAllInterfaces()[i].getChildren()[o].getComponents().length > 0) {
- for(int l = 0; l < RSInterface.getAllInterfaces()[i].getChildren()[o].getComponents().length; o++) {
- if(RSInterface.getAllInterfaces()[i].getChildren()[o].getComponents()[l].isValid()) {
- if(RSInterface.getAllInterfaces()[i].getChildren()[o].getComponents()[l].containsText(str)) {
- return new int[]{i, o, l};
- }
- }
- }
- }else{
- if(RSInterface.getAllInterfaces()[i].getChildren()[o].containsText(str)) {
- return new int[]{i, o};
- }
- }
- }
- }
- }
- }
- return null;
- }
- public RSInterfaceChild interfaceThatContains(String str) {
- if (Bot.getClient().getRSInterfaceCache() == null) {
- return null;
- }
- for (RSInterface interfaces : RSInterface.getAllInterfaces()) {
- if (interfaces.isValid()) {
- for (RSInterfaceChild children : interfaces.getChildren()) {
- if (children.isValid()) {
- if (children.getComponents().length > 0) {
- for (RSInterfaceComponent component : children.getComponents()) {
- if (component.isValid()) {
- if (component.containsText(str)) {
- return component;
- }
- }
- }
- } else {
- if (children.containsText(str)) {
- return children;
- }
- }
- }
- }
- }
- }
- return null;
- }
- public RSInterfaceChild interfaceThatHasActions(String str) {
- if (Bot.getClient().getRSInterfaceCache() == null) {
- return null;
- }
- for (RSInterface interfaces : RSInterface.getAllInterfaces()) {
- if (interfaces.isValid()) {
- for (RSInterfaceChild children : interfaces.getChildren()) {
- if (children.isValid()) {
- if (children.getComponents().length > 0) {
- for (RSInterfaceComponent component : children.getComponents()) {
- if (component.isValid() && component.getActions() != null) {
- if (component.getActions().length > 0) {
- if (component.getActions()[0] != null) {
- if (component.getActions()[0].contains(str)) {
- return component;
- }
- }
- }
- }
- }
- } else {
- if (children.getActions() != null) {
- if (children.getActions().length > 0) {
- if (children.getActions()[0] != null) {
- if (children.getActions()[0].contains(str)) {
- return children;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return null;
- }
- @Override
- public RSInterfaceChild getContinueChildInterface() {
- if (Bot.getClient().getRSInterfaceCache() == null) {
- return null;
- }
- RSInterface[] valid = RSInterface.getAllInterfaces();
- for (RSInterface iface : valid) {
- if (iface.getIndex() != 137 && iface.getIndex() != 752) {
- int len = iface.getChildCount();
- for (int i = 0; i < len; i++) {
- RSInterfaceChild child = iface.getChild(i);
- if (child.containsText("Click here to continue") && child.getWidth() > 30 && child.getAbsoluteY() > 337) {
- return child;
- }
- }
- }
- }
- return null;
- }
- @Override
- public boolean canContinue() {
- return getContinueChildInterface() != null;
- }
- @Override
- public boolean clickContinue() {
- RSInterfaceChild cont = getContinueChildInterface();
- return !(cont != null && cont.isValid()) || atInterface(cont);
- }
- public void exit() {
- moveMouse(572, 102, 10, 20);
- wait(random(20, 600));
- clickMouse(true);
- wait(random(300, 1000));
- }
- public void enterDate(int year) {
- //day
- wait(random(300, 600));
- moveMouse(82, 384, 15, 16);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(400, 700));
- moveMouse(35, 414, 37, 49);
- wait(random(0, 300));
- clickMouse(true);
- //month
- wait(random(300, 600));
- moveMouse(121, 384, 160, 16);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(400, 700));
- moveMouse(121, 414, 138, 49);
- wait(random(0, 300));
- clickMouse(true);
- //year
- wait(random(300, 600));
- moveMouse(308, 384, 90, 16);
- wait(random(0, 300));
- clickMouse(true);
- wait(random(1200, 1900));
- sendText(Integer.toString(year), true);
- wait(random(500, 900));
- //submit
- moveMouse(417, 381, 84, 22);
- wait(random(30, 600));
- clickMouse(true);
- wait(random(1000, 1500));
- //accept
- moveMouse(87, 203, 150, 21);
- wait(random(30, 400));
- clickMouse(true);
- wait(random(1000, 2000));
- }
- public int loop() {
- moveMouse(310, 391, 140, 14);
- wait(random(300, 700));
- clickMouse(true);
- wait(random(600, 1200));
- newName();
- newPass();
- while(!checkNames()) {
- newName();
- }
- try{
- BufferedWriter out = new BufferedWriter(new FileWriter("TriedNames.txt", true));
- out.write(name);
- out.newLine();
- out.close();
- }catch (Exception e){
- }
- wait(random(100, 400));
- createAccount(name);
- if(accountUsed) {
- exit();
- accountUsed = false;
- return random(300, 900);
- }
- wait(random(700, 1300));
- login(name);
- wait(random(4000, 6000));
- moveMouse(319, 398, 125, 19);
- wait(random(30, 800));
- clickMouse(true);
- wait(random(200, 300));
- shouldSkip = true;
- skipped = false;
- while(!doTut()) {
- wait(random(200, 600));
- doTut();
- }
- wait(random(300, 600));
- enterDate(random(1960, 1992));
- wait(random(600, 700));
- String myName = getMyPlayer().getName();
- log("Created account \"" + myName + "\", with the password \"" + pass + "\"");
- try{
- BufferedWriter out = new BufferedWriter(new FileWriter("SucceededNames.txt", true));
- out.write((skipped ? "*" : "") + "Username: " + myName + " - Password: " + pass);
- out.newLine();
- out.close();
- }catch (Exception e){//Catch exception if any
- }
- logoutToLogin();
- return 100;
- }
- public void onRepaint(Graphics grphcs) {
- }
- @Override
- public boolean onStart(final Map<String, String> args) {
- try{
- pass = args.get("pass");
- }catch(Exception e) {
- log.severe("Please enter a password");
- stopScript();
- }
- log("Your password: " + pass);
- getUsedNames();
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement