Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.88 KB | None | 0 0
  1. import java.awt.Frame;
  2. import java.awt.Graphics2D;
  3. import java.awt.event.KeyEvent;
  4. import java.io.File;
  5. import java.io.FileNotFoundException;
  6. import java.io.PrintWriter;
  7. import java.util.ArrayList;
  8.  
  9. import com.runemate.Boot;
  10. import com.runemate.game.api.client.paint.PaintListener;
  11. import com.runemate.game.api.hybrid.input.Keyboard;
  12. import com.runemate.game.api.hybrid.local.hud.interfaces.InterfaceComponent;
  13. import com.runemate.game.api.hybrid.local.hud.interfaces.Interfaces;
  14. import com.runemate.game.api.hybrid.util.calculations.Random;
  15. import com.runemate.game.api.script.framework.LoopingScript;
  16.  
  17. public final class AccountCreator extends LoopingScript implements
  18. PaintListener {
  19. private String aSetting, targetName, targetPassword, createdAccounts = "";
  20. private InterfaceComponent currentTarget;
  21. ArrayList<Vector> startUp = new ArrayList<Vector>(),
  22. createCharacter = new ArrayList<Vector>(),
  23. startCreation = new ArrayList<Vector>(),
  24. finishCreation = new ArrayList<Vector>();
  25.  
  26. String[] fiveWordPW = new String[] {
  27. "chime", "salvo" };
  28.  
  29. String[] sevenWordPW = new String[] { "authors",
  30. "brachia", };
  31.  
  32. String[] accountNames = new String[] { "zerker", "gamer", "gnome", "death",
  33. "party", "crunch", "broad", "hotty", "baby", "dude", "dood",
  34. "babe", "babes", "big", "slays", "ninja", "pretty", "guy", "funny",
  35. "wise", "monkey", "unicorn", "small", "throne", "knight",
  36. "princess", "magic", "hacker", "hacks", "white", "killz", "tiny",
  37. "large", "faithful", "lord", "jesus", "saviour", "plasma",
  38. "crazed", "black", "games", "game", "pizza", "dominos", "grand",
  39. "Smart" };
  40.  
  41. String[] emails = new String[] { "gmail", "yahoo", "hotmail" };
  42.  
  43. // create more names
  44. int[] nums = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  45. private boolean finishedTyping;
  46. private boolean savedAccount;
  47.  
  48. @Override
  49. public void onStop() {
  50. for (Frame f : Frame.getFrames()) {
  51. f.dispose();
  52. }
  53. // com.runemate.game.api.hybrid.Environment.reload();
  54. try {
  55. // RunemateController.main(null);
  56. Boot.main("-login=urGMAIL@gmail.com:passwordHere:RS3", "-sdk",
  57. "-bot=\"Blakes Account Creator\"");
  58. } catch (Throwable e) {
  59. // TODO Auto-generated catch block
  60. e.printStackTrace();
  61. }
  62. // how to reliably close this connection...?
  63. }
  64.  
  65. @Override
  66. public void onStart(String... args) {
  67. // Submit your PaintListener
  68. getEventDispatcher().addListener(this);
  69. // Sets the length of time in milliseconds to wait before calling onLoop
  70. // again
  71. // first 976, 11 - auto setup wait after click..
  72. // 744, 124 - do u want to keep these graphics settings? yes..always
  73. // wait for shit to load..
  74. // 596, 91 -or- 596, 89 - create free acount..wait for shit to load
  75. // 1420, 242 - randomize char..? couple times mayb?
  76. // 1420, 469 - done../continue to enlist --wait here
  77. // type tab to get you to age32-46, email, password..
  78. // 1420,97 - no news please..
  79. // 1420, 202 - randomise char name.. --no wait needed..
  80. // 744, 150/149/151 for exit to login.. --- 1420, 481 -- yes exit. then
  81. // create again =]
  82. // 1420, 459 - login/play now..what if we fail the name..then
  83. // logout and go again - 1477,69,1 --log -- logout -28,8
  84. // Mouse.move(new Interactable);
  85.  
  86. createVectorTasks();
  87.  
  88. setLoopDelay(400, 800);
  89. // Load script configuration
  90. aSetting = getSettings().getProperty("setting");
  91. }
  92.  
  93. private void sleep(long i) {
  94. try {
  95. java.lang.Thread.sleep(i);
  96. } catch (InterruptedException e) {
  97. // TODO Auto-generated catch block
  98. e.printStackTrace();
  99. }
  100. }
  101.  
  102. private void setTargetName(String createdAccounts, String[] accountNames,
  103. int[] nums) {
  104. // create more names && make sure the targetName isn't in our
  105. // farm_accounts file..
  106. targetName = accountNames[Random.nextInt(0, accountNames.length - 1)]
  107. + accountNames[Random.nextInt(0, accountNames.length - 1)];
  108. for (int i = Random.nextInt(2, 4); i > 0; i--) {
  109. targetName += nums[Random.nextInt(0, nums.length - 1)];
  110. }
  111.  
  112. targetName += "@" + emails[Random.nextInt(0, emails.length - 1)]
  113. + ".com";
  114. while (createdAccounts.contains(targetName)) {
  115. setTargetName(createdAccounts, accountNames, nums);
  116. }
  117. }
  118.  
  119. private void typeAccountInformation() {
  120. sleep(250);
  121. Keyboard.typeKey(KeyEvent.VK_TAB);
  122. sleep(250);
  123. Keyboard.type(Random.nextInt(15, 46) + "", true); // + "" ?
  124. sleep(250);
  125. createdAccounts = FileReader.readAllLinesExcept("Farm_Accounts.txt",
  126. "Accounts");
  127.  
  128. setTargetName(createdAccounts, accountNames, nums);
  129. System.out.println("targetName: " + targetName);
  130. // Keyboard.typeKey(targetName);
  131. Keyboard.type(targetName, true);
  132. sleep(700);
  133. // Keyboard.typeKey(KeyEvent.VK_TAB);
  134.  
  135. // Keyboard.pressKey(a)
  136. targetPassword = sevenWordPW[Random.nextInt(0, sevenWordPW.length - 1)]
  137. + Random.nextInt(0, 9);
  138. Keyboard.type(targetPassword, false);
  139. sleep(600);
  140. if (Interfaces.getAt(1420, 120).getTextureId() == 19716) { // successfull
  141. // email =]
  142.  
  143. } else {
  144. // failed
  145. startCreation.add(new Vector(744, 150));// failed x button
  146. startCreation.add(new Vector(1420, 483));// failed confirm
  147. }
  148.  
  149. finishedTyping = true;
  150. System.out.println("finished typing..");
  151. }
  152.  
  153. private void saveNewAccount() {
  154. if (targetName == null || targetName.isEmpty())
  155. return;
  156. createdAccounts = FileReader.readAllLinesExcept("Farm_Accounts.txt",
  157. "Accounts");
  158. PrintWriter out = null;
  159. System.out.println("print out");
  160. try {
  161. out = new PrintWriter(new File("Farm_Accounts.txt"));
  162. out.println("Accounts: ((Account, password))");
  163. // out.pr
  164. out.println(createdAccounts);
  165. out.println("Username: " + targetName + " Password: "
  166. + targetPassword + " Mousespeed: "
  167. + Random.nextInt(101, 133) + " Task: \"Tutorial Island\"");
  168. // could print the created target at the end of list? how do u
  169. // knowww....
  170. out.close();
  171. } catch (FileNotFoundException e) {
  172. // TODO Auto-generated catch block
  173. System.out.println("failed print out");
  174. e.printStackTrace();
  175. }
  176.  
  177. }
  178.  
  179. private void createVectorTasks() {
  180. startUp.clear();
  181. createCharacter.clear();
  182. finishCreation.clear();
  183. startUp.add(new Vector(976, 7)); // auto setup...
  184. startUp.add(new Vector(744, 124)); // do you want to keep these
  185. // settings? yep.
  186.  
  187. createCharacter.add(new Vector(596, 86));// create new account
  188. createCharacter.add(new Vector(1420, 36));// randomize char, maybe afew
  189. // times.
  190. createCharacter.add(new Vector(1420, 469));// done then wait
  191. // new events once 1420,97 isVisible()
  192.  
  193. startCreation.add(new Vector(1420, 207)); // randomize char name //no
  194. // need 2 wait
  195. startCreation.add(new Vector(1420, 96));// no news plz
  196. // randomised char name can be invalid :/
  197. startCreation.add(new Vector(1420, 469));// login/playnow
  198.  
  199. finishCreation.add(new Vector(906, 216));// skip email validation inside
  200. // lobby...
  201. finishCreation.add(new Vector(906, 489, 1));// logout directly from
  202. // looby
  203. // this button ^^ might not work all the time cause its small.
  204. // finishCreation.add(new Vector(1477, 69, 1));// logout -x
  205. // finishCreation.add(new Vector(26, 7));// logout confirm
  206. finishCreation.add(new Vector(1431, 12));// logout..?
  207. finishCreation.add(new Vector(1433, 10));// logout..?
  208. // a 2nd logout method..
  209. }
  210.  
  211. private boolean handleVectors(ArrayList<Vector> vectors) {
  212. for (Vector v : vectors) {
  213. currentTarget = v.getInterface();
  214. if (currentTarget != null && currentTarget.isVisible()) {
  215. currentTarget.click();
  216. vectors.remove(v);
  217. sleep(400);
  218. return true;
  219. }
  220. }
  221. return false;
  222. }
  223.  
  224. @Override
  225. public void onLoop() {
  226. if (handleVectors(startUp))
  227. return;
  228. if (isSessionOver())
  229. return;
  230. currentTarget = Interfaces.getAt(596, 86); // create account..
  231. if (currentTarget != null && currentTarget.isVisible()) {
  232. if (currentTarget.click()) {
  233. createVectorTasks();
  234. sleep(800);
  235. }
  236. return;
  237. }
  238. if (handleVectors(createCharacter)) {
  239. finishedTyping = false;
  240. savedAccount = false;
  241. return;
  242. }
  243. currentTarget = Interfaces.getAt(1420, 469);// done with character.
  244. if (currentTarget != null && currentTarget.isVisible()) {
  245. currentTarget.click();
  246. sleep(400);
  247. }
  248. if (loggedIn())
  249. return;
  250. else if (!finishedTyping) {
  251. currentTarget = Interfaces.getAt(1420, 75);
  252. if (currentTarget != null && currentTarget.isVisible()
  253. && currentTarget.getTextureId() != 19716) {
  254. Interfaces.getAt(1420, 207).click();
  255. sleep(1450);
  256. typeAccountInformation();
  257. currentTarget = Interfaces.getAt(1420, 79);
  258. while (currentTarget != null
  259. && currentTarget.getTextureId() != 19716) {
  260. Interfaces.getAt(1420, 207).click();// randomise?
  261. sleep(1200);
  262. }
  263. Interfaces.getAt(1420, 96).click();// no news plz
  264. sleep(250);
  265. // randomised char name can be invalid :/
  266. Interfaces.getAt(1420, 469).click();// login/playnow
  267. currentTarget = Interfaces.getAt(1420, 190);// play button
  268. // confirm
  269. int clicks = 0;
  270. while (!currentTarget.isVisible()) {// play button
  271. // confirmation..
  272. Interfaces.getAt(1420, 469).click();// actual play button
  273. if (++clicks > 3) {
  274. break;
  275. }
  276. sleep(300);
  277. }
  278. sleep(2600);
  279. if (Interfaces.getAt(1420, 190) == null
  280. || !Interfaces.getAt(1420, 190).isVisible()) {
  281. currentTarget = Interfaces.getAt(1420, 511);// exit button
  282. if (currentTarget.isVisible()) {
  283. currentTarget.click();
  284. sleep(200);
  285. Interfaces.getAt(1420, 487).click();// confirmation //
  286. // button } }
  287. }
  288. }
  289. }
  290. // exit early method..just gets you banneed
  291. /*
  292. * if (currentTarget.isVisible()) { saveNewAccount(); currentTarget
  293. * = Interfaces.getAt(1420, 511);// exit button if
  294. * (currentTarget.isVisible()) { currentTarget.click(); sleep(200);
  295. * Interfaces.getAt(1420, 487).click();// confirmation // button } }
  296. * else { currentTarget = Interfaces.getAt(1420, 511);// exit button
  297. * if (currentTarget.isVisible()) { currentTarget.click();
  298. * sleep(200); Interfaces.getAt(1420, 487).click();// confirmation
  299. * // button } }
  300. */// exit early method...
  301. // } else if (handleVectors(startCreation))
  302. // return;
  303. /*
  304. * } else if (currentTarget != null && currentTarget.isVisible()) {
  305. * currentTarget = Interfaces.getAt(1420, 511);// exit button if
  306. * (currentTarget.isVisible()) { currentTarget.click(); sleep(200);
  307. * Interfaces.getAt(1420, 487).click();// confirmation // button }
  308. */// exit early method..jsut bans you though
  309. } else if (Interfaces.getAt(1420, 469) != null
  310. && Interfaces.getAt(1420, 469).isVisible()) {
  311. if (Interfaces.getAt(1420, 190) == null
  312. || !Interfaces.getAt(1420, 190).isVisible()) {
  313. currentTarget = Interfaces.getAt(1420, 511);// exit button
  314. if (currentTarget.isVisible()) {
  315. currentTarget.click();
  316. sleep(200);
  317. Interfaces.getAt(1420, 487).click();// confirmation //
  318. // button } }
  319. }
  320. }
  321. } else if (handleVectors(finishCreation)) {
  322. System.out.println("current targ: " + currentTarget);
  323. int logButtonCount = 0;
  324. for (Vector v : finishCreation) {
  325. if (v.x == 26 && v.y == 7 || (v.x == 1433 && v.y == 10)) {
  326. logButtonCount++;
  327. }
  328. }
  329. if (logButtonCount < 2) {
  330. createVectorTasks();
  331. }
  332. return;
  333. }
  334. }
  335.  
  336. private boolean isSessionOver() {
  337. InterfaceComponent testFace = Interfaces.getAt(596, 138);
  338. InterfaceComponent testFace2 = Interfaces.getAt(906, 468);
  339. if (testFace != null
  340. && testFace.getText().contains("game session has now")
  341. || testFace2 != null
  342. && testFace2.getText().contains("game session has now")) {
  343. Interfaces.getAt(596, 48).click();
  344. this.stop();
  345. return true;
  346. }
  347. return false;
  348. }
  349.  
  350. private boolean loggedIn() {
  351. if (com.runemate.game.api.hybrid.RuneScape.isLoggedIn()) {
  352. if (!savedAccount) {
  353. saveNewAccount();
  354. savedAccount = true;
  355. }
  356. currentTarget = Interfaces.getAt(548, 7);// esc button is showing.
  357. if (currentTarget != null) {
  358. Interfaces.getAt(548, 7).click();
  359. sleep(800);
  360. return true;
  361. }
  362. currentTarget = Interfaces.getAt(1433, 10);
  363. if (currentTarget != null && currentTarget.isVisible()) {
  364. currentTarget.click();// actual logout
  365. sleep(Random.nextInt(1000, 1500));
  366. } else {
  367. currentTarget = Interfaces.getAt(1431, 12);
  368. if (currentTarget != null && currentTarget.isVisible()) {
  369. currentTarget.click();// logout tab
  370. sleep(900);
  371. }
  372. }
  373. return true;
  374. } else
  375. return false;
  376. }
  377.  
  378. @Override
  379. public void onPaint(Graphics2D g2d) {
  380. }
  381.  
  382. private class Vector {
  383. int x, y, z;
  384.  
  385. Vector(int x, int y) {
  386. this.x = x;
  387. this.y = y;
  388. }
  389.  
  390. Vector(int x, int y, int z) {
  391. this.x = x;
  392. this.y = y;
  393. this.z = z;
  394. }
  395.  
  396. InterfaceComponent getInterface() {
  397. if (z != 0)
  398. return Interfaces.getAt(x, y, z);
  399. return Interfaces.getAt(x, y);
  400. }
  401. }
  402. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement