erevolution tools

erevolution prof

目前为 2016-05-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2.  
  3. // @name erevolution tools
  4.  
  5. // @namespace https://www.erevollution.coms
  6.  
  7. // @description erevolution prof
  8.  
  9. // @include https://www.erevollution.com/*
  10.  
  11. // @exclude https://www.erevollution.com/en/special-items
  12.  
  13. // @version 0.0.1.20160512085010
  14. // ==/UserScript==
  15.  
  16.  
  17. function wepon(wep,hit,gold,resta,restp,st) {
  18. this.st = st;
  19.  
  20. this.idstring='#udarec'+st;
  21.  
  22. this.wep = wep;
  23.  
  24. this.hit =Math.ceil(hit);
  25.  
  26. this.gold = gold;
  27. this.goldta= (2.5-(nextta*gold)).toFixed(2);
  28. this.goldtp= (5-(nexttp*gold)).toFixed(2)
  29.  
  30. this.nextta=resta/hit;
  31. this.nextta=Math.ceil(this.nextta);
  32.  
  33. this.nexttp=restp/hit;
  34. this.nexttp=Math.ceil(this.nexttp);
  35.  
  36. this.changeWep = function (wep) {
  37. this.hit = this.hit/this.wep;
  38. this.wep = wep;
  39. this.changeHit(this.hit*wep);
  40. }
  41. this.changeHit = function (hit) {
  42. this.hit =Math.ceil(hit);
  43.  
  44. this.nextta=resta/hit;
  45. this.nextta=Math.ceil(this.nextta);
  46.  
  47. this.nexttp=restp/hit;
  48. this.nexttp=Math.ceil(this.nexttp);
  49. }
  50. this.changeGold = function (gold) {
  51. this.gold = gold;
  52. this.goldta= (2.5-(nextta*gold)).toFixed(2);
  53. this.goldtp=(5-(nexttp*gold)).toFixed(2)
  54. }
  55.  
  56. }
  57.  
  58.  
  59. function spremeniWep(owep,wep,gold){
  60. if(wep=="n"){
  61. owep.changeGold(gold);
  62. }
  63. if (gold=="n"){
  64. owep.changeWep(wep);
  65. }
  66.  
  67. $(owep.idstring).html("<b>"+owep.hit+"<br> "+owep.nextta+"<br> "+owep.goldta+" <br> "+owep.nexttp+" <br> "+owep.goldtp+" <br> <select selected='"+owep.wep+"' class='oroz' id='n"+owep.st+"' >"+wepstring+"<br><input class='zlat' id='infCalc_gold"+owep.st+"' "+goldstring+" </b>");
  68. jquery();
  69. }
  70.  
  71.  
  72.  
  73.  
  74. function udarecEna(sprem){
  75. wepon1.changeHit(sprem);
  76. $(wepon1.idstring).html("<b>"+wepon1.hit+"<br> "+wepon1.nextta+"<br> 0 <br> "+wepon1.nexttp+" <br> 0 <br> - <br> - </b>");
  77. wepon2.changeHit(sprem);
  78. spremeniWep(wepon2);
  79. wepon3.changeHit(sprem);
  80. spremeniWep(wepon3);
  81. wepon4.changeHit(sprem);
  82. spremeniWep(wepon4);
  83. wepon5.changeHit(sprem);
  84. spremeniWep(wepon5);
  85. wepon6.changeHit(sprem);
  86. spremeniWep(wepon6);
  87. }
  88.  
  89. function udarecWep(gold,st,wep) {
  90. switch(st) {
  91. case 2:
  92. spremeniWep(wepon2,wep,gold);
  93. break;
  94. case 3:
  95. spremeniWep(wepon3,wep,gold);
  96. break;
  97. case 4:
  98. spremeniWep(wepon4,wep,gold);
  99. break;
  100. case 5:
  101. spremeniWep(wepon5,wep,gold);
  102. break;
  103. case 6:
  104. spremeniWep(wepon6,wep,gold);
  105. break;
  106. }
  107. }
  108.  
  109.  
  110.  
  111.  
  112. var x = document.getElementsByClassName("vs164-2");
  113. var moc = x[0].innerHTML;
  114. var car="";
  115. for(i=0;i<moc.length;i++)
  116. {
  117. if(moc[i]==","){
  118. car=moc[i-1];
  119. break;
  120. }
  121. }
  122.  
  123. moc=moc.replace(car+',',car);
  124. moc = parseInt(moc, 10)
  125.  
  126. var razmerje = document.getElementsByClassName("vs165-5");
  127. var level = document.getElementsByClassName("vs164-6 vs164-13");
  128. level=level[0].innerHTML;
  129. achivment= $(".vs164-5").attr("src");
  130. achivment=achivment[19]+achivment[20];
  131. var list=[];
  132. for (i=0; i<razmerje.length ; i++){
  133. var thisseznam = razmerje[i].innerHTML;
  134.  
  135. thisseznam= thisseznam.replace(/<[^>]*>/g, ''); // Remove HTML tags
  136. thisseznam = thisseznam.replace(/[[^]]*]/g, ''); // Remove anything within square brackets
  137. list[i]=thisseznam;
  138. }
  139.  
  140. var st=0;
  141. var wep=1;
  142. var tp= list[0];
  143. tp= tp.replace(/,/g,'')
  144. tp=tp.split("/")
  145. var restp=tp[1]-tp[0];
  146.  
  147. var ta= list[1];
  148. ta=ta.replace(/,/g,'')
  149. ta=ta.split("/")
  150. var resta=ta[1]-ta[0];
  151.  
  152. var lk=5;
  153. var ak=0.05;
  154. var l=level*lk+moc;
  155. var a=1+achivment*ak;
  156. var ne=1;
  157. var k=l*a*ne;
  158. k=Math.ceil(k);
  159. var ene=1;
  160. var boos=1;
  161. var hit=k*ene*boos;
  162. var nextta=resta/hit;
  163. nextta=Math.ceil(nextta);
  164. var nexttp=restp/hit;
  165. nexttp=Math.ceil(nexttp);
  166.  
  167. var gold=0;
  168. var idstring="";
  169.  
  170. var wepon1=new wepon(wep,hit,gold,resta,restp,1);
  171. var wepon2=new wepon(wep,hit,gold,resta,restp,2);
  172. var wepon3=new wepon(wep,hit,gold,resta,restp,3);
  173. var wepon4=new wepon(wep,hit,gold,resta,restp,4);
  174. var wepon5=new wepon(wep,hit,gold,resta,restp,5);
  175. var wepon6=new wepon(wep,hit,gold,resta,restp,6);
  176.  
  177. var goldstring= "type='text'></input></label>";
  178.  
  179. var wepstring= "<option value='1'>none</option>"+
  180. "<option value='1.2'>1.2</option>"+
  181. "<option value='1.4'>1.4</option>"+
  182. "<option value='1.6'>1.6</option>"+
  183. "<option value='1.8'>1.8</option>"+
  184. "<option value='2'>2</option>"+
  185. "<option value='2.2'>2.2</option>"+
  186. "<option value='2.4'>2.4</option>"+
  187. "<option value='2.6'>2.6</option>"+
  188. "<option value='2.8'>2.8</option>"+
  189. "<option value='3'>3</option>"+
  190. "<option value='3.2'>3.2</option>"+
  191. "<option value='3.4'>3.4</option>"+
  192. "<option value='3.6'>3.6</option>"+
  193. "<option value='3.8'>3.8</option>"+
  194. "<option value='4'>4</option>"+
  195. "<option value='5'>5</option>"+
  196. "</select>";
  197.  
  198. var htmlStringdiv = "<div id='vse'><br></br> <h3 style='margin-top: 15px;clear: both;'>"+
  199. "<span>Info Calc</span></h3>"+
  200. "<div id='infCalc' class='vs165' >"+
  201. "<label >energy<input id='infCalc_energy' value='1' type='text'></input></label>"+
  202. "<label>Damege Booster </label> <select id='dmg'>"+
  203. "<option value='1'>none</option>"+
  204. "<option value='1.1'>1.1</option>"+
  205. "<option value='1.2'>1.2</option>"+
  206. "<option value='1.3'>1.3</option>"+
  207. "<option value='1.4'>1.4</option>"+
  208. "<option value='1.5'>1.5</option>"+
  209. "</select>"+
  210.  
  211. "<table border='1'> "+
  212. "<tbody>"+
  213. "<tr>"+
  214. "<td><b>Influence: <br> Next TA: <br> gold TA <br> Next TP: <br> gold TP<br> Wep <br> gold/peac </b> <td>"+
  215. "<td><span id='udarec1'> <b>"+hit+"<br> "+nextta+"<br> 0 <br> "+nexttp+" <br> 0 <br> - </b> </span></td>"+
  216. "<td><span id='udarec2'><b>"+hit+"<br> "+nextta+"<br> cost g/m <br> "+nexttp+" <br> cost g/m <br> <select class='oroz' id='n2'>"+wepstring+" <br> <input class='zlat' id='infCalc_gold1'"+goldstring+" </b> </span></td>"+
  217. "<td><span id='udarec3'><b>"+hit+"<br> "+nextta+"<br> cost g/m <br> "+nexttp+" <br> cost g/m <br> <select class='oroz' id='n3'>"+wepstring+" <br> <input class='zlat' id='infCalc_gold2'"+goldstring+" </b> </span></td>"+
  218. "<td><span id='udarec4'><b>"+hit+"<br> "+nextta+"<br> cost g/m <br> "+nexttp+" <br> cost g/m <br> <select class='oroz' id='n4'>"+wepstring+" <br> <input class='zlat' id='infCalc_gold3'"+goldstring+" </b> </span></td>"+
  219. "<td><span id='udarec5'><b>"+hit+"<br> "+nextta+"<br> cost g/m <br> "+nexttp+" <br> cost g/m <br> <select class='oroz' id='n5'>"+wepstring+" <br> <input class='zlat' id='infCalc_gold4'"+goldstring+" </b> </span></td>"+
  220. "<td><span id='udarec6'><b>"+hit+"<br> "+nextta+"<br> cost g/m <br> "+nexttp+" <br> cost g/m <br> <select class='oroz' id='n6'>"+wepstring+" <br> <input class='zlat' id='infCalc_gold5'"+goldstring+" </b> </span></td>"+
  221. "</tr>"+
  222. "</tdbody>"+
  223. "</table>"+
  224.  
  225. "</div>"+
  226. "<br></br>"+
  227. "<div>";
  228.  
  229. $(htmlStringdiv).insertAfter(".vs165:last");
  230.  
  231. jquery();
  232.  
  233. function jquery(){
  234.  
  235. $("select").css("display","inline");
  236. $(".zlat").css("width", "50px");
  237.  
  238. $('#infCalc_energy').on('input',function(e){
  239. ene=$("#infCalc_energy").val();
  240. hit=k*ene*boos;
  241. hitwone=hit*wep;
  242. udarecEna(hit);
  243. });
  244.  
  245.  
  246. $('#dmg').on('change', function (e) {
  247. var optionSelected =$("option:selected", this);
  248. boos=this.value;
  249. hit=k*ene*boos;
  250. udarecEna(hit);
  251. });
  252.  
  253. $('.oroz').on('change', function (e) {
  254. var oid=$(this).attr('id');
  255. st=parseInt(oid[1]);
  256. debugger;
  257. wep= parseInt($('#n'+st).find(":selected").text());
  258. udarecWep("n",st,wep);
  259. });
  260.  
  261. $('.zlat').on('input',function(e){
  262. var gid=$(this).attr('id');
  263. st=parseInt(gid[12]);
  264. gold =parseInt($("#infCalc_gold"+st).val());
  265. debugger;
  266. udarecWep(gold,st,"n");
  267. });
  268.  
  269. $("td").css("borderColor", "transparent");
  270. $("td").css("borderWidth", "3px");
  271.  
  272. }