Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. // ==UserScript==
  2. // @name profoot_king
  3. // @namespace http://pfking
  4. // @version 0.1
  5. // @description PF king of the mountain
  6. // @author karma
  7. // @match http://109.234.156.5/*
  8. // @match https://game.pfm.su/*
  9. // @match http://109.234.156.4/*
  10. // @require http://code.jquery.com/jquery-latest.js
  11. // @grant GM_setValue
  12. // @grant GM_getValue
  13. // ==/UserScript==
  14.  
  15. (function(){
  16. console.log("profoot_king started");
  17.  
  18. //console.log("profoot_king location: " + window.location.href);
  19. //profoot_king location: https://game.pfm.su/?mod=king_of_the_mount_page"
  20. var loc = window.location.href;
  21. if (loc.indexOf("king_of_the_mount") < 1) {
  22. console.log("profoot_king:dropping");
  23. return;
  24. }
  25.  
  26.  
  27. //console.log("KING OF THE MOUNT");
  28.  
  29. function check_king () {
  30. var bg = $("#button_game");
  31. console.log(bg);
  32.  
  33. if (bg.length == 0) {
  34. console.log("PROFOOT_KING LEADER");
  35. return;
  36. }
  37.  
  38. if (bg.length != 1) {
  39. console.log("profoot_king: WRONG LENGTH: " + bg.length);
  40. return;
  41. }
  42.  
  43. var bgf = bg.first();
  44. var bgd = bgf.css("display");
  45.  
  46. if (bgd == "none") {
  47. // таймер
  48. // console.log("profoot_king: waiting")
  49. } else {
  50. // можно играть
  51. // console.log("profoot_king: clicking")
  52. bgf.trigger("click");
  53. }
  54.  
  55. //console.log("profoot_king: disabled = " + bgf.css("display"));
  56. // none/block
  57.  
  58.  
  59. //console.log("CHECK_KING: " + $("#button_game").length);
  60. }
  61.  
  62. setInterval(check_king, 5000);
  63. console.log("profoot_king: interval set");
  64. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement