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 提交的版本,查看 最新版本

// ==UserScript==
// @name         Kongregate RCM Auto-Racer
// @namespace    RCM
// @version      0.1
// @description  [Works in Chrome!] moves you to the real page of RCM, and enabled "autoClicking" of the 'RACE' button for fame.
// @author       William H
// @include      *kongregate.com/games/groupsky/rcm
// @include      *racing-clicker.github.io/*
// @grant        none
// @require      http://code.jquery.com/jquery-latest.js
// ==/UserScript==

if(window.location.href.search('groupsky/rcm') > 0){ window.location = 'https://racing-clicker.github.io/index.html?kongregate=1&fixheight=1'; }
else{
	window.addEventListener("load", StartMyAutoClicker(), false);
	if(document.readyState == "complete"){
		StartMyAutoClicker();
	}
}

function StartMyAutoClicker(elemArray) {
	if(!localStorage.autoClickInterval){
		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');
	}
	$('<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]);
	$('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>");
}