import org.rsbot.script.Script; import org.rsbot.script.ScriptManifest; import org.rsbot.script.wrappers.RSComponent; import org.rsbot.event.listeners.PaintListener; import org.rsbot.util.GlobalConfiguration; import java.awt.*; import java.io.*; @ScriptManifest(authors = "Pork", name = "PINCracker", description = "Cracks bank PIN's.", version = 1.2) public class PINCracker extends Script implements PaintListener { private String username = "username"; // Change "username" to your RuneScape username private String password = "password"; // Change "password" to your RuneScape password private String pin = "0000"; // Change "0000" to the PIN you want to start cracking from private boolean logout = false; // Change "false" to "true" if you want to be logged out after the PIN is cracked private boolean useCommonPINs = true; // Change "false" to "true" if you want the bot to start by using the most common PIN's private String[] commonPINs = {"1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959", "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970", "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1987", "1989", "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2011", "2012", "2468", "1337", "0101", "0202", "0303", "0404", "0505", "0606", "0707", "0808", "0909", "1010", "1212", "1313", "1414", "1515", "1616", "1717", "1818", "1919", "2020", "2121", "2323", "2424", "2525", "2626", "2727", "2828", "2929", "3030", "3131", "3232", "3434", "3535", "3636", "3737", "3838", "3939", "4040", "4141", "4242", "4343", "4545", "4646", "4747", "4848", "4949", "5050", "5151", "5252", "5353", "5454", "5656", "5757", "5858", "5959", "6060", "6161", "6262", "6363", "6464", "6565", "6767", "6868", "6969", "7070", "7171", "7272", "7373", "7474", "7575", "7676", "7878", "7979", "8080", "8181", "8282", "8383", "8484", "8585", "8686", "8787", "8989", "9090", "9191", "9292", "9393", "9494", "9595", "9696", "9797", "9898", "9119", "6667", "1800", "8008", "8118", "8228", "8338", "8448", "8558", "8668", "8778", "8998", "9009", "9119", "9229", "9339", "9449", "9559", "9669", "9779", "9889", "0011", "0022", "0033", "0044", "0055", "0066", "0077", "0088", "0099", "1100", "1122", "1133", "1144", "1155", "1166", "1177", "1188", "1199", "2200", "2211", "2233", "2244", "2255", "2266", "2277", "2288", "2299", "3300", "3311", "3322", "3344", "3355", "3366", "3377", "3388", "3399", "4400", "4411", "4422", "4433", "4455", "4466", "4477", "4488", "4499", "5500", "5511", "5522", "5533", "5544", "5566", "5577", "5588", "5599", "6600", "6611", "6622", "6633", "6644", "6655", "6677", "6688", "6699", "7700", "7711", "7722", "7733", "7744", "7755", "7766", "7788", "7799", "8800", "8811", "8822", "8833", "8844", "8855", "8866", "8877", "8899", "9900", "9911", "9922", "9933", "9944", "9955", "9966", "9977", "9988"}; private int state; private int tried = 0; private long banktimeout = 10; private String startPIN = pin; private boolean commonPINsFinished = true; //Paint variables 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 boolean pinIsCracked = false; public boolean activateCondition() { return interfaces.get(13).isValid() || interfaces.getComponent(14, 34).isValid(); } public long bankTimeout() { return banktimeout; } public void enterCode(final String aPin) { if (!interfaces.get(13).isValid()) return; final RSComponent[] children = interfaces.get(13).getComponents(); state = 0; for (int i = 1; i < 5; i++) { if (children[i].containsText("?")) { state++; } } state = 4 - state; currentPIN = pin; if (!interfaces.get(759).isValid()) return; final RSComponent[] bankPin = interfaces.get(759).getComponents(); for (int i = 0; i < bankPin.length; i++) { if (bankPin[i].containsText(aPin.substring(state, state + 1))) { final RSComponent[] childrenBefore = interfaces.get(13).getComponents(); int stateBefore = 0; int stateAfter = 0; for (int j=1; j<5; j++) { if (childrenBefore[j].containsText("?")) stateBefore++; } bankPin[i].doClick(); sleep(500); while (stateBefore == stateAfter) { final RSComponent[] childrenAfter = interfaces.get(13).getComponents(); for (int k=1; k<5; k++) { if (childrenAfter[k].containsText("?")) stateAfter++; } sleep(500); } break; } } if (state >= 3) { sleep(300, 600); tried++; totalTried++; if (tried == 2) sleep(12000); else if(tried >= 3) { sleep(2000); if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled"))) pinIsCracked(); else { sleep(14000); tried = 0; while(game.isLoggedIn()) game.logout(true); } } int temp = 0; if (useCommonPINs && (totalTried <= commonPINs.length)) { if (totalTried == commonPINs.length) { temp = Integer.parseInt(startPIN); commonPINsFinished = true; } else temp = Integer.parseInt(commonPINs[totalTried]); } else { temp = Integer.parseInt(pin); temp++; if (useCommonPINs) { for (int i=0; i= 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; } } public void login() { if (interfaces.get(906).containsText("account has not logged out") || interfaces.get(596).containsText("account has not logged out")) mouse.click(382, 322, true); else if(interfaces.get(596).containsText("Error connecting")) mouse.click(382, 305, true); else if(interfaces.get(906).isValid()) { interfaces.get(906).getComponent(171).doClick(); while(interfaces.get(906).containsText("Entering game")) sleep(500); } else if (interfaces.get(596).isValid()) { if(interfaces.get(596).getComponent(65).getText().length() == 0) { interfaces.get(596).getComponent(65).doClick(); sleep(1000); keyboard.sendText(username, false); } if(interfaces.get(596).getComponent(71).getText().length() == 0) { interfaces.get(596).getComponent(71).doClick(); sleep(1000); keyboard.sendText(password, false); } interfaces.get(596).getComponent(51).doClick(); sleep(3000); } } public void pinIsCracked() { pinIsCracked = true; log("PIN SUCCESSFULLY CRACKED!"); log.warning("PIN: " + currentPIN); try { BufferedWriter out = new BufferedWriter(new FileWriter(new File(GlobalConfiguration.Paths.getSettingsDirectory(),"PINCracker.txt"))); out.write("Username: " + username); out.newLine(); out.write("Password: " + password); out.newLine(); out.write("PIN: " + currentPIN); log("Info wrote to " + GlobalConfiguration.Paths.getSettingsDirectory() + "\\PINCracker.txt"); out.close(); } catch (IOException e) { log.warning(e.getMessage()); } if (logout) { log("Logging out..."); while(game.isLoggedIn()) game.logout(false); stopScript(); } else { log("Staying logged in..."); mouse.setSpeed(8); while(true) { sleep(1000); if (random(0,60) == 50) { camera.setAngle(random(0,360)); mouse.moveRandomly(300); } while(!game.isLoggedIn()) login(); } } } public boolean onStart() { startTime = System.currentTimeMillis(); mouse.setSpeed(1); if (useCommonPINs) { pin = commonPINs[0]; currentPIN = commonPINs[0]; commonPINsFinished = false; } return true; } @Override public int loop() { if (game.isLoggedIn()) { if (interfaces.get(13).isValid()) { enterCode(pin); sleep(500,1000); } else if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled"))) pinIsCracked(); else bank.open(); } else login(); return random(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; if (!pinIsCracked) { if (commonPINsFinished) { g.setColor(new Color(0, 0, 255, 220)); 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); } else { g.setColor(new Color(0, 0, 255, 220)); g.fillRect(5, 5, 190, 75); 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.setFont(new Font("Arial", Font.BOLD, 10)); g.drawString("(Trying common PINs first)", 10, 60); g.setFont(new Font("Arial", Font.BOLD, 15)); g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 75); } } else { g.setColor(new Color(0, 255, 0, 220)); g.fillRect(5, 5, 190, 65); g.setFont(new Font("Arial", Font.BOLD, 20)); g.setColor(Color.WHITE); g.drawString("PIN CRACKED", 34, 25); g.setFont(new Font("Arial", Font.BOLD, 40)); g.drawString(currentPIN, 56, 62); } } }