Free javascript Hosting


margovanish-by-smartmargo-user.js

Uploaded on May 16 2022 18:56 by szymek0254

// ==UserScript==
// @name MargoVanish by SmartMargo
// @author Squanchy
// @version 0.1
// @match https://*.margonem.pl/
// ==/UserScript==

//Uruchomienie Vanisha - Klik prawym przyciskiem na 'Ping' ^^
//Niedociągnięcia ewentualne poprawki możecie zgłaszać
let Vanish;
if(localStorage.getItem('Vanish') == null)localStorage.setItem('Vanish','true')
setInterval(() => {
const inBagItemsCount = Object.values(g.item).filter((item) => {
return item.name == "Zwój teleportacji na Kwieciste Przejście" && item.loc == "g";
}).length;
const inBagItemsCount2 = Object.values(g.item).filter((item) => {
return item.name == "Duża pomarańczowa mikstura" && item.loc == "g";
}).length;
const inBagItemsCount12 = Object.values(g.item).filter((item) => {
return item.name == "Pomarańczowa mikstura" && item.loc == "g";
}).length;
g.loadQueue.push({
fun: function(){
let hajs = hero.gold/1000000;
if(localStorage.getItem('Vanish')=='false'){
dq.innerHTML = `<center><b><i><br/><a id="Log1">Dane Podstawowe</a></b></i><br/><a id="Log10">Nick:</a> "${hero.nick}"<br/><a id="Log10">Poziom i Profesja:</a> "${hero.lvl}" lvl, (<input type="button" value="`+Profesja()+`" id="Profka";>)<br/><a id="Log10">Świat:</a> ${g.worldname.charAt(0).toUpperCase() + g.worldname.slice(1)}<br/>--------------------------------------------------------<br/><b><i><a id="Log2">Dane Mapy</a></b></i><br/><a id="Log10">Mapa:</a> "${map.name}"<br/><a id="Log10">Rodzaj Mapy Pvp(Nr+Opis):</a> <input type="button" id="mapapvp" value="`+mapPvp()+`";><br/><a id="Log10">ID Mapy:</a> ${map.id}<br/>--------------------------------------------------------<br/><b><i><a id="Log3">Dane Dodatkowe</a></b></i><br/><a id="Log10">Hajs:</a> ${hajs.toFixed(2)}m<br/><a id="Log10">Wyczerp:</a> ${hero.ttl}<br/><a id="Log10">Koordynaty:</a> ${hero.x}, ${hero.y}<br>--------------------------------------------------------<br/><b><i><a id="Log4">Dane Toreb</a></b></i><br/><a id="Log10">Miejsce w torbach:</a> ${g.bags.slice(0,1).reduce((p, [max, occ]) => p + max - occ, 0)}, ${g.bags.slice(1,2).reduce((p, [max, occ]) => p + max - occ, 0)}, ${g.bags.slice(2,3).reduce((p, [max, occ]) => p + max - occ, 0)}<br><a id="Log10">Duże Poty Tuni:</a> ${inBagItemsCount2}<br><a id="Log10">Średnie Poty Tuni:</a> ${inBagItemsCount12} <br><a id="Log10">Zwoje na Kwiaty:</a> ${inBagItemsCount} </center>`;
FooterVanish.innerHTML = `<center><br/> <- Kliknij Prawym na Ping</center>`;
ZdrDosVan.innerHTML = `--- Życie || Exp ---`;
}
}});},200);

function mapPvp(){
switch(map.pvp){
case 0:
return "Zielona [0]";
case 1:
return "Zółta [1]";
case 2:
return "Czerwona [2]";
case 4:
return "Arena [4]";
}}
function Profesja(){
switch(hero.prof){
case"m":
return "Mag";
case"w":
return "Woj";
case"p":
return "Pal";
case"t":
return "Trop";
case"b":
return "Tańc";
case"h":
return "Łowca";
}}
function Kindybal(){
if(localStorage.getItem('Vanish')=='true'){
dq.style.display = "none";
LogoVan.style.display = "none";
FooterVanish.style.display = "none";
ZdrDosVan.style.display = "none";}
else if(localStorage.getItem('Vanish')=='false'){
dq.style.display = "block";
LogoVan.style.display = "block";
ZdrDosVan.style.display = "block";}}
setInterval(Kindybal,250)
$('#lagmeter').rightClick(function(){
if((dq.style.display === "none") && (LogoVan.style.display === "none") && (ZdrDosVan.style.display === "none") && (FooterVanish.style.display === "none")) {
localStorage.setItem('Vanish','false');
location.reload();
}else{
localStorage.setItem('Vanish','true');}
location.reload();
});
$("base").css("border", "2px solid gold");
(() => {
if(localStorage.getItem('Vanish')=='false'){
const mycss = `.npc,#loading,#ni-promo,.other,#ground,#bground,#exp2,#life2,#leorn1,#leorn2,#panel,#stats,.rt-ver,.rd-ver,.rd-hor,.rt-hor,.ld-ver,.ld-ver,.ld-hor,.lt-ver,.lt-hor,#mailnotifier,#bchat,#premiumbut,#pvpmode,#logoutbut,#base3,#botloc,.border-u,.border-l,.border-r,.border-d,#gold{display:none;}`,
$stylecss = document.createElement("style");
$stylecss.innerHTML = mycss;
document.head.appendChild($stylecss);
}})();
let LogoVan = document.createElement('div');
LogoVan.id='BanerVanish';
centerbox2.appendChild(LogoVan);
let FooterVanish = document.createElement('div');
FooterVanish.id='VanishFoot';
centerbox2.appendChild(FooterVanish);

let dq = document.createElement('div');
dq.id='StatHero';
centerbox2.appendChild(dq);
let ZdrDosVan = document.createElement('div');
ZdrDosVan.id='StatHpExp';
centerbox2.appendChild(ZdrDosVan);
if(localStorage.getItem('Vanish')=='false'){
let style = document.createElement(`style`);
style.type = `text/css`;
let css = `
#panelik{
left:880px !important;
}
#base{
border: 2px solid gold;
border-radius: 10px;
}
#life1{
width: 122px !important;
height:33px;
top: 85px;
border: 2px solid silver;
border-radius: 1px;
background-color: #4f1a2a;
}
#exp1{
width: 122px !important;
background-color: #4f1a2a;
width: 222px;
height:33px;
top: 85px;
left: 675px;
border: 2px solid silver;
border-radius: 3px;
}
#corners{display:none}
#Profka,#mapapvp{
border: 1px solid gold !important;
border-radius:10px;
background: black;
color: silver;
font-weight: 700;
}
#StatHpExp{
position: absolute;
width: 345px;
height: 73px;
left:525px;
border: 1px solid silver;
font-size: 33px;
background-color: #011324;
top:50px;
}
#Log1,#Log2,#Log3,#Log4{
color: gold;
}
#Log10{
color: silver;
}
#BanerVanish{
font-size: 25px !important;
position: absolute;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border: 1px solid red;
font-size: 17px;
background-color: #191919;
width: 345px;
height: 49px;
left:525px;
top:0px;
}
#StatHero{
position: absolute;
border: 1px solid red;
font-size: 17px;
background-color: #191919;
width: 345px;
height: 386px;
left:525px;
top:125px;
}
#VanishFoot{
position: absolute;
background-color: #011324;
width: 345px ;
border: 1px solid silver ;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
height: 33px ;
top: 503px;
left: 525px;
}

`;
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
}

(() => {
const config = {
// Można zmienić język przedrostków przy liczbach
// (1mln - pl, 1M - en, itd. Wspiera ponad 90 języków)
lang: "en",
// Liczba cyfr po przecinku do wyświetlenia.
precision: 3,
// Wielkość tekstu.
fontSize: 13,
// czy ma pokazywać % golda do limitu.
goldPercent: false,
};

const span = $("<span></span>").css({
fontSize: config.fontSize,
whiteSpace: "nowrap",
});

const format = new Intl.NumberFormat(config.lang, {
notation: "compact",
});

const percent = new Intl.NumberFormat(config.lang, {
style: "unit",
maximumFractionDigits: config.precision,
unit: "percent",
});

const healthSpan = span.clone().appendTo("#life1");
const expSpan = span.clone().appendTo("#exp1");
$("#life1, #exp1").css("text-align", "center");

const updateExp = (stats) => {
let previousExp = Math.round(Math.pow(stats.lvl - 1, 4) + 10);
if (stats.lvl == 1) {
previousExp = 0;
}
const expPercent = percent.format(
((stats.exp - previousExp) /
(Math.pow(stats.lvl, 4) + 10 - previousExp)) *
100
);
const exp = format.format(Math.pow(stats.lvl, 4) + 10 - stats.exp);
expSpan.html(`${expPercent} (${exp})`);
};

const updateHealth = (stats) => {
const hp = stats.hp ?? stats.warrior_stats.hp;
const maxhp = stats.maxhp ?? stats.warrior_stats.maxhp;
const hpPercent = percent.format(((hp / maxhp) * 1000) / 10);
const formattedHp = format.format(hp - maxhp);
healthSpan.html(`${hpPercent}`);
};

const updateGold = () => {
const gold = hero.gold;
const formattedGold = format.format(gold);
const fullGold = gold.toLocaleString(config.lang, {
notation: "standard",
});
const goldLimit = format.format(hero.goldlim);
const goldPercent = config.goldPercent
? ` (${percent.format(100 * (gold / hero.goldlim))})`
: "";

};

const udpate = (stats) => {
if (stats.exp) {
updateExp(stats);
}
if (stats.hp || (stats.warrior_stats && stats.warrior_stats.hp)) {
updateHealth(stats);
}
if (
stats.gold ||
stats.ttl ||
stats.credits ||
stats.ph ||
stats.hp ||
stats.warrior_stats
) {
updateGold();
}
};

const old = hero._u;
hero._u = (...data) => {
old.call(hero, ...data);
udpate(data[0]);
};

g.loadQueue.push({
fun: udpate,
data: hero,
});
})();


if(!localStorage.getItem('VanishInfo')) {

localStorage.setItem('VanishInfo', '1');

mAlert(`<center><b><span style="color:green">*Margo Vanish by SM*</span></b></center><br>
<center><b><i><span style="color:red">Pierwsze Uruchomienie</span></i></b></center><br><br>
Uruchomiłeś po raz pierwszy 'Margo Vanisha' jest to dodatek służący do optymalizacji.<br><br>
Aby go uruchomić i sprawdzić wystarczy kliknąć <b>Prawym Przyciskiem Myszki</b> na <b>Ping</b>`);

}

Back to list