Auto-rate *OLD*

Auto-rates a game with a random number of stars

  1. // ==UserScript==
  2. // @name Auto-rate *OLD*
  3. // @description Auto-rates a game with a random number of stars
  4. // @namespace http://userscripts.org/users/60317
  5. // @include http://www.kongregate.com/games/*
  6. // @version 0.0.1.20160322230916
  7. // ==/UserScript==
  8.  
  9. // Add jQuery
  10. var GM_JQ = document.createElement('script');
  11. GM_JQ.src = 'http://jquery.com/src/jquery-latest.js';
  12. GM_JQ.type = 'text/javascript';
  13. document.getElementsByTagName('head')[0].appendChild(GM_JQ);
  14.  
  15. // Check if jQuery's loaded
  16. function GM_wait() {
  17. if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); }
  18. else { $ = unsafeWindow.jQuery; letsJQuery(); }
  19. }
  20. GM_wait();
  21.  
  22. // All your GM code must be inside this function
  23. function letsJQuery() {
  24. $.noConflict();
  25. var randomnumber = 1 + Math.floor(Math.random()*5);
  26. $("ul.star-rating li a.star-" + randomnumber).click();
  27. }