Vladimir3261

freelance

Mar 11th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. This script requre `cjs` extension for google chrome
  3. 1. Install cjs from chrome market https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
  4.  
  5. 2. go to site http://www.ichumon.com/game_ctf.php after
  6. 3. click to cjs extension icon
  7. 4. Insert the code below into the field and click SAVE
  8. ** Then you can leave the tab or minimize the browser. The script will click on each flag every 30 seconds
  9. */
  10.  
  11. // Here You can type your custom JavaScript...
  12.  
  13. if(window.location.href === 'http://www.ichumon.com/game_ctf.php?action=flaghunt'){
  14.        setTimeout(function(){
  15.         var links = document.getElementsByTagName('a');
  16.         for(var i=0; i< links.length; i++) {
  17.         var link = links[i].getAttribute('href');
  18.         if( Number(link.indexOf('checkflag')) >0 ) {
  19.             window.localStorage.setItem('lastFlagLink', 'http://www.ichumon.com/game_ctf.php'+link);
  20.             window.location.href=link;
  21.             break;
  22.            
  23.         }
  24.       }
  25.     }, 28000)
  26. }
  27. else if (window.location.href ===  window.localStorage.getItem('lastFlagLink') )
  28. {
  29.     window.location.href = 'http://www.ichumon.com/game_ctf.php?action=flaghunt';
  30. }else{
  31.     console.log(window.localStorage.getItem('lastFlagLink'));
  32. }
Add Comment
Please, Sign In to add comment