Advertisement
Guest User

Untitled

a guest
Mar 15th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Clicker to arena
  3. // @namespace   http://userscripts.org/
  4. // @include     http://www.neopets.com/dome/
  5. // @include     http://www.neopets.com/dome/fight.phtml
  6. // @version     1
  7. // @grant          GM_log
  8. // @grant          GM_addStyle
  9. // @grant          GM_getValue
  10. // @grant          GM_setValue
  11. // @grant          GM_openInTab
  12. // @grant          GM_deleteValue
  13. // @grant          GM_xmlhttpRequest
  14. // @grant          GM_getResourceText
  15. // ==/UserScript==
  16.  
  17. var random = rand(0, 1200);
  18.  
  19. var Battle = document.getElementById("bdHomeUpperBattle");
  20. //GM_log(Battle);
  21.  
  22. if (Battle != null)
  23. {
  24. Battle.click();
  25. sleep(300 + rand(-25, 300));
  26. }
  27. else
  28. {
  29. GM_log("null detected");
  30.  
  31.  setTimeout(function() { document.getElementsByClassName("nextStep")[0].click(); }, 200 + random);
  32.  setTimeout(function() { document.getElementsByClassName("nextStep")[0].click(); }, 500 + rand(-25, 300));
  33.  setTimeout(function() { document.getElementsByClassName("tough tough1")[0].click(); }, 500 + rand(-25, 300));
  34.  sleep(300 + rand(-25, 300));
  35.  setTimeout(function() { document.getElementById("bdFightStep3FightButton").click(); }, 300 + random);
  36. }
  37.  
  38.  
  39.  
  40. function rand(min, max)
  41. {
  42.     return Math.floor((Math.random() * max) + min);
  43. }
  44.  
  45. function sleep(ms)
  46. {
  47.     var dt = new Date();
  48.     dt.setTime(dt.getTime() + ms);
  49.     while (new Date().getTime() < dt.getTime());
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement