Advertisement
iradap

Minutnik margonem.com

Aug 19th, 2018
3,304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 20.21 KB | None | 0 0
  1. !function(){function e(a,b,c,d){this.name=a,this.time=b,this.world=c,this.charid=d,this.seconds=b-o(),this.$node=this.createHTMLNode()}function f(){function c(a,b){return a.toLowerCase()+":"+b}var a={};this.add=function(b){var d=c(b.name,b.world);this.delete(d),a[d]=b},this.delete=function(b,d){var e=d?c(b,d):b;a[e]&&(a[e].removeHTMLNode(),delete a[e])},this.get=function(b,d){return a[c(b,d)]},this.getAll=function(b){var c=[];for(var d in a)a.hasOwnProperty(d)&&c.push(b?a[d].serialize():a[d]);return c},this.serialize=function(){return this.getAll(!0).join(";")},this.clear=function(){for(var b in a)a.hasOwnProperty(b)&&a[b].removeHTMLNode();a={}}}function h(a){var b=$('<div id="ext-timer"></div>'),c=$("<style>#ext-timer{position:absolute;opacity:.7;color:#fff;z-index:340;background:-moz-linear-gradient(to right,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 40%,rgba(0,0,0,0) 100%);background:-webkit-linear-gradient(left,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 40%,rgba(0,0,0,0) 100%);background:linear-gradient(to right,rgba(0,0,0,.8) 0,rgba(0,0,0,.8) 40%,rgba(0,0,0,0) 100%);pointer-events:none;font-size:15px}#ext-timer .node{margin:3px 6px;font-family:arial;cursor:default;line-height:normal}#ext-timer .node .name,#ext-timer .node .world{display:inline;margin-left:.3em;text-transform:uppercase}#ext-timer .node.after{color:#ff0}#ext-timer .node.highlighted{background: rgba(255,0,0,0.8)}#ext-timer .node .time{display:inline;font-weight:700}#ext-timer .node .name{font-weight:700}#ext-timer .node .world{font-size:.75em}</style>");this.settings=a,this.create=function(){var a=this;c.appendTo("head"),b.css("font-size",this.settings.get("fontSize")+"px"),b.css("opacity",this.settings.get("opacity")),l()?b.appendTo(".game-layer"):b.appendTo(this.settings.get("position")),$(document).keydown(function(a){17==a.keyCode&&b.css({"pointer-events":"auto",opacity:"1"})}),$(document).keyup(function(c){c.ctrlKey||b.css({"pointer-events":"none",opacity:a.settings.get("opacity")})})},this.get=function(){return b},this.sortNodes=function(){b.children().sort(function(a,b){return a.dataset.time>b.dataset.time}).appendTo(b)}}function i(){var a={};this.load=function(b){return a[b]=new Audio(b),!0},this.loadAll=function(a){for(var b in a)this.load(a[b].url);return!0},this.unload=function(b){return!!a[b]&&(delete a[b],!0)},this.play=function(b){return a[b]||this.load(b),a[b].pause(),a[b].currentTime=0,a[b].play(),!0}}function j(a){var b="timer/settings/",c={speed:1,firstRun:1,titleNotify:1,audioNotify:0,audioURL:"http://experimental-ni.margonem.pl/sounds/elite2_here.mp3",altAudioNotify:0,altAudioURL:"http://experimental-ni.margonem.pl/sounds/new_mail.mp3",altNotifyTime:50,highlightNode:"0",fontSize:15,stayAfterDuration:60,opacity:"0.7",position:"#centerbox",iconPosition:"#centerbox2",fixBookmarks:1};this.audioManager=a,this.get=function(a){return localStorage.getItem(b+a)||c[a]},this.isset=function(a){return!!localStorage.getItem(b+a)},this.set=function(a,c){return this.get(a)!=c&&localStorage.setItem(b+a,c)},this.changeFontSize=function(a){this.set("fontSize",a),$("#ext-timer").css("font-size",a+"px")},this.changeOpacity=function(a){this.set("opacity",a),$("#ext-timer").css("opacity",a)},this.changePosition=function(a){if(l())return new Error("Cannot change position on new interface");var b=["body","#centerbox"];return b.indexOf(a)<0?new Error("Valid positions are: "+b.join(", ")):(this.set("position",a),void $("#ext-timer").detach().appendTo(a))},this.changeIconPosition=function(a){return l()?new Error("Cannot change icon position on new interface"):void("body"==a?(this.set("iconPosition",a),$("#ext-timer-oldicon").detach().css({top:"auto",bottom:"5px",right:"5px"}).appendTo("body")):(this.set("iconPosition",centerbox),$("#ext-timer-oldicon").detach().css({top:"-24px",bottom:"auto",right:"auto"}).appendTo("#centerbox2")))},this.reset=function(){for(var a in c)c.hasOwnProperty(a)&&("fontSize"==a?this.changeFontSize(c[a]):"opacity"==a?this.changeOpacity(c[a]):"position"==a?this.changePosition(c[a]):this.set(a,c[a]));return!0},this.changeAudioURL=function(a,b){var c=this.get(a);c!=b&&(this.audioManager.unload(c),this.audioManager.load(b),this.set(a,b))}}function k(a,b){var c=this;this.settings=a,this.audioManager=b,this.$window=null,this.$icon=null,this.createIcon=function(){l()?(this.$icon=$('<div class="widget-button green" data-tip="Minutnik" data-tip-type="t_static"></div>').appendTo(".bottom-left.main-buttons-container"),this.$icon.append($('<div class="icon" style="background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAMAAAAM7l6QAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAIuUExURQAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQICAgMDAwQEBAUFBQYGBggICAkJCQoKCgwMDA0NDQ4ODhAQEBISEhQUFBUVFRYWFhcXFxgYGBsbGxwcHB8fHyEhISIiIiMjIyQkJCUlJSYmJicnJygoKCoqKisrKywsLC0tLS8vLzIyMjU1NTc3Nzg4ODk5OTo6Ojs7Ozw8PD09PT4+Pj8/P0JCQkNDQ0REREZGRkdHR0hISEpKSkxMTE5OTk9PT1BQUFNTU1RUVFZWVldXV1lZWV1dXWJiYmpqamtra2xsbG1tbW9vb3FxcXR0dHV1dXZ2dnh4eHl5eXt7e3x8fH19fX5+fn9/f4KCgoODg4SEhIWFhYiIiIqKiouLi42NjY+Pj5CQkJGRkZOTk5SUlJWVlZaWlpmZmZqampycnJ6enp+fn6SkpKampqenp6mpqaqqqqurq62tra6uruVRxdgAAABOdFJOUwAAAQIDBAUGBwgKCwwNDg8QERMUFRYYGRwgIiQmJygpKiwtMzU2Nzg9QEJERUdKS0xOT1JVWltdXl9kZmhrbG5vcXl8f5CRlpuepKWoqwanB9oAAAIySURBVCjPfdOHU9NQHAfwmKStSIelQEUt7gkuVCwOcG9e00G3ogWrReqgKg7cAwdOQCtibVG0VFChjH7/O5O0teOQ3+VyeffJS+43HjVrxqD4KxNsqZbNWuaxhNgdhP0vLz7RE3KWURKtdBqWaeoCgK+qiDgM6nyWlnMNZ19NoMtmCozcMRbksoq4HkchxEj3KMIWVQ4v5doTwK/BcDga5195cFCSzSWmLmD4mddmNrsC/eMINe5hMyw7+mgSH52kUqtQ6ojpdmJqwF2TYb0/jteWajFjpqyCnAc+mdRpVhiD6HdU0ILS+5xnttS3A1cIk+Jtl8bRskNUqsYa7SZqUxAxsyrJLPnAf0spVnWh4XP85CZK3zKJptVJLrbGcHmnoHLifDrRdJilNJYYOggjss49hOa1wn/J3T/oOManLON60clJRV7SGEPzGqGuXAzwrBIaS97iRYrnu4bgWy/u9n/paSjinwq4IB4aJCLPtXzFDT4NippdazVWCRnMs8dwldAiM+QNQtYSMWu12CmGXIzj9PJU3ptbfyf8++nMWGjMA/hmVqZYzkXww6Zn0lpYfx9o20una17rHUOfc7c8OY7l5BbfIJPqX0skR64BkXPG7SsXLKokrk5+Ya/O6vcccnMKeNnmcbm994aBd85ddPa0FB6/8F6YpCnh9v2JZQOTO2uyrZbrvZGfY6ODfc9PHSil8yeVLq7j7J5Wn9t8aBk77TGQaVdsXKdT0LmnZKb4C5WKsfyR1cALAAAAAElFTkSuQmCC"></div)">'))):(this.$icon=$('<div id="ext-timer-oldicon" style="top: -24px; width: 16px; height: 16px; background: gray; position: absolute; border-radius: 3px; cursor:pointer;" tip="Ustawienia minutnika"></div>'),"body"==this.settings.get("iconPosition")?this.$icon.css({top:"auto",right:"5px",bottom:"5px"}).appendTo("body"):this.$icon.appendTo("#centerbox2"),this.$icon.append('<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABRklEQVQ4T6WTu0pDQRCGE+3sxPgAaiWmMo2i4g21ShALrWwECwsh7xLQRhsbCwsRwcILxlQKSS1GRLAVQcHS2/fDLIxrOEfIwsfMnJ35d2azyWbaXNmE+jJ747Z/ha20yk0SaFAwbEU32JE0gX4SNmAH8rAHXVb0jl2FO1iDLXjUnu/giLj0zys5JG/JC8wRnEbFn8SX8A0z0BntTxNXQweDBMcwYEkqlqgEtGbtgA6Lm9giNP0I3Xx4sbHOTcAfKrEp+IAcvPkR5PfAswmcYeejlqvEkybQi331AkMEGqHPijTCAlxYLP8EwggPNsJtGEGXFJLDwV84NetowhWHfXVT83egn2YRdOtJD0wCB7DsR5Cv9tdhFzTSPviHtEJ8D3pI2/AUC4TWgq3jFCy4xo7GCWkCmySMWZH+TDr1z0qbtVXNr28/keg4EesrpdgAAAAASUVORK5CYII=" />')),this.$icon.click(function(){c.create(),c.show()})},this.create=function(b){var c=this,d=l()?"data-tip":"tip",e=l()?"150px":"100%",f='<div id="ext-timer-settings"><div style="height: 40px;"><div style="float: left; width: 170px;">Prędkość minutnika:<div class="radios"><label><input type="radio" name="speed" value="1" /> 1x</label><label><input type="radio" name="speed" value="2" /> 2x</label><label><input type="radio" name="speed" value="3" /> 3x</label></div></div><div style="float: left; width: 180px;">Pozycja minutnika:<div class="radios"><label '+d+'="Wyświetla minutnik w rogu dokumentu (na czarnym tle)"><input type="radio" name="position" value="body" /> body</label><label '+d+'="Wyświetla minutnik w rogu okna gry"><input type="radio" name="position" value="#centerbox" /> #centerbox</label></div></div></div><div style="margin-top: 5px;"><label style="display: block; margin-top: 5px;"><input type="checkbox" name="titleNotify" /> Wyświetlaj odliczanie w tytule strony</label><label style="display: block;"><input type="checkbox" name="audioNotify" /> Odegraj dźwięk przy pojawieniu się elity</label><label '+d+'="Zmiana wymaga odświeżenia gry" style="display: block;"><input type="checkbox" name="fixBookmarks" /> Przesuń zakładki na starym interfejsie</label><label style="display: block;" '+d+'="Przypina ikonkę z ustawieniami do krawędzi dokumentu"><input type="checkbox" name="iconPosition" /> Zmień pozycję ikonki z ustawieniami</label><label style="display: block;" '+d+'="Odtwarza dźwięk alternatywny przy wybranej sekundzie (czas pow. alt.)"><input type="checkbox" name="altAudioNotify"> Odtwarzaj dźwięk alt. w wybranej sekundzie</input></label><label style="display: block;" '+d+'="Podświetla wpis w minutniku na czerwono przy wybranej sekundzie (czas pow. alt.)"><input type="checkbox" name="highlightNode" /> Podświetlaj wpis w wybranej sekundzie</label></div><table style="margin-top: 10px; margin-bottom: 10px;"><tr><td style="width: '+e+'"><span '+d+'="Rozmiar czcionki">Rozmiar</span></td><td><input type="text" name="fontSize" /></td></tr><tr><td><span '+d+'="Przyjmuje wartości od 0 (całkowicie przezroczyste) do 1 (całkowicie widoczne).">Przezroczystość</span></td><td><input type="text" name="opacity" /></td></tr><tr class="audio"><td><span '+d+'="Adres ścieżki z powiadomieniem dźwiękowym">Dźwięk</span></td><td><input type="text" name="audioURL" /></td></tr><tr class="audio"><td><span '+d+'="Adres ścieżki z alternatywnym powiadomieniem dźwiękowym">Dźwięk alt.</span></td><td><input type="text" name="altAudioURL" /></td></tr><tr><td><span '+d+'="Sekunda przed zakończeniem odliczania, w której ma zostać odtworzony dźwięk alternatywny">Czas pow. alt.</span></td><td><input type="text" name="altNotifyTime" /></td></tr></table></div>';this.$window=$(f),b&&this.$window.prepend($('<p style="margin-bottom: 10px; max-width: 250px;">').text(b));var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAACqSURBVHjarJOxCsJAEETfhGAlqW39AgvBWrH1jyys/Akt/DcbRWItiDA2V4Q7Ey/GgYFbdm+Y292TbYagYCCyBSRNJZ2ShO2vBJbABbgnuYzLa6AGDNzifBnZHAObUAxQAYem4c4nALNQ1MbEQTF0Kn8fY2/BMorPwDGcX8AcWGQ3MTRy1GAF7LqamLtIe+AJ1J170AbbW0kPYJWseJ/fKGli+/qzwCe8BwARYcsBaEHtIQAAAABJRU5ErkJggg==";this.$window.find("tr.audio").each(function(){var a=$(this);$('<div style="width: 16px; height: 16px; cursor: pointer; float: right; background: url('+g+')"></div>').click(function(){c.audioManager.play(a.find("input").val())}).appendTo(a.children("td").get(0))}),this.check("speed",a.get("speed")),this.check("position",a.get("position")),"1"==this.settings.get("titleNotify")&&this.check("titleNotify"),"1"==this.settings.get("audioNotify")&&this.check("audioNotify"),"1"==this.settings.get("fixBookmarks")&&this.check("fixBookmarks"),"body"==this.settings.get("iconPosition")&&this.check("iconPosition"),"1"==this.settings.get("altAudioNotify")&&this.check("altAudioNotify"),"1"==this.settings.get("highlightNode")&&this.check("highlightNode"),this.setValue("fontSize",this.settings.get("fontSize")),this.setValue("opacity",this.settings.get("opacity")),this.setValue("audioURL",this.settings.get("audioURL")),this.setValue("altAudioURL",this.settings.get("altAudioURL")),this.setValue("altNotifyTime",this.settings.get("altNotifyTime")),l()&&(this.disable("position"),this.disable("fixBookmarks"),this.disable("iconPosition"))},this.show=function(){l()?mAlert(this.$window,[{txt:"Zapisz",callback:function(){return c.save(),!0}},{txt:"Anuluj",callback:function(){return!0}}]):mAlert(this.$window,1,[function(){c.save()}])},this.save=function(){this.settings.set("speed",this.getValue("speed",!0)),this.settings.changePosition(this.getValue("position",!0)),this.settings.set("titleNotify",this.isChecked("titleNotify")),this.settings.set("audioNotify",this.isChecked("audioNotify")),this.settings.set("fixBookmarks",this.isChecked("fixBookmarks")),this.settings.changeIconPosition(this.isChecked("iconPosition")?"body":"#centerbox2"),this.settings.set("altAudioNotify",this.isChecked("altAudioNotify")),this.settings.set("highlightNode",this.isChecked("highlightNode")),this.settings.changeFontSize(this.getValue("fontSize")),this.settings.changeOpacity(this.getValue("opacity")),this.settings.changeAudioURL("audioURL",this.getValue("audioURL")),this.settings.changeAudioURL("altAudioURL",this.getValue("altAudioURL")),this.settings.set("altNotifyTime",this.getValue("altNotifyTime")),message("Zapisano")},this.isChecked=function(a){return this.$window.find('input[name="'+a+'"]').is(":checked")?1:0},this.check=function(a,b){var c=b?'input[name="'+a+'"][value="'+b+'"]':'input[name="'+a+'"]';this.$window.find(c).attr("checked","checked")},this.getValue=function(a,b){var c=b?'input[name="'+a+'"]:checked':'input[name="'+a+'"]';return this.$window.find(c).val()},this.setValue=function(a,b){this.$window.find('input[name="'+a+'"]').val(b)},this.disable=function(a){this.$window.find('input[name="'+a+'"]').attr("disabled","disabled")}}function l(){return"undefined"==typeof g}function m(){var a=location.host.split(".")[0].toLowerCase(),b={game1:"classic",game2:"tarhuna",game3:"nerthus",game7:"lelwani",game8:"zemyna",game9:"hutena"};return b[a]?b[a]:a}function n(){return l()?Engine.hero.d.id:hero.id}function o(){return Math.floor(Date.now()/1e3)}function p(b){return b.wt>19&&b.wt<30||a.indexOf(b.nick)>-1}function q(a){if(a<1)return"0:00";var b=Math.floor(a/3600),c=Math.floor(a/60)%60;b>0&&c<10&&(c="0"+c);var d=("0"+a%60).substr(-2);return(b>0?b+":":"")+c+":"+d}function r(a,b,c){if(a==n()&&b==m())return message("Jesteś już na tej postaci");var d=new Date;d.setMonth(d.getMonth()+1),setCookie("mchar_id",a,d,"/","margonem.com"),c&&setCookie("timer/lastchar",encodeURI(n()+","+m()),d,"/","margonem.com"),document.location="http://"+b+".margonem.com/"}var a=["Werecat the Tracker","Tollok Shimger","Deadly Nightshade","Insane Bear","Shae Phu","River Lord","Gobbos","Razuglag Oklash","Raze aka Smoothy","Tarmus Vuden","Foverk Turrim","Vari Kruger","Varuk Kesug","Tollok Atamatu","Tollok Utumutu","Lady of the Hills","Cula Joshua","Mola Nito","Krogor","Toto Acirfa","Possessed Fissit","Soda","Hummopapa","Shponder","Mobile Jeecus","Masked Blaise","Masked Roman","Molybdenum Matityahu"],b=["husaria","cronus","aldous","berufs","brutal","classic","gefion","hutena","jaruna","katahha","lelwani","majuna","nomada","perkun","tarhuna","telawel","tempest","zemyna","zorza"],c=["aerials","astraja","ataentsic","avalon","badzior","concordia","destiny","dionizos","dream","eden","ertill","experimental","febris","helios","inferno","infinity","invisible","legion","majorka","mordor","narwhals","nemezis","nerthus","nexos","orchidea","orvidia","pandora","prosperity","speranza","stark","stoners","syberia","tahntos","unia","virtus","zefira"],d=b.concat(c);e.prototype.update=function(a){this.seconds=this.time-a,this.updateHTMLNode()},e.prototype.createHTMLNode=function(){var a=$('<div class="node"></div>').attr({"data-name":this.name,"data-world":this.world,"data-time":this.time,"data-charid":this.charid});return $('<div class="time"></div>').text(q(this.seconds)).appendTo(a),$('<div class="name"></div>').text(this.name).appendTo(a),this.world!=m()&&$('<div class="world"></div>').text("("+this.world+")").appendTo(a),a.bind("contextmenu",function(){return r($(this).attr("data-charid"),$(this).attr("data-world"),!0),!1}),a.appendTo("#ext-timer"),a},e.prototype.updateHTMLNode=function(){this.$node.find(".time").text(q(this.seconds)),this.seconds<1&&!this.$node.hasClass("after")&&this.$node.addClass("after"),this.highlighted&&this.$node.hasClass("highlighted")&&(this.$node.removeClass("highlighted"),this.highlighted=!1)},e.prototype.removeHTMLNode=function(){this.$node.remove()},e.prototype.serialize=function(){var b=a.indexOf(this.name)>-1?a.indexOf(this.name):this.name,c=d.indexOf(this.world)>-1?d.indexOf(this.world):this.world;return[b,this.time,c,this.charid].join(",")},window.Timer=new function(){function B(){var a=x.getAll(!1),b=null,c=o();for(var d in a){var e=a[d];e.update(c),"1"==w.get("altAudioNotify")&&e.seconds==w.get("altNotifyTime")&&v.play(w.get("altAudioURL")),"1"==w.get("highlightNode")&&e.seconds==w.get("altNotifyTime")&&(e.$node.addClass("highlighted"),e.highlighted=!0),e.seconds<-w.get("stayAfterDuration")?x.delete(e.name,e.world):(!b||e.time<b.time)&&(b=e)}document.hidden&&"1"==w.get("titleNotify")&&H(b)}function C(){w.set("firstRun","0");var a=m(),c=1;if("pandora"==a||"experimental"==a)c=3;else if("syberia"==a)c=2;else if(b.indexOf(a)<0)return z.create("Wyglada na to, ze uruchamiasz minutnik po raz pierwszy, a twoj swiat moze miec niestandardowe ustawienia predkosci odradzania sie potworow. Prosze, ustaw odpowiedni mnoznik dla twojego swiata."),void z.show();w.set("speed",c),message("Predkosc minutnika ustawiona na "+c+"x")}function D(){var a=encodeURI(x.serialize()),b=new Date;b.setMonth(b.getMonth()+1),setCookie(u,a,b,"/","margonem.com")}function E(){var a=getCookie(u);if(a){var b=!1,c=decodeURIComponent(a).split(";");for(var d in c){var f=c[d].split(","),g=parseInt(f[1]);g+parseInt(w.get("stayAfterDuration"))<o()?b=!0:x.add(new e(F(f[0]),g,G(f[2]),parseInt(f[3])))}b&&D()}}function F(b){return isNaN(b)?b:a[b]?a[b]:b}function G(a){return isNaN(a)?a:d[a]?d[a]:a}function H(a){a?document.title=q(a.seconds)+" "+a.name:document.title!=t&&(document.title=t)}function I(){var a=newNpc;newNpc=function(b){for(var c in b)if(isset(b[c].del)){if(!isset(g.npc[c]))continue;K(g.npc[c])}else L(b[c]);a.call(a,b)}}function J(){var a=Engine.npcs.updateData;Engine.npcs.updateData=function(b){for(var c in b)if(isset(b[c].del)){var d=Engine.npcs.getById(c);d&&K(d.d)}else L(b[c]);a.call(Engine.npcs,b)}}function K(a){!isset(a.fake)&&p(a)&&c.add(M(a.nick),P(a.lvl,w.get("speed"),1))}function L(a){if(p(a)){var b="http://"+document.location.hostname+"/obrazki/npc/"+a.icon;N(b,function(b){return b?void(a.fake=!0):("1"==w.get("audioNotify")&&v.play(w.get("audioURL")),void c.delete(M(a.nick)))})}}function M(a){if("Skull Hunter"==a){var b=l()?Engine.map.d.name:map.name;a="Stone Burial Grounds - 1st Level"==b?"Lowca czaszek (p.1)":"Lowca czaszek (p.3)"}else if("Brigand Chieftain"==a){var b=l()?Engine.map.d.name:map.name;a="Advance Sentry"==b?"Herszt rozbojnikow (fort)":"Herszt rozbojnikow (namiot)"}return a}function N(a,b){function d(){for(var a=c.getImageData(Math.floor(c.width/2),0,1,c.height).data,d=3;d<a.length;d+=4)if(a[d]>0)return b(!1);return b(!0)}var c=document.createElement("canvas").getContext("2d"),e=new Image;e.onload=function(){c.width=this.width,c.height=this.height,c.drawImage(e,0,0),d()},e.src=a}function O(){var a=getCookie("timer/lastchar");return!!a&&(a=decodeURIComponent(a).split(","),setCookie("timer/lastchar","",new Date,"/","margonem.com"),r(a[0],a[1],!1),!1)}function P(a,b,c){return Math.round(60*(a>200?18:Math.min(18,.7+.18*a-45e-5*a*a))*c/parseInt(b))}function Q(){"1"==w.get("fixBookmarks")&&($("head").append("<style>#bookmarks div{position: relative !important;left: 0 !important;float: right !important;}</style>"),$("#bookmarks").css("right","400px"))}var c=this;this.VERSION="0.7.1";var s=1e3,t=document.title,u="timer/nodes",v=new i,w=new j(v),x=new f,y=new h(w),z=new k(w,v);y.create(),E(),y.sortNodes(),z.createIcon(),"1"==w.get("firstRun")&&C(),"1"==w.get("audioNotify")&&v.load(w.get("audioURL")),"1"==w.get("altAudioNotify")&&v.load(w.get("altAudioURL")),l()?(J(),$("body").on("contextmenu",".widget-button > .icon.exit",O)):(Q(),I(),$("#logoutbut").rightClick(O)),$(window).focus(function(){"1"==w.get("titleNotify")&&document.title!=t&&(document.title=t)});setInterval(B,s);this.add=function(a,b){return a?b?a.indexOf(",")>=0||a.indexOf(";")>=0?new Error("Invalid characters"):a.length>40?new Error("Name too long. Maximum is 40 characters"):(x.add(new e(a,o()+b,m(),n())),D(),y.sortNodes(),!0):new Error("You must pass number of seconds as second argument"):new Error("Valid syntax: Timer.add(name, seconds)")},this.addMinutes=function(a,b){this.add(a,60*b)},this.addHours=function(a,b){this.add(a,3600*b)},this.delete=function(a){var b=m();return x.get(a,b)?(x.delete(a,m()),D(),y.sortNodes(),!0):new Error("Node '"+a+"' doesn't exist on world '"+b+"'")},this.clear=function(){return x.clear(),D(),!0},this.showSettings=function(){z.create(),z.show()},this.settings=w}}();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement