Advertisement
CBladez

Untitled

Aug 3rd, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.94 KB | None | 0 0
  1. // ==UserScript==
  2. // @name pokemon vortex tools
  3. // @version 0.8
  4. // @description tools, wonderful tools
  5. // @author awkward_potato
  6. // @require http://code.jquery.com/jquery-1.11.0.min.js
  7. // @match *.pokemon-vortex.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /**********LOGIN SETTING**********/
  12. var autoLogin = false; //auto-login when logged out
  13.  
  14. var username = "";
  15. var password = "";
  16.  
  17. /**********ON/OFF SETTINGS**********/
  18. var doBattle = true; //enable battles same battle over and over again
  19. var forceBattle = true; //enable being sent to the battle url when at dashboard
  20. var findPokemon = true; //enable finding pokemon alerts
  21. var findLevels = false; //enable find specific pokemon levels
  22. var findLevelsAndUp = false; //enable finding pokemon levels and up
  23. var autoWalkFind = true; //enable walking+finding without you doing work
  24.  
  25. /**********FINDING SETTINGS**********/
  26. var pokemonToFind = ["Shiny","Shadow","Mystic"]; //the pokemon you want to be alerted of
  27. //make sure you get the right spelling
  28. //TIP: You can also use the above setting as
  29. //a general keyword searcher in the pokemon you see
  30. //e.g. "shiny", "dark"
  31.  
  32. var levelsToFind = ["9"]; //The specific levels you want to be alerted for
  33. //keep this a string array
  34.  
  35. var levelsAndUpToFind = 30; //level and up to alert about pokemon
  36. //dont make this a string or array
  37.  
  38. var scanFreq = 75; //time to wait between every time the script checks if you saw what you wanted (in milliseconds)
  39.  
  40. var isDoneLoadingFreq = 400; //time to wait between checking if looking for pokemon has finished loading (in milli)
  41. //dont make this too low (keep it how it is, it works fine) unless you have very super speedy internet
  42. //THE LOWER THIS IS THE HIGHER CHANCE YOU HAVE OF LOSING A LEGEND
  43.  
  44. /**********FIGHTING SETTINGS**********/
  45. var battle = "/battle.php?bid=";
  46. //change this to your battle url, but make sure you remove everything up to the /battle.php?jglasd=dfjklgdfj
  47. //Even though it does automatically :P
  48.  
  49. var firstPokemonPrefAtt = 0; // 0 = don't pick
  50. var seconPokemonPrefAtt = 0; // 0 = don't pick
  51. var thirdPokemonPrefAtt = 0; // 0 = don't pick
  52. var fourtPokemonPrefAtt = 0; // 0 = don't pick
  53. var fifthPokemonPrefAtt = 0; // 0 = don't pick
  54. var sixthPokemonPrefAtt = 0; // 0 = don't pick
  55.  
  56. var firstPokemonName = ""; // These names just need to be unique
  57. var seconPokemonName = ""; // Capitalization is ignored
  58. var thirdPokemonName = ""; // if empty it will be skipped
  59. var fourtPokemonName = ""; // if not found it will be skipped
  60. var fifthPokemonName = ""; // Make sure you spell right :p
  61. var sixthPokemonName = ""; //
  62. var attackFreq = 100; //time to wait between every click while fighting (in milliseconds)
  63.  
  64. /**********IGNORE EVERYTHING PAST THIS**********/
  65. var pokeNames = [firstPokemonName, seconPokemonName, thirdPokemonName, fourtPokemonName, fifthPokemonName, sixthPokemonName];
  66. var pokeAtts = [firstPokemonPrefAtt, seconPokemonPrefAtt, thirdPokemonPrefAtt, fourtPokemonPrefAtt, fifthPokemonPrefAtt, sixthPokemonPrefAtt];
  67. var battleUrl = ".pokemon-vortex.com/battle.php";
  68. var findUrl = ".pokemon-vortex.com/map.php";
  69. var loginUrl = "www.pokemon-vortex.com/login.php";
  70. var dashboardUrl = ".pokemon-vortex.com/dashboard.php";
  71. var attTimes = 0;
  72. var moveTimes = 0;
  73.  
  74. if(battle.indexOf(".com")>-1){
  75. battle = battle.split(".com")[1];
  76. }
  77.  
  78. if (doBattle && window.location.href.indexOf(battleUrl) > -1) {
  79. function startBattle() {
  80. for(var d = 0; d < 6; d++)
  81. if(pokeAtts[d] !== 0 && $("h3:contains('Your')").text().toLowerCase().indexOf(pokeNames[d].toLowerCase()) > -1 && pokeNames[d] !== "")
  82. $("input#attack"+pokeAtts[d]).click();
  83.  
  84. if($("input[value*='Continue']").length)
  85. $("input[value*='Continue']").submit();
  86. if($("input[value*='Attack']").length)
  87. $("input[value*='Attack']").submit();
  88. if($("a:contains('Rebattle Opponent')").length)
  89. $("a:contains('Rebattle Opponent')").click();
  90. }
  91. if (window.location.href.indexOf(battle) >-1) {
  92. setInterval(function () {
  93. if($("#loading").css("visibility") == "hidden"){
  94. startBattle();
  95. attTimes = 0;
  96. }else{
  97. attTimes++;
  98. }
  99. if(times >= 100)
  100. location.reload(true);
  101.  
  102. }, attackFreq);
  103. } else {
  104. window.location.href = battle;
  105. }
  106. }else if ((findPokemon || findLevels || findLevelsAndUp) && window.location.href.indexOf(findUrl) > -1) {
  107. var a;
  108. var b;
  109. var finderOn = false;
  110. var whichMove = 1;
  111.  
  112. function fireKey(el, key) {
  113. //Set key to corresponding code. This one is set to the left arrow key.
  114. //37 = left, 38 = up, 39 = right, 40 = down;
  115. if (document.createEventObject) {
  116. var eventObj = document.createEventObject();
  117. eventObj.keyCode = key;
  118. el.fireEvent("onkeydown", eventObj);
  119. } else if (document.createEvent) {
  120. var eventObj = document.createEvent("Events");
  121. eventObj.initEvent("keydown", true, true);
  122. eventObj.which = key;
  123. el.dispatchEvent(eventObj);
  124. }
  125. }
  126.  
  127.  
  128. function found(thing){
  129. if($('#pkmnappear').first().html().toLowerCase().indexOf(thing.toLowerCase()) > -1){
  130. alert("WOAH THERE FRIEND YOU MIGHT NEED TO SLOW DOWN!!!");
  131. finderOn = false;
  132. clearInterval(a);
  133. if(autoWalkFind){
  134. clearInterval(b);
  135. }
  136. return true;
  137. }else{
  138. return false;
  139. }
  140. }
  141.  
  142. function setFinder(){
  143. finderOn = true;
  144.  
  145. if(autoWalkFind){
  146. b = setInterval(function(){
  147. var isLoading = $("#pkmnappear").text().indexOf("Please wait") > -1;
  148. if(!isLoading){
  149. switch(whichMove){
  150. case 1:
  151. fireKey(document,37);
  152. whichMove = 2;
  153. break;
  154. case 2:
  155. fireKey(document,38);
  156. whichMove = 3;
  157. break;
  158. case 3:
  159. fireKey(document,39);
  160. whichMove = 4;
  161. break;
  162. case 4:
  163. fireKey(document,40);
  164. whichMove = 1;
  165. break;
  166. }
  167. moveTimes=0;
  168. }else{
  169. moveTimes++;
  170. }
  171. if(moveTimes >= 100)
  172. location.reload(true);
  173. },isDoneLoadingFreq);
  174. }
  175.  
  176. a = setInterval(function () {
  177. if(findPokemon)
  178. for (var i = 0; i < pokemonToFind.length; i++)
  179. found(pokemonToFind[i]);
  180.  
  181. if(findLevels)
  182. for (var i = 0; i < levelsToFind.length; i++)
  183. found("Level: " + levelsToFind[i] + " ");
  184.  
  185. if(findLevelsAndUp)
  186. for(var l = levelsAndUpToFind; l<101;l++)
  187. if (found("Level: " + l + " "))
  188. break;
  189.  
  190. }, scanFreq);
  191. }
  192.  
  193. setFinder();
  194. $(document).keydown(function(event) {
  195. switch (event.keyCode) {
  196. case 37: case 38: case 39: case 40: case 87: case 65: case 83: case 68: if(!finderOn)setFinder();
  197. break;
  198. }
  199. });
  200.  
  201. }else if(autoLogin && window.location.href.indexOf(loginUrl) > -1){
  202. $("#myusername").val(username);
  203. $("#mypassword").val(password);
  204. $("input[value*='Log in']").click();
  205. $("input[value*='Log in']").submit();
  206. }else if(forceBattle && window.location.href.indexOf(dashboardUrl) > -1){
  207. window.location.href = battle;
  208. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement