Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sumaminusow = 0;
- sumaplusow = 0;
- strona = 0
- function getStrona(){
- console.log("strona: "+strona);
- maxstr = $("#stopAt").val();
- console.log("game.php?screen=premium&mode=log&page="+strona);
- $.get("game.php?screen=premium&mode=log&page="+strona).done(function(dane){
- $("#status")[0].innerHTML="Wczytana strona: "+strona+"/"+maxstr
- dov.innerHTML= dane;
- var tabl = $(dov).find("table.vis")[1].rows;
- $(tabl).each(function(i){
- if(tabl[i].cells[4].innerHTML.match($("#worldz")[0].value) !== null){
- var ilepp = Number(tabl[i].cells[2].innerHTML.replace(" ","").replace(" ",""))
- console.log(ilepp);
- if(ilepp<0){
- sumaminusow +=ilepp
- }else{
- sumaplusow +=ilepp
- }
- updateDane()
- }
- })
- if(strona<maxstr){
- setTimeout(function(){
- strona++;
- getStrona();
- }, 100)
- }
- })
- }
- menu = `<div id=howciowykalk>
- <b>Status:</b> <span id=status>Wczytaj logi</span><br>
- Ile stron wczytać: <input id='stopAt' style='width:30px;' value=100><br>
- swiat: <input id='worldz' style='width:50px;' value=`+game_data.world+`><br>
- <button class='btn' onclick='getStrona()'>Rozpocznij wczytywanie logów</button><br><br>
- Wydane PP: <span id='wyd'>0</span><br>
- Zarobione PP: <span id='zar'>0</span><br>
- Podsumowanie: <span id='pods'>0</span><br>
- </div>`
- Dialog.show("okienko_komunikatu",menu);
- dov = document.createElement("body");
- function updateDane(){
- $("#wyd")[0].innerHTML = sumaminusow
- $("#zar")[0].innerHTML = sumaplusow
- $("#pods")[0].innerHTML = sumaminusow + sumaplusow;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement