Kongregate RCM Auto-Racer

[Works in Chrome!] moves you to the real page of RCM, and enabled "autoClicking" of the 'RACE' button for fame.

当前为 2015-09-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Kongregate RCM Auto-Racer
  3. // @namespace RCM
  4. // @version 0.1
  5. // @description [Works in Chrome!] moves you to the real page of RCM, and enabled "autoClicking" of the 'RACE' button for fame.
  6. // @author William H
  7. // @include *kongregate.com/games/groupsky/rcm
  8. // @include *racing-clicker.github.io/*
  9. // @grant none
  10. // @require http://code.jquery.com/jquery-latest.js
  11. // ==/UserScript==
  12.  
  13. if(window.location.href.search('groupsky/rcm') > 0){ window.location = 'https://racing-clicker.github.io/index.html?kongregate=1&fixheight=1'; }
  14. else{
  15. window.addEventListener("load", StartMyAutoClicker(), false);
  16. if(document.readyState == "complete"){
  17. StartMyAutoClicker();
  18. }
  19. }
  20.  
  21. function StartMyAutoClicker(elemArray) {
  22. if(!localStorage.autoClickInterval){
  23. localStorage.autoClickInterval = prompt('Please enter the number of miliseconds you would like it to click at\n *Note: 1000ms = 1 second, it\'s not recommended to do less than 10ms', '25');
  24. }
  25. $('<li class="ng-scope"><a href=""><div class="fa fa-play" style="width:30px;" onclick="toggleAuto(this)" id="autoToggle"></div><input type="text" size="3" onblur="updateInterval(this)" style="height:20px;width:30px;background-color:#000000;border:0;text-align:center;" placeholder="'+ localStorage.autoClickInterval +'"></a></li>').insertBefore($('.dropdown')[0]);
  26. $('head').append("<script>function toggleAuto(elem){\n\tif(elem.className.search('fa-pause') > 0){\n\t\telem.className = elem.className.replace('pause', 'play');\n\t\tclearInterval(autoClicker);\n\t}else{\n\t\telem.className = elem.className.replace('play','pause');\n\t\tautoClicker = setInterval((function(){$($('.btn.btn-primary.btn-lg.ng-scope')[0]).click();}), localStorage.autoClickInterval);\n\t}\n}\nfunction updateInterval(elem){\n\tlocalStorage.autoClickInterval = elem.value;\n\tif(document.getElementById('autoToggle').className.search('play') == -1){\n\t\tclearInterval(autoClicker);\n\t\tautoClicker = setInterval((function(){$($('.btn.btn-primary.btn-lg.ng-scope')[0]).click();}), localStorage.autoClickInterval);\n\t}\n}</script>");
  27. }