Peaks Increment Calculator V1.0

This Tool Calculate peaks Increment in each peak

  1. // ==UserScript==
  2. // @name Peaks Increment Calculator V1.0
  3. // @version 1.0
  4. // @description This Tool Calculate peaks Increment in each peak
  5. // @author Omer Ben Yosef
  6. // @include http://trophymanager.com/players/*
  7. // @include https://trophymanager.com/players/*
  8. // @include https://fb.trophymanager.com/players/*
  9. // @namespace https://gf.qytechs.cn/users/18768
  10. // ==/UserScript==
  11. var div_area = document.createElement('div');
  12. var a = document.getElementById("player_graphs_new");
  13. var b = a.getElementsByClassName("graph_peaks background_gradient graph_block");
  14. var phySum = 0 ;
  15. var tacSum = 0 ;
  16. var tecSum = 0 ;
  17. document.getElementsByClassName("box")[0].appendChild(div_area);
  18. div_area.innerHTML = "<div style=\"position: absolute;top: 730px; z-index: 1; width: 175px; margin-top: 20px; background: #5F8D2D; padding-left: 5px; color: gold; border: 2px #333333 outset; display:inline;\"><p style=\"text-decoration: underline;\"><b>PlayerData+:<\p><table style=\"margin-top: -1em; margin-bottom: 1em;\"><tr><td>PhySum: </td><td>" + phySum + " " + "</td></tr><tr><td>TacSum: </td><td>" + phySum + " " + "</td></tr><tr><td>TecSum: </td><td>" + phySum + " " + "</td></tr><tr><td>AllSum: </td><td>" + phySum + "</td></tr></table></b></div>";
  19.  
  20. var div = document.createElement("BUTTON");
  21. document.getElementsByClassName("box")[0].appendChild(div);
  22.  
  23. div.setAttribute("style", "position: absolute; z-index: 1; width: 185px; margin-top: 240px; background: #5F8D2D; padding-left: 5px;top: 640px");div.innerHTML = "<p><b>Calculate Peak Increment</b></p>";
  24.  
  25. div.onclick=function()
  26. { var a = document.getElementById("player_graphs_new");
  27. var b = a.getElementsByClassName("graph_peaks background_gradient graph_block");
  28. try {
  29. {if ($(b[0].getElementsByClassName("graph jqplot-target")).length>0)
  30. {var c = b[0].getElementsByClassName("graph jqplot-target");
  31. var bool = true ;
  32. var count = 0 ;
  33. var num = 0 ;
  34. while (bool == true) {
  35. var sta = "jqplot-point-label jqplot-series-0 jqplot-point-";
  36. num = count ;
  37. num = num.toString();
  38. str = sta.concat(num);
  39. if ($(b[0].getElementsByClassName(str)).length>0)
  40. { count = count + 1 ;
  41. }
  42. else { count = count -1 ;
  43. bool = false ; }
  44. }
  45.  
  46. var bool_two = true ;
  47. var count_two = 0 ;
  48. var num_two = 0 ;
  49. while (bool_two == true) {
  50. var sta_2 = "jqplot-point-label jqplot-series-1 jqplot-point-";
  51. num_two = count_two ;
  52. num_two = num_two.toString();
  53. var str_2 = sta_2.concat(num_two);
  54. if ($(b[0].getElementsByClassName(str_2)).length>0)
  55. { count_two = count_two + 1 ;
  56. }
  57. else { count_two = count_two -1 ;
  58. bool_two = false ; }
  59. }
  60.  
  61. var bool_three = true ;
  62. var count_three = 0 ;
  63. var num_three = 0 ;
  64. while (bool_three == true) {
  65. var sta_3 = "jqplot-point-label jqplot-series-2 jqplot-point-";
  66. num_three = count_three ;
  67. num_three = num_three.toString();
  68. var str_3 = sta_3.concat(num_three);
  69. if ($(b[0].getElementsByClassName(str_3)).length>0)
  70. { count_three = count_three + 1 ;
  71. }
  72. else { count_three = count_three -1 ;
  73. bool_three = false ; }
  74. }
  75.  
  76. var str1 = "jqplot-point-label jqplot-series-0 jqplot-point-";
  77. var str2 = "jqplot-point-label jqplot-series-1 jqplot-point-";
  78. var str3 = "jqplot-point-label jqplot-series-2 jqplot-point-";
  79. var num_last = count ;
  80. var num_last_1 = count - 1 ;
  81. num_last = num_last.toString()
  82. num_last_1 = num_last_1.toString()
  83. var str1_r = str1.concat(num_last);
  84. var str2_r = str2.concat(num_last);
  85. var str3_r = str3.concat(num_last);
  86. var str1b = str1.concat(num_last_1);
  87. var str2b = str2.concat(num_last_1);
  88. var str3b = str3.concat(num_last_1);
  89. var phy_peak_last = c[0].getElementsByClassName(str1_r);
  90. var tac_peak_last = c[0].getElementsByClassName(str2_r);
  91. var tec_peak_last = c[0].getElementsByClassName(str3_r);
  92. var phy_peak_last = phy_peak_last[0].style;
  93. var tac_peak_last = tac_peak_last[0].style;
  94. var tec_peak_last = tec_peak_last[0].style;
  95. var phy_peak_last = phy_peak_last["top"]
  96. var tac_peak_last = tac_peak_last["top"]
  97. var tec_peak_last = tec_peak_last["top"]
  98. phy_peak_last = parseFloat(phy_peak_last)
  99. tac_peak_last = parseFloat(tac_peak_last)
  100. tec_peak_last = parseFloat(tec_peak_last)
  101. var phy_peak_last_1 = c[0].getElementsByClassName(str1b);
  102. var tac_peak_last_1 = c[0].getElementsByClassName(str2b);
  103. var tec_peak_last_1 = c[0].getElementsByClassName(str3b);
  104. var phy_peak_last_1 = phy_peak_last_1[0].style;
  105. var tac_peak_last_1 = tac_peak_last_1[0].style;
  106. var tec_peak_last_1 = tec_peak_last_1[0].style;
  107. var phy_peak_last_1 = phy_peak_last_1["top"]
  108. var tac_peak_last_1 = tac_peak_last_1["top"]
  109. var tec_peak_last_1 = tec_peak_last_1["top"]
  110. phy_peak_last_1 = parseFloat(phy_peak_last_1)
  111. tac_peak_last_1 = parseFloat(tac_peak_last_1)
  112. tec_peak_last_1 = parseFloat(tec_peak_last_1)
  113. var phy_diff = parseFloat(phy_peak_last_1 - phy_peak_last) ;
  114. var tac_diff = parseFloat(tac_peak_last_1 - tac_peak_last) ;
  115. var tec_diff = parseFloat(tec_peak_last_1 - tec_peak_last) ;
  116. var count_1 = count + 1 ;
  117. var TI = a.getElementsByClassName("graph_ti background_gradient graph_block");
  118. var TI = TI[0].getElementsByClassName("graph jqplot-target");
  119. var str_for_ti = "jqplot-point-label jqplot-series-0 jqplot-point-";
  120. var str_for_ti = str_for_ti.concat(count_1.toString());
  121. var TA = TI[0].getElementsByClassName(str_for_ti);
  122. var T = document.getElementsByClassName(str_for_ti)[0].textContent;
  123. T = parseInt(T);
  124. T = parseFloat(T/10);
  125. var TOTALSUM = parseFloat(phy_diff + tac_diff + tec_diff) ;
  126. phy_diff = T/TOTALSUM*phy_diff;
  127. tac_diff = T/TOTALSUM*tac_diff;
  128. tec_diff = T/TOTALSUM*tec_diff;
  129. phy_diff = phy_diff.toFixed(1);
  130. tac_diff = tac_diff.toFixed(1);
  131. tec_diff = tec_diff.toFixed(1);
  132.  
  133. if ((count == count_two) && (count_two == count_three) && (count_three == count)){
  134. div_area.innerHTML = "<div style=\"position: absolute;top: 730px; z-index: 1; width: 175px; margin-top: 20px; background: #5F8D2D; padding-left: 5px; color: gold; border: 2px #333333 outset; display:inline;\"><p style=\"text-decoration: underline;\"><b>PlayerData+:<\p><table style=\"margin-top: -1em; margin-bottom: 1em;\"><tr><td>PhySum: </td><td>" + phy_diff + " " + "</td></tr><tr><td>TacSum: </td><td>" + tac_diff + " " + "</td></tr><tr><td>TecSum: </td><td>" + tec_diff + " " + "</td></tr><tr><td>AllSum: </td><td>" + T + "</td></tr></table></b></div>";
  135. }
  136. }
  137. else (alert("WAIT"));
  138. }
  139. }
  140. catch(err) {
  141. document.getElementById("tabplayer_graphs_new").click();
  142. }
  143.  
  144. };

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址