Advertisement
Guest User

Untitled

a guest
May 27th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1.  
  2. sumaminusow = 0;
  3. sumaplusow = 0;
  4.  
  5. strona = 0
  6. function getStrona(){
  7. console.log("strona: "+strona);
  8. maxstr = $("#stopAt").val();
  9. console.log("game.php?screen=premium&mode=log&page="+strona);
  10. $.get("game.php?screen=premium&mode=log&page="+strona).done(function(dane){
  11. $("#status")[0].innerHTML="Wczytana strona: "+strona+"/"+maxstr
  12. dov.innerHTML= dane;
  13.  
  14. var tabl = $(dov).find("table.vis")[1].rows;
  15. $(tabl).each(function(i){
  16. if(tabl[i].cells[4].innerHTML.match($("#worldz")[0].value) !== null){
  17. var ilepp = Number(tabl[i].cells[2].innerHTML.replace(" ","").replace(" ",""))
  18. console.log(ilepp);
  19. if(ilepp<0){
  20. sumaminusow +=ilepp
  21. }else{
  22. sumaplusow +=ilepp
  23. }
  24. updateDane()
  25. }
  26. })
  27. if(strona<maxstr){
  28. setTimeout(function(){
  29. strona++;
  30. getStrona();
  31. }, 100)
  32. }
  33.  
  34. })
  35. }
  36. menu = `<div id=howciowykalk>
  37. <b>Status:</b> <span id=status>Wczytaj logi</span><br>
  38. Ile stron wczytać: <input id='stopAt' style='width:30px;' value=100><br>
  39. swiat: <input id='worldz' style='width:50px;' value=`+game_data.world+`><br>
  40. <button class='btn' onclick='getStrona()'>Rozpocznij wczytywanie logów</button><br><br>
  41. Wydane PP: <span id='wyd'>0</span><br>
  42. Zarobione PP: <span id='zar'>0</span><br>
  43. Podsumowanie: <span id='pods'>0</span><br>
  44.  
  45.  
  46. </div>`
  47. Dialog.show("okienko_komunikatu",menu);
  48.  
  49. dov = document.createElement("body");
  50.  
  51. function updateDane(){
  52. $("#wyd")[0].innerHTML = sumaminusow
  53. $("#zar")[0].innerHTML = sumaplusow
  54. $("#pods")[0].innerHTML = sumaminusow + sumaplusow;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement