Last active
May 23, 2020 22:22
-
-
Save onliniak/95198d8a2bb6f41f6c08f8ded1f07f3e to your computer and use it in GitHub Desktop.
Vallheru 1.6 | Ile jeszcze musimy zebrać surowców ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Astralna Machina | |
// @namespace Violentmonkey Scripts | |
// @match http://ojci3c.webd.pl/magan/tribe* | |
// @exclude http://ojci3c.webd.pl/magan/tribes.php?view=my&step=quit | |
// @grant none | |
// @version 0.2.0 | |
// @author Luunube | |
// @description Ten skrypt pomoże Ci zbudować własne narzędzia pomocne w budowie Astralnej Machiny. W tej chwili wskazuje ile jeszcze musicie zebrać surowców i ziół na stworzenie wszystkich konstrukcji i mikstur. | |
// @updateURL https://gist.githubusercontent.com/onliniak/95198d8a2bb6f41f6c08f8ded1f07f3e/raw/user.js | |
// ==/UserScript== | |
let tribeminerals; | |
let surowiec; | |
let Adamantium | |
let Krysztal | |
let Meteor | |
let Sosna | |
let Leszczyna | |
let Cis | |
let Wiaz | |
let Stal | |
let Zelazo | |
let Miedz | |
let Cyna | |
let Wegiel | |
let Cynk | |
$.ajax({ | |
url: "http://ojci3c.webd.pl/magan/tribeminerals.php", | |
type: "get", | |
async: false, | |
success: function(data) { | |
tribeminerals = document.createElement('html'); | |
tribeminerals.innerHTML = data; | |
let surowiec = []; //Nowy array | |
let liczba; | |
let row = tribeminerals.getElementsByClassName("container")[0].children[4].children[0].children[1].children[1].childNodes[1].children[0].children[1].children[0].children[7].children[0].children; | |
for (let i = 1; i < 20; ++i) { | |
liczba = row[i].children[1].textContent; | |
surowiec.push({ | |
//"wiersz": row[i], | |
"nazwa": row[i].children[0].textContent, | |
"ilosc": liczba.substring(0, liczba.indexOf("/")) // Usuwam wszystko po ukośniku (łącznie z nim) | |
}); | |
} | |
Adamantium = surowiec[10].ilosc; | |
Krysztal = surowiec[12].ilosc; | |
Meteor = surowiec[11].ilosc; | |
Sosna = surowiec[13].ilosc; | |
Leszczyna = surowiec[14].ilosc; | |
Cis = surowiec[15].ilosc; | |
Wiaz = surowiec[16].ilosc; | |
Stal = surowiec[8].ilosc; | |
Zelazo = surowiec[3].ilosc; | |
Miedz = surowiec[0].ilosc; | |
Cyna = surowiec[2].ilosc; | |
Cynk = surowiec[1].ilosc; | |
Wegiel = surowiec[9].ilosc; | |
Mithril = surowiec[18].ilosc | |
}, | |
error: function() { | |
} | |
}); | |
// Pobieram ilość surowców z zakładki Skarbiec | |
fetch('http://ojci3c.webd.pl/magan/tribeminerals.php') | |
.then(response => response.text()) | |
.then(data => { | |
var el = document.createElement('html'); | |
el.innerHTML = data; | |
}); | |
// Oraz ilość ziół z Zielnika | |
let tribeherbs; | |
$.ajax({ | |
url: "http://ojci3c.webd.pl/magan/tribeherbs.php", | |
type: "get", | |
async: false, | |
success: function(data) { | |
tribeherbs = document.createElement('html'); | |
tribeherbs.innerHTML = data; | |
}, | |
error: function() { | |
} | |
}); | |
let herbal = tribeherbs.getElementsByClassName("container")[0].children[4].children[0].children[1].children[1].children[0].children[0].children[1].children[0].children[7].children[0].children[1] | |
Illani = herbal.children[0].textContent.substring(0, herbal.children[0].textContent.indexOf("/")) | |
Nutari = herbal.children[2].textContent.substring(0, herbal.children[2].textContent.indexOf("/")) | |
Illanias = herbal.children[1].textContent.substring(0, herbal.children[1].textContent.indexOf("/")) | |
Dynallca = herbal.children[3].textContent.substring(0, herbal.children[3].textContent.indexOf("/")) | |
// Pobieram ilość astralnych komponentów | |
// W tym wypadku potrzebne było połączenie synchroniczne | |
let tribeastral; | |
$.ajax({ | |
url: "http://ojci3c.webd.pl/magan/tribeastral.php?action=view&type=c", | |
type: "get", | |
async: false, | |
success: function(data) { | |
tribeastral = document.createElement('html'); | |
tribeastral.innerHTML = data; | |
}, | |
error: function() { | |
} | |
}); | |
let AstralElement = tribeastral.getElementsByClassName("container")[0].children[4].children[0].children[1].children[1].childNodes[1].children[0].children[1].children[0].children[6].children[0].children; | |
// Zapisuję sobie dane potrzebne do stworzenia Machiny | |
let potwory = {}; | |
let konstrukcje = {}; | |
let mikstura = {}; | |
let machina = {}; | |
konstrukcje.Astralny_komponent = {}; | |
konstrukcje.Astralny_komponent.wymagane = 10; | |
konstrukcje.Astralny_komponent.moje = AstralElement[11].children[1].innerHTML; | |
konstrukcje.Astralny_komponent.adamantium = 2500; | |
konstrukcje.Astralny_komponent.krysztal = 1250; | |
konstrukcje.Astralny_komponent.meteoryt = 250; | |
konstrukcje.Astralny_komponent.sosna = 6000; | |
konstrukcje.Astralny_komponent.leszczyna = 4000; | |
konstrukcje.Astralny_komponent.cis = 1500; | |
konstrukcje.Astralny_komponent.wiaz = 1000; | |
konstrukcje.Astralny_komponent.stal = 500; | |
konstrukcje.Astralny_komponent.ruda_zelazo = 750; | |
konstrukcje.Astralny_komponent.ruda_miedz = 3000; | |
konstrukcje.Astralny_komponent.ruda_cyna = 2000; | |
konstrukcje.Astralny_komponent.ruda_cynk = 1000; | |
konstrukcje.Astralny_komponent.wegiel = 10000; | |
konstrukcje.Astralny_komponent.mithril = 4000; | |
konstrukcje.Astralny_komponent.energia = 50; | |
konstrukcje.Gwiezdny_portal = {}; | |
konstrukcje.Gwiezdny_portal.wymagane = 8; | |
konstrukcje.Gwiezdny_portal.moje = AstralElement[12].children[1].innerHTML; | |
konstrukcje.Gwiezdny_portal.adamantium = 4000; | |
konstrukcje.Gwiezdny_portal.krysztal = 2000; | |
konstrukcje.Gwiezdny_portal.meteoryt = 300; | |
konstrukcje.Gwiezdny_portal.sosna = 8000; | |
konstrukcje.Gwiezdny_portal.leszczyna = 5500; | |
konstrukcje.Gwiezdny_portal.cis = 2500; | |
konstrukcje.Gwiezdny_portal.wiaz = 1500; | |
konstrukcje.Gwiezdny_portal.stal = 750; | |
konstrukcje.Gwiezdny_portal.ruda_zelaza = 1000; | |
konstrukcje.Gwiezdny_portal.ruda_miedzi = 5000; | |
konstrukcje.Gwiezdny_portal.ruda_cyny = 3000; | |
konstrukcje.Gwiezdny_portal.ruda_cynku = 2000; | |
konstrukcje.Gwiezdny_portal.wegiel = 15000; | |
konstrukcje.Gwiezdny_portal.mithril = 5000; | |
konstrukcje.Gwiezdny_portal.energia = 75; | |
konstrukcje.Swietlny_obelisk = {}; | |
konstrukcje.Swietlny_obelisk.wymagane = 6; | |
konstrukcje.Swietlny_obelisk.moje = AstralElement[13].children[1].innerHTML; | |
konstrukcje.Swietlny_obelisk.adamantium = 6500; | |
konstrukcje.Swietlny_obelisk.krysztal = 2500; | |
konstrukcje.Swietlny_obelisk.meteoryt = 400; | |
konstrukcje.Swietlny_obelisk.sosna = 12000; | |
konstrukcje.Swietlny_obelisk.leszczyna = 7000; | |
konstrukcje.Swietlny_obelisk.cis = 4000; | |
konstrukcje.Swietlny_obelisk.wiaz = 2000; | |
konstrukcje.Swietlny_obelisk.stal = 1000; | |
konstrukcje.Swietlny_obelisk.ruda_zelaza = 1500; | |
konstrukcje.Swietlny_obelisk.ruda_miedzi = 7000; | |
konstrukcje.Swietlny_obelisk.ruda_cyny = 4000; | |
konstrukcje.Swietlny_obelisk.ruda_cynku = 3000; | |
konstrukcje.Swietlny_obelisk.wegiel = 20000; | |
konstrukcje.Swietlny_obelisk.mithril = 6000; | |
konstrukcje.Swietlny_obelisk.energia = 100; | |
konstrukcje.Plomienny_znicz = {}; | |
konstrukcje.Plomienny_znicz.wymagane = 4; | |
konstrukcje.Plomienny_znicz.moje = AstralElement[14].children[1].innerHTML; | |
konstrukcje.Plomienny_znicz.adamantium = 8000; | |
konstrukcje.Plomienny_znicz.krysztal = 4000; | |
konstrukcje.Plomienny_znicz.meteoryt = 500; | |
konstrukcje.Plomienny_znicz.sosna = 17000; | |
konstrukcje.Plomienny_znicz.leszczyna = 8500; | |
konstrukcje.Plomienny_znicz.cis = 5500; | |
konstrukcje.Plomienny_znicz.wiaz = 2500; | |
konstrukcje.Plomienny_znicz.stal = 1250; | |
konstrukcje.Plomienny_znicz.ruda_zelaza = 2000; | |
konstrukcje.Plomienny_znicz.ruda_miedzi = 9000; | |
konstrukcje.Plomienny_znicz.ruda_cyny = 5000; | |
konstrukcje.Plomienny_znicz.ruda_cynku = 4000; | |
konstrukcje.Plomienny_znicz.wegiel = 25000; | |
konstrukcje.Plomienny_znicz.mithril = 7000; | |
konstrukcje.Plomienny_znicz.energia = 125; | |
konstrukcje.Srebrzysta_fontanna = {}; | |
konstrukcje.Srebrzysta_fontanna.wymagane = 2; | |
konstrukcje.Srebrzysta_fontanna.moje = AstralElement[15].children[1].innerHTML; | |
konstrukcje.Srebrzysta_fontanna.adamantium = 10000; | |
konstrukcje.Srebrzysta_fontanna.krysztal = 5000; | |
konstrukcje.Srebrzysta_fontanna.meteoryt = 600; | |
konstrukcje.Srebrzysta_fontanna.sosna = 20000; | |
konstrukcje.Srebrzysta_fontanna.leszczyna = 10000; | |
konstrukcje.Srebrzysta_fontanna.cis = 7000; | |
konstrukcje.Srebrzysta_fontanna.wiaz = 3000; | |
konstrukcje.Srebrzysta_fontanna.stal = 1500; | |
konstrukcje.Srebrzysta_fontanna.ruda_zelaza = 2500; | |
konstrukcje.Srebrzysta_fontanna.ruda_miedzi = 11000; | |
konstrukcje.Srebrzysta_fontanna.ruda_cyny = 6000; | |
konstrukcje.Srebrzysta_fontanna.ruda_cynku = 5000; | |
konstrukcje.Srebrzysta_fontanna.wegiel = 30000; | |
konstrukcje.Srebrzysta_fontanna.mithril = 8000; | |
konstrukcje.Srebrzysta_fontanna.energia = 150; | |
potwory.Zab_Glabrezu = {}; | |
potwory.Zab_Glabrezu.wymagane = 8; | |
potwory.Zab_Glabrezu.moje = AstralElement[2].children[1].innerHTML; | |
potwory.Ognisty_pyl = {}; | |
potwory.Ognisty_pyl.wymagane = 6; | |
potwory.Ognisty_pyl.moje = AstralElement[3].children[1].innerHTML; | |
potwory.Pazur_Zglebiczarta = {}; | |
potwory.Pazur_Zglebiczarta.wymagane = 6; | |
potwory.Pazur_Zglebiczarta.moje = AstralElement[4].children[1].innerHTML; | |
potwory.Luska_Skorpendry = {}; | |
potwory.Luska_Skorpendry.wymagane = 6; | |
potwory.Luska_Skorpendry.moje = AstralElement[5].children[1].innerHTML; | |
potwory.Macka_Krakena = {}; | |
potwory.Macka_Krakena.wymagane = 4; | |
potwory.Macka_Krakena.moje = AstralElement[6].children[1].innerHTML; | |
potwory.Piorun_Tytana = {}; | |
potwory.Piorun_Tytana.wymagane = 4; | |
potwory.Piorun_Tytana.moje = AstralElement[7].children[1].innerHTML; | |
potwory.Zebro_Licha = {}; | |
potwory.Zebro_Licha.wymagane = 2; | |
potwory.Zebro_Licha.moje = AstralElement[8].children[1].innerHTML; | |
mikstura.Magiczna_esensja = {}; | |
mikstura.Magiczna_esensja.wymagane = 10; | |
mikstura.Magiczna_esensja.moje = AstralElement[18].children[1].innerHTML; | |
mikstura.Magiczna_esensja.illani = 3000; | |
mikstura.Magiczna_esensja.nutari = 1000; | |
mikstura.Magiczna_esensja.illanias = 2000; | |
mikstura.Magiczna_esensja.dynallca = 1000; | |
mikstura.Magiczna_esensja.energia = 50; | |
mikstura.Gwiezdna_masc = {}; | |
mikstura.Gwiezdna_masc.wymagane = 8; | |
mikstura.Gwiezdna_masc.moje = AstralElement[19].children[1].innerHTML; | |
mikstura.Gwiezdna_masc.illani = 5000; | |
mikstura.Gwiezdna_masc.nutari = 2500; | |
mikstura.Gwiezdna_masc.illanias = 3500; | |
mikstura.Gwiezdna_masc.dynallca = 1500; | |
mikstura.Gwiezdna_masc.energia = 75; | |
mikstura.Eliksir_Illuminati = {}; | |
mikstura.Eliksir_Illuminati.wymagane = 6; | |
mikstura.Eliksir_Illuminati.moje = AstralElement[20].children[1].innerHTML; | |
mikstura.Eliksir_Illuminati.illani = 7000; | |
mikstura.Eliksir_Illuminati.nutari = 3500; | |
mikstura.Eliksir_Illuminati.illanias = 5000; | |
mikstura.Eliksir_Illuminati.dynallca = 2000; | |
mikstura.Eliksir_Illuminati.energia = 100; | |
mikstura.Astralne_medium = {}; | |
mikstura.Astralne_medium.wymagane = 4; | |
mikstura.Astralne_medium.moje = AstralElement[21].children[1].innerHTML; | |
mikstura.Astralne_medium.illani = 9000; | |
mikstura.Astralne_medium.nutari = 4500; | |
mikstura.Astralne_medium.illanias = 6500; | |
mikstura.Astralne_medium.dynallca = 2500; | |
mikstura.Astralne_medium.energia = 125; | |
mikstura.Magiczny_absynt = {}; | |
mikstura.Magiczny_absynt.wymagane = 2; | |
mikstura.Magiczny_absynt.moje = AstralElement[22].children[1].innerHTML; | |
mikstura.Magiczny_absynt.illani = 12000; | |
mikstura.Magiczny_absynt.nutari = 6000; | |
mikstura.Magiczny_absynt.illanias = 8000; | |
mikstura.Magiczny_absynt.dynallca = 3000; | |
mikstura.Magiczny_absynt.energia = 150; | |
machina.skladniki = potwory; | |
machina.konstrukcje = konstrukcje; | |
machina.mikstura = mikstura; | |
machina.surowce = surowiec; | |
newDiv = document.createElement("div"); | |
newDiv.id = "machinacz" | |
newDiv.style.width = "400px"; | |
newDiv.innerHTML += "<h1>Test Test Test!</h1><br />"; | |
a = Adamantium/konstrukcje.Astralny_komponent.adamantium; | |
b = Krysztal/konstrukcje.Astralny_komponent.krysztal; | |
c = Meteor/konstrukcje.Astralny_komponent.meteoryt; | |
d = Sosna/konstrukcje.Astralny_komponent.sosna; | |
e = Leszczyna/konstrukcje.Astralny_komponent.leszczyna; | |
f = Cis/konstrukcje.Astralny_komponent.cis; | |
g = Wiaz/konstrukcje.Astralny_komponent.wiaz; | |
h = Stal/konstrukcje.Astralny_komponent.stal; | |
i = Zelazo/konstrukcje.Astralny_komponent.ruda_zelazo; | |
j = Miedz/konstrukcje.Astralny_komponent.ruda_miedz; | |
k = Cyna/konstrukcje.Astralny_komponent.ruda_cyna; | |
l = Cynk/konstrukcje.Astralny_komponent.ruda_cynk; | |
m = Wegiel/konstrukcje.Astralny_komponent.wegiel; | |
z = {}; | |
z.potrzebne = konstrukcje.Astralny_komponent.wymagane-konstrukcje.Astralny_komponent.moje; | |
z.adamantium = konstrukcje.Astralny_komponent.adamantium*z.potrzebne; | |
z.krysztal = konstrukcje.Astralny_komponent.krysztal*z.potrzebne; | |
z.meteoryt = konstrukcje.Astralny_komponent.meteoryt*z.potrzebne; | |
z.sosna = konstrukcje.Astralny_komponent.sosna*z.potrzebne; | |
z.leszczyna = konstrukcje.Astralny_komponent.leszczyna*z.potrzebne; | |
z.cis = konstrukcje.Astralny_komponent.cis*z.potrzebne; | |
z.wiaz = konstrukcje.Astralny_komponent.wiaz*z.potrzebne; | |
z.stal = konstrukcje.Astralny_komponent.ruda_zelazo*z.potrzebne; | |
z.miedz = konstrukcje.Astralny_komponent.ruda_miedz*z.potrzebne; | |
z.cyna = konstrukcje.Astralny_komponent.ruda_cyna*z.potrzebne; | |
z.cynk = konstrukcje.Astralny_komponent.ruda_cynk*z.potrzebne; | |
z.wegiel = konstrukcje.Astralny_komponent.wegiel*z.potrzebne; | |
z.mithril = konstrukcje.Astralny_komponent.mithril*z.potrzebne; | |
z.zelazo = konstrukcje.Astralny_komponent.ruda_zelazo*z.potrzebne; | |
suma1 = [z.adamantium, z.krysztal, z.meteoryt, z.sosna, z.leszczyna, z.cis, z.wiaz, z.stal, z.miedz, z.cyna, z.cynk, z.wegiel, z.mithril, z.zelazo] | |
//x = Math.min(a,b,c,d,e,f,g,h,i,j,k,l,m); | |
//if (konstrukcje.Astralny_komponent.moje<konstrukcje.Astralny_komponent.wymagane) { | |
// newDiv.innerHTML += 'Możesz zrobić jeszcze ' + Math.floor(x) + ' Astralnych Komponentów. Do ukończenia pozostało jeszcze ' + JSON.stringify(z) + '<br />'; | |
//} | |
a = Adamantium/konstrukcje.Gwiezdny_portal.adamantium; | |
b = Krysztal/konstrukcje.Gwiezdny_portal.krysztal; | |
c = Meteor/konstrukcje.Gwiezdny_portal.meteoryt; | |
d = Sosna/konstrukcje.Gwiezdny_portal.sosna; | |
e = Leszczyna/konstrukcje.Gwiezdny_portal.leszczyna; | |
f = Cis/konstrukcje.Gwiezdny_portal.cis; | |
g = Wiaz/konstrukcje.Gwiezdny_portal.wiaz; | |
h = Stal/konstrukcje.Gwiezdny_portal.stal; | |
i = Zelazo/konstrukcje.Gwiezdny_portal.ruda_zelaza; | |
j = Miedz/konstrukcje.Gwiezdny_portal.ruda_miedzi; | |
k = Cyna/konstrukcje.Gwiezdny_portal.ruda_cyny; | |
l = Cynk/konstrukcje.Gwiezdny_portal.ruda_cynku; | |
m = Wegiel/konstrukcje.Gwiezdny_portal.wegiel; | |
z = {}; | |
z.potrzebne = konstrukcje.Gwiezdny_portal.wymagane-konstrukcje.Gwiezdny_portal.moje; | |
z.adamantium = konstrukcje.Gwiezdny_portal.adamantium*z.potrzebne; | |
z.krysztal = konstrukcje.Gwiezdny_portal.krysztal*z.potrzebne; | |
z.meteoryt = konstrukcje.Gwiezdny_portal.meteoryt*z.potrzebne; | |
z.sosna = konstrukcje.Gwiezdny_portal.sosna*z.potrzebne; | |
z.leszczyna = konstrukcje.Gwiezdny_portal.leszczyna*z.potrzebne; | |
z.cis = konstrukcje.Gwiezdny_portal.cis*z.potrzebne; | |
z.wiaz = konstrukcje.Gwiezdny_portal.wiaz*z.potrzebne; | |
z.stal = konstrukcje.Gwiezdny_portal.ruda_zelaza*z.potrzebne; | |
z.miedz = konstrukcje.Gwiezdny_portal.ruda_miedzi*z.potrzebne; | |
z.cyna = konstrukcje.Gwiezdny_portal.ruda_cyny*z.potrzebne; | |
z.cynk = konstrukcje.Gwiezdny_portal.ruda_cynku*z.potrzebne; | |
z.wegiel = konstrukcje.Gwiezdny_portal.wegiel*z.potrzebne; | |
z.mithril = konstrukcje.Gwiezdny_portal.mithril*z.potrzebne; | |
z.zelazo = konstrukcje.Gwiezdny_portal.ruda_zelaza*z.potrzebne; | |
suma2 = [z.adamantium, z.krysztal, z.meteoryt, z.sosna, z.leszczyna, z.cis, z.wiaz, z.stal, z.miedz, z.cyna, z.cynk, z.wegiel, z.mithril, z.zelazo] | |
//x = Math.min(a,b,c,d,e,f,g,h,i,j,k,l,m); | |
//if (konstrukcje.Gwiezdny_portal.moje<konstrukcje.Gwiezdny_portal.wymagane) { | |
// newDiv.innerHTML += 'Możesz zrobić jeszcze ' + Math.floor(x) + ' Gwiezdnych Portali. Do ukończenia pozostało jeszcze ' + JSON.stringify(z) + '<br />'; | |
//} | |
a = Adamantium/konstrukcje.Swietlny_obelisk.adamantium; | |
b = Krysztal/konstrukcje.Swietlny_obelisk.krysztal; | |
c = Meteor/konstrukcje.Swietlny_obelisk.meteoryt; | |
d = Sosna/konstrukcje.Swietlny_obelisk.sosna; | |
e = Leszczyna/konstrukcje.Swietlny_obelisk.leszczyna; | |
f = Cis/konstrukcje.Swietlny_obelisk.cis; | |
g = Wiaz/konstrukcje.Swietlny_obelisk.wiaz; | |
h = Stal/konstrukcje.Swietlny_obelisk.stal; | |
i = Zelazo/konstrukcje.Swietlny_obelisk.ruda_zelaza; | |
j = Miedz/konstrukcje.Swietlny_obelisk.ruda_miedzi; | |
k = Cyna/konstrukcje.Swietlny_obelisk.ruda_cyny; | |
l = Cynk/konstrukcje.Swietlny_obelisk.ruda_cynku; | |
m = Wegiel/konstrukcje.Swietlny_obelisk.wegiel; | |
z = {}; | |
z.potrzebne = konstrukcje.Swietlny_obelisk.wymagane-konstrukcje.Swietlny_obelisk.moje; | |
z.adamantium = konstrukcje.Swietlny_obelisk.adamantium*z.potrzebne; | |
z.krysztal = konstrukcje.Swietlny_obelisk.krysztal*z.potrzebne; | |
z.meteoryt = konstrukcje.Swietlny_obelisk.meteoryt*z.potrzebne; | |
z.sosna = konstrukcje.Swietlny_obelisk.sosna*z.potrzebne; | |
z.leszczyna = konstrukcje.Swietlny_obelisk.leszczyna*z.potrzebne; | |
z.cis = konstrukcje.Swietlny_obelisk.cis*z.potrzebne; | |
z.wiaz = konstrukcje.Swietlny_obelisk.wiaz*z.potrzebne; | |
z.stal = konstrukcje.Swietlny_obelisk.ruda_zelaza*z.potrzebne; | |
z.miedz = konstrukcje.Swietlny_obelisk.ruda_miedzi*z.potrzebne; | |
z.cyna = konstrukcje.Swietlny_obelisk.ruda_cyny*z.potrzebne; | |
z.cynk = konstrukcje.Swietlny_obelisk.ruda_cynku*z.potrzebne; | |
z.wegiel = konstrukcje.Swietlny_obelisk.wegiel*z.potrzebne; | |
z.mithril = konstrukcje.Swietlny_obelisk.mithril*z.potrzebne; | |
z.zelazo = konstrukcje.Swietlny_obelisk.ruda_zelaza*z.potrzebne; | |
suma3 = [z.adamantium, z.krysztal, z.meteoryt, z.sosna, z.leszczyna, z.cis, z.wiaz, z.stal, z.miedz, z.cyna, z.cynk, z.wegiel, z.mithril, z.zelazo] | |
//x = Math.min(a,b,c,d,e,f,g,h,i,j,k,l,m); | |
//if (konstrukcje.Swietlny_obelisk.moje<konstrukcje.Swietlny_obelisk.wymagane) { | |
// newDiv.innerHTML += 'Możesz zrobić jeszcze ' + Math.floor(x) + ' Świetlnych Obelisków. Do ukończenia pozostało jeszcze ' + JSON.stringify(z) + '<br />'; | |
//} | |
a = Adamantium/konstrukcje.Plomienny_znicz.adamantium; | |
b = Krysztal/konstrukcje.Plomienny_znicz.krysztal; | |
c = Meteor/konstrukcje.Plomienny_znicz.meteoryt; | |
d = Sosna/konstrukcje.Plomienny_znicz.sosna; | |
e = Leszczyna/konstrukcje.Plomienny_znicz.leszczyna; | |
f = Cis/konstrukcje.Plomienny_znicz.cis; | |
g = Wiaz/konstrukcje.Plomienny_znicz.wiaz; | |
h = Stal/konstrukcje.Plomienny_znicz.stal; | |
i = Zelazo/konstrukcje.Plomienny_znicz.ruda_zelaza; | |
j = Miedz/konstrukcje.Plomienny_znicz.ruda_miedzi; | |
k = Cyna/konstrukcje.Plomienny_znicz.ruda_cyny; | |
l = Cynk/konstrukcje.Plomienny_znicz.ruda_cynku; | |
m = Wegiel/konstrukcje.Plomienny_znicz.wegiel; | |
z = {}; | |
z.potrzebne = konstrukcje.Plomienny_znicz.wymagane-konstrukcje.Plomienny_znicz.moje; | |
z.adamantium = konstrukcje.Plomienny_znicz.adamantium*z.potrzebne; | |
z.krysztal = konstrukcje.Plomienny_znicz.krysztal*z.potrzebne; | |
z.meteoryt = konstrukcje.Plomienny_znicz.meteoryt*z.potrzebne; | |
z.sosna = konstrukcje.Plomienny_znicz.sosna*z.potrzebne; | |
z.leszczyna = konstrukcje.Plomienny_znicz.leszczyna*z.potrzebne; | |
z.cis = konstrukcje.Plomienny_znicz.cis*z.potrzebne; | |
z.wiaz = konstrukcje.Plomienny_znicz.wiaz*z.potrzebne; | |
z.stal = konstrukcje.Plomienny_znicz.ruda_zelaza*z.potrzebne; | |
z.miedz = konstrukcje.Plomienny_znicz.ruda_miedzi*z.potrzebne; | |
z.cyna = konstrukcje.Plomienny_znicz.ruda_cyny*z.potrzebne; | |
z.cynk = konstrukcje.Plomienny_znicz.ruda_cynku*z.potrzebne; | |
z.wegiel = konstrukcje.Plomienny_znicz.wegiel*z.potrzebne; | |
z.mithril = konstrukcje.Plomienny_znicz.mithril*z.potrzebne; | |
z.zelazo = konstrukcje.Plomienny_znicz.ruda_zelaza*z.potrzebne; | |
suma4 = [z.adamantium, z.krysztal, z.meteoryt, z.sosna, z.leszczyna, z.cis, z.wiaz, z.stal, z.miedz, z.cyna, z.cynk, z.wegiel, z.mithril, z.zelazo] | |
//x = Math.min(a,b,c,d,e,f,g,h,i,j,k,l,m); | |
//if (konstrukcje.Plomienny_znicz.moje<konstrukcje.Plomienny_znicz.wymagane) { | |
// newDiv.innerHTML += 'Możesz zrobić jeszcze ' + Math.floor(x) + ' Płomiennych Zniczy. Do ukończenia pozostało jeszcze ' + JSON.stringify(z) + '<br />'; | |
//} | |
a = Adamantium/konstrukcje.Srebrzysta_fontanna.adamantium; | |
b = Krysztal/konstrukcje.Srebrzysta_fontanna.krysztal; | |
c = Meteor/konstrukcje.Srebrzysta_fontanna.meteoryt; | |
d = Sosna/konstrukcje.Srebrzysta_fontanna.sosna; | |
e = Leszczyna/konstrukcje.Srebrzysta_fontanna.leszczyna; | |
f = Cis/konstrukcje.Srebrzysta_fontanna.cis; | |
g = Wiaz/konstrukcje.Srebrzysta_fontanna.wiaz; | |
h = Stal/konstrukcje.Srebrzysta_fontanna.stal; | |
i = Zelazo/konstrukcje.Srebrzysta_fontanna.ruda_zelaza; | |
j = Miedz/konstrukcje.Srebrzysta_fontanna.ruda_miedzi; | |
k = Cyna/konstrukcje.Srebrzysta_fontanna.ruda_cyny; | |
l = Cynk/konstrukcje.Srebrzysta_fontanna.ruda_cynku; | |
m = Wegiel/konstrukcje.Srebrzysta_fontanna.wegiel; | |
z = {}; | |
z.potrzebne = konstrukcje.Srebrzysta_fontanna.wymagane-konstrukcje.Srebrzysta_fontanna.moje; | |
z.adamantium = konstrukcje.Srebrzysta_fontanna.adamantium*z.potrzebne; | |
z.krysztal = konstrukcje.Srebrzysta_fontanna.krysztal*z.potrzebne; | |
z.meteoryt = konstrukcje.Srebrzysta_fontanna.meteoryt*z.potrzebne; | |
z.sosna = konstrukcje.Srebrzysta_fontanna.sosna*z.potrzebne; | |
z.leszczyna = konstrukcje.Srebrzysta_fontanna.leszczyna*z.potrzebne; | |
z.cis = konstrukcje.Srebrzysta_fontanna.cis*z.potrzebne; | |
z.wiaz = konstrukcje.Srebrzysta_fontanna.wiaz*z.potrzebne; | |
z.stal = konstrukcje.Srebrzysta_fontanna.ruda_zelaza*z.potrzebne; | |
z.miedz = konstrukcje.Srebrzysta_fontanna.ruda_miedzi*z.potrzebne; | |
z.cyna = konstrukcje.Srebrzysta_fontanna.ruda_cyny*z.potrzebne; | |
z.cynk = konstrukcje.Srebrzysta_fontanna.ruda_cynku*z.potrzebne; | |
z.wegiel = konstrukcje.Srebrzysta_fontanna.wegiel*z.potrzebne; | |
z.mithril = konstrukcje.Srebrzysta_fontanna.mithril*z.potrzebne; | |
z.zelazo = konstrukcje.Srebrzysta_fontanna.ruda_zelaza*z.potrzebne; | |
suma5 = [z.adamantium, z.krysztal, z.meteoryt, z.sosna, z.leszczyna, z.cis, z.wiaz, z.stal, z.miedz, z.cyna, z.cynk, z.wegiel, z.mithril, z.zelazo] | |
z = {} | |
z.potrzebne = mikstura.Magiczna_esensja.wymagane-mikstura.Magiczna_esensja.moje | |
z.illani = mikstura.Magiczna_esensja.illani*z.potrzebne | |
z.nutari = mikstura.Magiczna_esensja.nutari*z.potrzebne | |
z.illanias = mikstura.Magiczna_esensja.illanias*z.potrzebne | |
z.dynallca = mikstura.Magiczna_esensja.dynallca*z.potrzebne | |
suma6 = [z.illani, z.nutari, z.illanias, z.dynallca] | |
z = {} | |
z.potrzebne = mikstura.Gwiezdna_masc.wymagane-mikstura.Gwiezdna_masc.moje | |
z.illani = mikstura.Gwiezdna_masc.illani*z.potrzebne | |
z.nutari = mikstura.Gwiezdna_masc.nutari*z.potrzebne | |
z.illanias = mikstura.Gwiezdna_masc.illanias*z.potrzebne | |
z.dynallca = mikstura.Gwiezdna_masc.dynallca*z.potrzebne | |
suma7 = [z.illani, z.nutari, z.illanias, z.dynallca] | |
z = {} | |
z.potrzebne = mikstura.Eliksir_Illuminati.wymagane-mikstura.Eliksir_Illuminati.moje | |
z.illani = mikstura.Eliksir_Illuminati.illani*z.potrzebne | |
z.nutari = mikstura.Eliksir_Illuminati.nutari*z.potrzebne | |
z.illanias = mikstura.Eliksir_Illuminati.illanias*z.potrzebne | |
z.dynallca = mikstura.Eliksir_Illuminati.dynallca*z.potrzebne | |
suma8 = [z.illani, z.nutari, z.illanias, z.dynallca] | |
z = {} | |
z.potrzebne = mikstura.Astralne_medium.wymagane-mikstura.Astralne_medium.moje | |
z.illani = mikstura.Astralne_medium.illani*z.potrzebne | |
z.nutari = mikstura.Astralne_medium.nutari*z.potrzebne | |
z.illanias = mikstura.Astralne_medium.illanias*z.potrzebne | |
z.dynallca = mikstura.Astralne_medium.dynallca*z.potrzebne | |
suma9 = [z.illani, z.nutari, z.illanias, z.dynallca] | |
z = {} | |
z.potrzebne = mikstura.Magiczny_absynt.wymagane-mikstura.Magiczny_absynt.moje | |
z.illani = mikstura.Magiczny_absynt.illani*z.potrzebne | |
z.nutari = mikstura.Magiczny_absynt.nutari*z.potrzebne | |
z.illanias = mikstura.Magiczny_absynt.illanias*z.potrzebne | |
z.dynallca = mikstura.Magiczny_absynt.dynallca*z.potrzebne | |
suma10 = [z.illani, z.nutari, z.illanias, z.dynallca] | |
//x = Math.min(a,b,c,d,e,f,g,h,i,j,k,l,m); | |
//if (konstrukcje.Srebrzysta_fontanna.moje<konstrukcje.Srebrzysta_fontanna.wymagane) { | |
// newDiv.innerHTML += 'Możesz zrobić jeszcze ' + Math.floor(x) + ' Srebrzystych Fontann. Do ukończenia pozostało jeszcze ' + JSON.stringify(z) + '<br />'; | |
//} | |
tabelka = document.getElementsByClassName("td") | |
currentDiv = tabelka[2] | |
let suma = {} | |
suma.adamantium = suma1[0] + suma2[0] + suma3[0] + suma4[0] + suma5[0] - Adamantium | |
suma.krysztal = suma1[1] + suma2[1] + suma3[1] + suma4[1] + suma5[1] - Krysztal | |
suma.meteoryt = suma1[2] + suma2[2] + suma3[2] + suma4[2] + suma5[2] - Meteor | |
suma.sosna = suma1[3] + suma2[3] + suma3[3] + suma4[3] + suma5[3] - Sosna | |
suma.leszczyna = suma1[4] + suma2[4] + suma3[4] + suma4[4] + suma5[4] - Leszczyna | |
suma.cis = suma1[5] + suma2[5] + suma3[5] + suma4[5] + suma5[5] - Cis | |
suma.wiaz = suma1[6] + suma2[6] + suma3[6] + suma4[6] + suma5[6] - Wiaz | |
suma.stal = suma1[7] + suma2[7] + suma3[7] + suma4[7] + suma5[7] - Stal | |
suma.miedz = suma1[8] + suma2[8] + suma3[8] + suma4[8] + suma5[8] - Miedz | |
suma.cyna = suma1[9] + suma2[9] + suma3[9] + suma4[9] + suma5[9] - Cyna | |
suma.cynk = suma1[10] + suma2[10] + suma3[10] + suma4[10] + suma5[10] - Cynk | |
suma.wegiel = suma1[11] + suma2[11] + suma3[11] + suma4[11] + suma5[11] - Wegiel | |
suma.mithril = suma1[12] + suma2[12] + suma3[12] + suma4[12] + suma5[12] - Mithril | |
suma.zelazo = suma1[13] + suma2[13] + suma3[13] + suma4[13] + suma5[13] - Zelazo | |
suma.illani = suma6[0] + suma7[0] + suma8[0] + suma9[0] + suma10[0] - Illani | |
suma.nutari = suma6[1] + suma7[1] + suma8[1] + suma9[1] + suma10[1] - Nutari | |
suma.illanias = suma6[2] + suma7[2] + suma8[2] + suma9[2] + suma10[2] - Illanias | |
suma.dynallca = suma6[3] + suma7[3] + suma8[3] + suma9[3] + suma10[3] - Dynallca | |
newDiv.innerHTML += ` | |
<table> | |
<thead> | |
<tr> | |
<th>adamantium</th> | |
<th>krysztal</th> | |
<th>meteoryt</th> | |
<th>sosna</th> | |
<th>leszczyna</th> | |
<th>cis</th> | |
<th>wiaz</th> | |
<th>stal</th> | |
<th>miedz</th> | |
<th>cyna</th> | |
<th>cynk</th> | |
<th>żelazo</th> | |
<th>wegiel</th> | |
<th>mithril</th> | |
</tr> | |
<tr> | |
<th>${suma.adamantium}</th> | |
<th>${suma.krysztal}</th> | |
<th>${suma.meteoryt}</th> | |
<th>${suma.sosna}</th> | |
<th>${suma.leszczyna}</th> | |
<th>${suma.cis}</th> | |
<th>${suma.wiaz}</th> | |
<th>${suma.stal}</th> | |
<th>${suma.miedz}</th> | |
<th>${suma.cyna}</th> | |
<th>${suma.cynk}</th> | |
<th>${suma.zelazo}</th> | |
<th>${suma.wegiel}</th> | |
<th>${suma.mithril}</th> | |
</tr> | |
<br /> | |
<tr> | |
<th>Illani</th> | |
<th>Nutari</th> | |
<th>Illanias</th> | |
<th>Dynallca</th> | |
</tr> | |
<tr> | |
<th>${suma.illani}</th> | |
<th>${suma.nutari}</th> | |
<th>${suma.illanias}</th> | |
<th>${suma.dynallca}</th> | |
</tr> | |
</thead> | |
</table> | |
` | |
//newDiv.innerHTML += JSON.stringify(suma); | |
//newDiv.innerHTML += '<b>Mikstury</b><br />'; | |
//newDiv.innerHTML += 'Magiczna Esencja <br />'; | |
//newDiv.innerHTML += '<progress value="' + (mikstura.Magiczna_esensja.moje) + '" max="' + (mikstura.Magiczna_esensja.wymagane) + '"></progress>'; | |
function insertAfter(referenceNode, newNode) { | |
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); | |
} | |
insertAfter(currentDiv, newDiv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment