hwm_easy_rools

Скрипт упрощающий слив денег в рулетку.

目前为 2015-07-22 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name hwm_easy_rools
  3. // @author -Партизанэн-
  4. // @description Скрипт упрощающий слив денег в рулетку.
  5. // @version 1.0
  6. // @include http://www.heroeswm.ru/roulette.php
  7. // @include http://www.heroeswm.ru/roulette.php
  8. // @include http://qrator.heroeswm.ru/roulette.php
  9. // @include http://178.248.235.15/roulette.php
  10. // @include http://www.lordswm.com/roulette.php
  11. // @encoding utf-8
  12. // @namespace https://greasyfork.org/users/12821
  13. // ==/UserScript==
  14.  
  15. // (c) -Партизанэн- http://www.heroeswm.ru/pl_info.php?id=1108465
  16.  
  17. document.getElementsByTagName('table')[34].onclick = function(event) {
  18. if (document.getElementById('cForm') !== null) {
  19. document.getElementById("cForm").remove();
  20. }
  21. var field = event.target;
  22.  
  23. while (field != document.getElementsByTagName('table')[34]) {
  24. if (field.tagName == 'IMG') {
  25. cFormCreate(field, event);
  26. break;
  27. }
  28. field = field.parentNode;
  29. }
  30. }
  31.  
  32. function cFormCreate(field, event) {
  33. var rs_name_img = new RegExp('.*\\/(.*)\\.gif','i');
  34. var name_img = rs_name_img.exec(field.src)[1];
  35. document.getElementsByName('bettype')[0].value = "";
  36. document.getElementsByName('bet')[0].value = "";
  37.  
  38. var c_form = document.createElement('div');
  39. c_form.id = "cForm";
  40. c_form.style.position = "absolute";
  41. c_form.style.width = "200px";
  42. c_form.style.height = "200px";
  43. c_form.style.margin = "0px";
  44. c_form.style.padding = "0px";
  45. c_form.style.background = "#DDD9CD";
  46.  
  47. c_form.style.WebkitBoxShadow = "0px 0px 15px #000";
  48. c_form.style.MozBoxShadow = "0px 0px 15px #000";
  49. c_form.style.BoxShadow = "0px 0px 15px #000";
  50. c_form.style.top = event.clientY;
  51. c_form.style.left = event.clientX;
  52.  
  53.  
  54. var c_form_head = document.createElement('div');
  55. c_form_head.id = "c_form_head";
  56. c_form_head.style.height = "25px";
  57. c_form_head.style.width = "100%";
  58. c_form_head.style.background = "#41A152";
  59. c_form_head.style.color = "#000";
  60.  
  61.  
  62. var c_form_head_num = document.createElement('div');
  63. c_form_head_num.id = "c_form_head_num";
  64. c_form_head_num.style.height = "100%";
  65. c_form_head_num.style.float = "left";
  66. c_form_head_num.style.background = "#41A152";
  67. c_form_head_num.style.fontSize = "18px";
  68. c_form_head_num.innerHTML = 'Ставка на ' + name_img;
  69. c_form_head_num.style.color = "#000";
  70.  
  71.  
  72. var c_form_head_close = document.createElement('div');
  73. c_form_head_close.id = "close_form";
  74. c_form_head_close.innerHTML = "X";
  75. c_form_head_close.style.width = "21px";
  76. c_form_head_close.style.height = "25px";
  77. c_form_head_close.style.float = "right";
  78. c_form_head_close.style.margin = "0px";
  79. c_form_head_close.style.padding = "0px 0px 0px 6px";
  80. c_form_head_close.style.fontSize = "20px";
  81. c_form_head_close.style.background = "#ff0000";
  82. c_form_head_close.style.cursor = "pointer";
  83.  
  84. c_form_head_close.onclick = function() {
  85. var elem = document.getElementById("cForm");
  86. elem.remove();
  87. }
  88.  
  89. var t = document.createElement('table');
  90. var tbody = document.createElement('tbody');
  91. for(var i = 0;i<6;i++) {
  92.  
  93. var tr = document.createElement('tr');
  94. for (var j = 0;j<5;j++){
  95. var td = document.createElement('td');
  96. td.style.width = "34px";
  97. td.style.height = "20px";
  98. td.style.padding = "0px 3px";
  99. td.style.color = "#000";
  100. td.style.background = "#2B903D";
  101. td.style.cursor = "pointer";
  102.  
  103. td.onmouseover = function(){
  104. this.style.background = "#005C11";
  105. }
  106. td.onmouseout = function(){
  107. this.style.background = "#2B903D";
  108. }
  109.  
  110. if ((i*5)+(j+1) <= 10) {
  111. td.innerHTML = ((i*5)+(j+1))*100;
  112. var rate = ((i*5)+(j+1))*100;
  113. } else {
  114. td.innerHTML = (((i*5)+(j+1))-9) + "к";
  115. var rate = ((((i*5)+(j+1))-9)*1000);
  116. }
  117. td.style.title = rate;
  118. td.onclick = function () {
  119. document.getElementsByName('bettype')[0].value = field.title;
  120. document.getElementsByName('bet')[0].value = this.style.title;
  121. document.getElementsByName('rform')[0].submit();
  122. }
  123. tr.appendChild(td);
  124. }
  125. tbody.appendChild(tr);
  126. }
  127. t.appendChild(tbody);
  128.  
  129.  
  130. c_form_head.appendChild(c_form_head_num);
  131. c_form_head.appendChild(c_form_head_close);
  132. c_form.appendChild(c_form_head);
  133. c_form.appendChild(t);
  134. document.body.appendChild(c_form);
  135. }