Advertisement
Guest User

Untitled

a guest
Aug 10th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.52 KB | None | 0 0
  1. // ### Zegarek ###
  2. //Zegar
  3. var walnaleb;
  4. g.loadQueue.push({
  5.  
  6. fun: function () {
  7.  
  8. var d = new Date(); d.setTime(d.getTime() + 3600000 * 24 * 30);
  9. if (getCookie('panelik') == null) setCookie('panelik', '0px|0px', d);
  10. var settings = getCookie('panelik').split('|');
  11.  
  12.  
  13. //<div id="zegar"></div>
  14.  
  15. $('<div id="megaPanel"><div style="width:33%;float:left; height:100%; border:1px solid white;" id="leftPanel"><div class="ktotujest" style="margin-bottom:3px;" id="ktotujest" ctip="t_npc" tip="KtoTuJest"><b tip="KtoTuJest" ctip="t_npc" onclick=\'$("#ktotujest_config").toggle();\'>KtoTuJest <span style="font-size:12px;color:white" id="allx">[a]</span> <span style="font-size:10px;color:green">[opcje]</span></b></div> <div style="font-size:11px;text-align:left;margin-left:10px;word-wrap: break-word; display: flex;line-height:0.8em;flex-flow: column wrap;column-count: 3;columns: 351px 2;-webkit-columns: 351px 2;height:150px;width:351px;column-gap: 15px; "id="ktotujest_lista"> </div></div> <div id="centerPanel" style="width:33%;float:left; font-size:11.5px; height:100%; border:1px solid white;"> <div style="font-size:16px; margin-top:5px"id="zegar"></div><br></div><div id="rightPanel" style="width:33%;float:left; height:100%; border:1px solid white;"><div class="ktotubyl" style="margin-bottom:3px;" id="ktotubyl" ctip="t_npc" tip="KtoTuByl"><b tip="KtoTuByl" ctip="t_npc" >KtoTuByl </b> <button id="ktotubyl_clean" style="font-size:10px;">wyczyść</button></div> <div style="font-size:11px;text-align:left;margin-left:10px;column-count: 3; overflow: hidden;display: flex;line-height:0.8em;flex-flow: column wrap;height:150px;width:351px;overflow:hidden;column-gap: 15px; "id="ktotubyl_lista"> </div></div></div>').css({ position: 'absolute', top: '' + settings[0] + '', left: '' + settings[1] + '', zIndex: 499, width: '1065px', height: '170px', margin: 'auto auto', backgroundColor: '#191919', backgroundRepeat: 'no-repeat', color: 'white', textAlign: 'center' }).draggable().appendTo('body');
  16. $('#megaPanel').bind("dragstop", function () {
  17. setCookie('panelik', $('#megaPanel').css('top') + '|' + $('#megaPanel').css('left'), d);
  18. });
  19.  
  20. // $('<div ></div>').attr({ 'id':'noobynaleb', 'tip':'Auto atakowanie wrogów'}).css({ 'width': '50px','color':'red', 'background':'black'}).appendTo('#centerPanel')
  21. $("<button id='noobynaleb' tip='Auto atakowanie wrogów' style='margin-right:15px' ></button>").appendTo('#centerPanel')
  22. // ### klik ###
  23. function elo() { _g('chat&c=' + esc("/k Blokować zapy do grp, za trzymanie D podczas lotnięcia legi bonus 50% legendy, tylko D w GRP może atakować Goplanę.")); } $("<button id='elo'>klik</button>").appendTo('#centerPanel'); $("#elo").click(elo);
  24. $('<br>').appendTo('#centerPanel')
  25.  
  26. document.getElementById('ktotubyl_clean').addEventListener("click", function () {
  27. content = [];
  28. ktotubyl_string = "";
  29. for (var a in g.other) {
  30. g.other[a].ontubyl = 0;
  31. }
  32. });
  33.  
  34. document.getElementById('noobynaleb').addEventListener("click", function () {
  35.  
  36.  
  37. if (this.innerHTML == "off") {
  38. this.innerHTML = 'on'; message('Atakowanie wrogów włączone');
  39. this.style.color = 'green';
  40. setCookie('nooby-na-leb', 'true', d);
  41. } else {
  42. setCookie('nooby-na-leb', 'false', d);
  43. this.innerHTML = 'off'; message('Atakowanie wrogów wyłączone');
  44. this.style.color = 'red';
  45.  
  46. }
  47.  
  48.  
  49. })
  50. if (getCookie('nooby-na-leb') == null) setCookie('nooby-na-leb', 'false', d);
  51. walnaleb = getCookie('nooby-na-leb');
  52.  
  53.  
  54. if (walnaleb == 'true') {
  55. document.getElementById('noobynaleb').innerHTML = 'on';
  56. document.getElementById('noobynaleb').style.color = 'green';
  57. } else {
  58. document.getElementById('noobynaleb').innerHTML = 'off';
  59. document.getElementById('noobynaleb').style.color = 'red';
  60. }
  61.  
  62.  
  63. $('<div/>')
  64. .append($('<span tip="automatyczne zamykanie walki">AFC</span>'))
  65. .append($('<input type="checkbox" tip="zamykanie on/off"/>')
  66. .attr('checked', isAFCrunning[0])
  67. .change(function () {
  68. isAFCrunning[0] = $(this).attr('checked');
  69. var data = new Date(); data.setTime(data.getTime() + 3600000 * 24 * 31);
  70. setCookie("isAFCrunning", isAFCrunning.join("|"), data);
  71. }))
  72. .appendTo('#centerPanel')
  73.  
  74.  
  75. setInterval(function () {
  76. $("#zegar").html(ut_time(unix_time()) + '<br> ' + ut_date(unix_time()));
  77. }, 1000);
  78. }, data: ''
  79. });
  80.  
  81.  
  82. // ### KtoTuJest ###
  83.  
  84. /* KtoTuJest v2.6 by absflg */
  85.  
  86. function ReadCookie(cookieName) {
  87. var theCookie = "" + document.cookie;
  88. var ind = theCookie.indexOf(cookieName);
  89. if (ind == -1 || cookieName == "") return "";
  90. var ind1 = theCookie.indexOf(';', ind);
  91. if (ind1 == -1) ind1 = theCookie.length;
  92. return unescape(theCookie.substring(ind + cookieName.length + 1, ind1));
  93. }
  94. function ktotujest_var() {
  95. this.left = 0;
  96. this.top = -1;
  97. this.clan = new Array();
  98. for (i = 1; i <= 4; i++) this.clan[i] = {
  99. nazwa: '',
  100. kolor: ''
  101. };
  102. this.fr = '#06ff00';
  103. this.en = '#FF0066';
  104. this.cl = '#00baff';
  105. this.op = 'red';
  106.  
  107. tab = ReadCookie("ktotujest").split("|");
  108. if (isset(tab[2])) {
  109. this.left = parseInt(tab[0]);
  110. this.top = parseInt(tab[1]);
  111. if (isset(tab[10])) {
  112. for (i = 2, j = 1; i <= 9; i += 2, j++) this.clan[j] = {
  113. nazwa: tab[i],
  114. kolor: tab[i + 1]
  115. };
  116. }
  117. }
  118. if (isset(tab[13])) {
  119. this.fr = tab[10];
  120. this.en = tab[11];
  121. this.cl = tab[12];
  122. this.op = tab[13];
  123. }
  124. }
  125. ktotujest = new ktotujest_var();
  126.  
  127. function ktotujest_saveCookie() {
  128. if ($('#ktotujest_config_x').val() == "") { } else {
  129. ktotujest.left = parseInt($('#ktotujest_config_x').val());
  130. }
  131. if ($('#ktotujest_config_y').val() == "") { } else {
  132. ktotujest.top = parseInt($('#ktotujest_config_y').val());
  133. }
  134. if ($('#ktotujest_config_fr').val() == "") { } else {
  135. ktotujest.fr = ($('#ktotujest_config_fr').val());
  136. }
  137. if ($('#ktotujest_config_en').val() == "") { } else {
  138. ktotujest.en = ($('#ktotujest_config_en').val());
  139. }
  140. if ($('#ktotujest_config_cl').val() == "") { } else {
  141. ktotujest.cl = ($('#ktotujest_config_cl').val());
  142. }
  143. if ($('#ktotujest_config_op').val() == "") { } else {
  144. ktotujest.op = ($('#ktotujest_config_op').val());
  145. }
  146. for (i = 1; i <= 4; i++) {
  147. ktotujest.clan[i].nazwa = $('#ktotujest_config_nazwa' + i).val();
  148. ktotujest.clan[i].kolor = $('#ktotujest_config_kolor' + i).val();
  149. }
  150. expiry = new Date(parseInt(new Date().getTime()) * 2);
  151. tab = '';
  152. tab += ktotujest.left + "|";
  153. tab += ktotujest.top + "|";
  154. for (i = 1; i <= 4; i++) {
  155. tab += escape(ktotujest.clan[i].nazwa) + "|";
  156. tab += escape(ktotujest.clan[i].kolor) + "|";
  157. }
  158. tab += escape(ktotujest.fr) + "|";
  159. tab += escape(ktotujest.en) + "|";
  160. tab += escape(ktotujest.cl) + "|";
  161. tab += escape(ktotujest.op) + "|";
  162. document.cookie = "ktotujest=" + tab + ";expires=" + expiry + ";";
  163. $(".ktotujest").animate({
  164. left: ktotujest.left,
  165. top: ktotujest.top
  166. }, 300);
  167.  
  168. refresh_ktotujest();
  169. }
  170. perkun_side = function (l) {
  171. if (l.prof == 'w' || l.prof == 'p' || l.prof == 'h') return 1;
  172. return 2;
  173. };
  174.  
  175. function refresh_ktotujest() {
  176.  
  177.  
  178. var ktotujest_string = ""; var onl = { frx: 0, klx: 0, nex: 0, enx: 0, allx: 0 };
  179. for (var a in g.other) {
  180. var b = ''; if (g.other[a].lvl <= hero.lvl + 10 && g.other[a].lvl >= hero.lvl - 2) b = ';color: yellow;"';
  181. ktotujest_string += "<span style=\"white-space: nowrap\" ";
  182.  
  183. var clan = 0;
  184. for (i = 1; i <= 4; i++)
  185. for (var j in ktotujest.clan[i].nazwa.split(";"))
  186. if (g.other[a].clan == ktotujest.clan[i].nazwa.split(";")[j])
  187. if (g.other[a].clan) {
  188. ktotujest_string += "class='ktotujest_style" + i + "' ";
  189. clan = 1;
  190. }
  191.  
  192. var prefix = '';
  193. var long_prefix = '';
  194. switch (g.other[a].relation) {
  195. case 'cl':
  196. if (!clan) ktotujest_string += "class='ktotujest_style_cl' ";
  197. prefix = '[K] ';
  198. long_prefix = '[Klanowicz] '; onl.klx++;
  199. break;
  200. case 'fr':
  201. if (!clan) ktotujest_string += "class='ktotujest_style_fr' ";
  202. prefix = '[P] ';
  203. long_prefix = '[Przyjaciel] '; onl.frx++;
  204. break;
  205. case 'en':
  206. if (!clan) ktotujest_string += "class='ktotujest_style_en' ";
  207. prefix = '[W] ';
  208. long_prefix = '[Wróg] '; onl.enx++;
  209. break;
  210. default: onl.nex++;
  211. }; onl.allx++; $('#allx').text('[' + onl.allx + ']');
  212.  
  213. nick = g.other[a].nick;
  214. if (nick.length + prefix.length > 15) {
  215. nick = nick.substring(0, 13 - prefix.length) + "…";
  216. }
  217. if (onl.allx < 28) {
  218. ktotujest_string += "tip='" + long_prefix + g.other[a].nick + "' onclick='chatTo(\"" + g.other[a].nick + "\")'>" + prefix + nick + " (<b>" + g.other[a].lvl + g.other[a].prof + "</b>)</span><br />";
  219. }
  220.  
  221. }
  222.  
  223.  
  224. $('#ktotujest_lista').html(ktotujest_string);
  225. for (i = 1; i <= 4; i++) $('.ktotujest_style' + i).css({
  226. color: ktotujest.clan[i].kolor
  227. });
  228. $('.ktotujest_style_cl').css({
  229. color: ktotujest.cl
  230. });
  231. $('.ktotujest_style_fr').css({
  232. color: ktotujest.fr
  233. });
  234. $('.ktotujest_style_en').css({
  235. color: ktotujest.en
  236. });
  237. $('.ktotujest_style_op').css({
  238. color: ktotujest.op
  239. });
  240. }
  241.  
  242.  
  243. $('<div id="ktotujest_config"><b tip="KtoTuJest " ctip="t_npc">KtoTuJest - Konfiguracja</b></div>').css({
  244. position: "absolute",
  245. left: 300,
  246. top: 15,
  247. border: "1px grey solid",
  248. color: "white",
  249. "background": 'black',
  250. "font-size": "12px",
  251. zIndex: 500
  252. }).appendTo("body").draggable().bind("mousedown", function (d) {
  253. d.stopPropagation()
  254. });
  255. $('#ktotujest_config').html('<center>KtoTuJest - Konfiguracja</center><br><br>');
  256. $('<b> Wróg: </b><input type="text" size=2 id="ktotujest_config_en" value="' + ktotujest.en + '" /><br>').appendTo('#ktotujest_config');
  257. $('<b> Przyjaciel: </b><input type="text" size=2 id="ktotujest_config_fr" value="' + ktotujest.fr + '" /><br>').appendTo('#ktotujest_config');
  258. $('<b> Klanowicz: </b><input type="text" size=2 id="ktotujest_config_cl" value="' + ktotujest.cl + '" /><br>').appendTo('#ktotujest_config');
  259. $('<b> <br><br><b>Ustawienia koloru klanów</b><br>Aby przypisać pod kolor kilka klanów - rozdziel <br>ich nazwy średnikiem (;) BEZ dodatkowych spacji.<br>').appendTo('#ktotujest_config');
  260. for (i = 1; i <= 4; i++) {
  261. $('<input type="text" tip="Nazwa klanu" size=35 id="ktotujest_config_nazwa' + i + '" value="' + ktotujest.clan[i].nazwa + '" /><br>Kolor: ').appendTo('#ktotujest_config');
  262. $('<b class="ktotujest_style' + i + '">Kolor:</b><input type="text" size=19 id="ktotujest_config_kolor' + i + '" value="' + ktotujest.clan[i].kolor + '" /><br>').appendTo('#ktotujest_config');
  263. }
  264. $('<br><input type="button" id="ktotujest_config_b" value="Zapisz" tip="Zapisz" />').appendTo('#ktotujest_config').click(function () {
  265. ktotujest_saveCookie();
  266. });
  267. $('<input type="button" id="ktotujest_config_close" value="Wyjdź" tip="Wyjdź" />').appendTo('#ktotujest_config').click(function () {
  268. $('#ktotujest_config').toggle();
  269. });
  270.  
  271. ktj_interval = window.setInterval(function () {
  272. refresh_ktotubyl();
  273. refresh_ktotujest();
  274. }, 900);
  275.  
  276. $('#ktotujest_config').toggle();
  277. for (i = 1; i <= 4; i++) $('.ktotujest_style' + i).css({
  278. color: ktotujest.clan[i].kolor
  279. });
  280.  
  281.  
  282.  
  283. function ktotubyl_var() {
  284. this.left = 0;
  285. this.top = -1;
  286. this.clan = new Array();
  287. for (i = 1; i <= 4; i++) this.clan[i] = {
  288. nazwa: '',
  289. kolor: ''
  290. };
  291. this.fr = '#06ff00';
  292. this.en = '#FF0066';
  293. this.cl = '#00baff';
  294. this.op = 'red';
  295.  
  296. }
  297. ktotubyl = new ktotubyl_var();
  298.  
  299.  
  300. var content = [];
  301. var ktotubyl_string = "";
  302. function refresh_ktotubyl() {
  303. var onl = { frx: 0, klx: 0, nex: 0, enx: 0, allx: 0 };
  304. for (var a in g.other) {
  305. var b = ''; if (g.other[a].lvl <= hero.lvl + 10 && g.other[a].lvl >= hero.lvl - 2) b = ';color: yellow;"';/*by Gothdo*/
  306. ktotubyl_string += "<span style=\"white-space: nowrap\" ";
  307. var clan = 0;
  308. for (i = 1; i <= 4; i++)
  309. for (var j in ktotujest.clan[i].nazwa.split(";"))
  310. if (g.other[a].clan == ktotujest.clan[i].nazwa.split(";")[j])
  311. if (g.other[a].clan) {
  312. ktotubyl_string += "class='ktotujest_style" + i + "' ";
  313. clan = 1;
  314. }
  315.  
  316. var prefix = '';
  317. var long_prefix = '';
  318. switch (g.other[a].relation) {
  319. case 'cl':
  320. if (!clan) ktotubyl_string += "class='ktotujest_style_cl' ";
  321. prefix = '[K] ';
  322. long_prefix = '[Klanowicz] ';
  323. break;
  324. case 'fr':
  325. if (!clan) ktotubyl_string += "class='ktotujest_style_fr' ";
  326. prefix = '[P] ';
  327. long_prefix = '[Przyjaciel] ';
  328. break;
  329. case 'en':
  330. if (!clan) ktotubyl_string += "class='ktotujest_style_en' ";
  331. prefix = '[W] ';
  332. long_prefix = '[Wróg] ';
  333. break;
  334. default: onl.nex++;
  335. };
  336.  
  337.  
  338. nick = g.other[a].nick;
  339.  
  340.  
  341.  
  342. if ((g.other[a].ontubyl == 0 || g.other[a].ontubyl == null) && content.length < 15) {
  343. if (nick.length + prefix.length > 15) {
  344. nick = nick.substring(0, 13 - prefix.length) + "…";
  345. }
  346. ktotubyl_string += "tip='" + long_prefix + g.other[a].nick + "' onclick='chatTo(\"" + g.other[a].nick + "\")'>" + prefix + nick + " (<b>" + g.other[a].lvl + g.other[a].prof + "</b>)</span><br />";
  347. content[content.length] = "a";
  348. g.other[a].ontubyl = 1;
  349. }
  350.  
  351. }
  352. $('#ktotubyl_lista').html(ktotubyl_string);
  353.  
  354. }
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362. // ### LootFilter ###
  363. //$('body').append($(document.createElement('style')).text("div.mainBox{width:150px;z-index:391;background:#222;border:3px double #A95;color:#FFD700;font-family:Verdana, Arial, sans-serif;font-size:11px;position:absolute;padding:3px 3px 4px;}div.mainBox_left,div.mainBox_right{height:23px;position:absolute;width:35px;}div.mainBox_left{background:url(/img/tip-cor.png) no-repeat 0 -69px;left:-6px;top:-6px;}div.mainBox_right{background:url(/img/tip-cor.png) no-repeat -35px -69px;bottom:-6px;right:-6px;}"));
  364.  
  365. function LootFilter() {
  366. var __this = this;
  367. var filterInput = $(document.createElement('input')).css({ 'background-color': '#888', 'border': '1px solid #00ff00', 'padding': '1px', 'width': '40px', 'color': '#00ff00' }).change(function () { __this.saveSettings() });
  368. var autoQuitCheckbox = $(document.createElement('input')).attr('type', 'checkbox').attr('id', 'LFME_autoQuitCheckbox').change(function () { __this.saveSettings() });
  369. $('#centerPanel').append('<b>LootFilter:</b> <span>Powy\u017cej: </span>').append(filterInput);
  370. $('#centerPanel').append(autoQuitCheckbox).append('<label for="LFME_autoQuitCheckbox">Auto zamykanie</label>');
  371.  
  372. var tmpLootItem = lootItem;
  373. var doubleSendBlock = false;
  374.  
  375. this.saveSettings = function () {
  376. var settings = '|value:' + filterInput.val() + '|autoQuit:' + (autoQuitCheckbox.attr('checked') ? 1 : 0);
  377. var date = new Date(); date.setTime(date.getTime() + 3600000 * 24 * 30)
  378. setCookie('__LootFilterME', settings, date, false, false, false);
  379. }
  380.  
  381. this.readSettings = function () {
  382. var settings = getCookie('__LootFilterME')
  383. if (settings) {
  384. settings = settings.split('|');
  385. for (i = 0; i < settings.length; i++) {
  386. var pair = settings[i].split(':');
  387. switch (pair[0]) {
  388. case 'value':
  389. filterInput.val(pair[1]); break;
  390. case 'autoQuit':
  391. if (parseInt(pair[1]) == 1) autoQuitCheckbox.attr('checked', 'checked'); break
  392. }
  393. }
  394. }
  395. }
  396.  
  397. this.readSettings();
  398. lootItem = function (i) {
  399. tmpLootItem(i);
  400. var limit = parseInt(filterInput.val());
  401. if (isNaN(limit) || (i.pr >= limit) || (i.stat.search(/heroic|legendary|unique|gold|quest/) >= 0)) {
  402. setLoots((g.loots.init > 1 ? 2 : 0), i.id.toString());
  403. } else {
  404. setLoots(1, i.id.toString());
  405. }
  406. if (!doubleSendBlock && autoQuitCheckbox.attr('checked')) {
  407. doubleSendBlock = true;
  408. setTimeout(function () { sendLoots(1); doubleSendBlock = false }, 300);
  409. }
  410. }
  411. }
  412.  
  413. g.loadQueue.push({ fun: function () { new LootFilter() }, data: '' });
  414.  
  415.  
  416. // ## Auto Atack Enemy ###
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423. //## AFC ###
  424. var isAFCrunning = getCookie('isAFCrunning');
  425. isAFCrunning = (isAFCrunning ? isAFCrunning : "true|true");
  426. isAFCrunning = isAFCrunning.split("|");
  427. isAFCrunning = (isAFCrunning.length == 2 ? isAFCrunning : [true, true]);
  428. for (i in isAFCrunning)
  429. isAFCrunning[i] = eval(isAFCrunning[i]);
  430.  
  431.  
  432.  
  433.  
  434.  
  435. var tmpBattleMsg = battleMsg;
  436. battleMsg = function (c, t) {
  437. var ret = tmpBattleMsg(c, t);
  438. if ((isAFCrunning[0] || isAFCrunning[1]) && c.search(/winner=/) >= 0) {
  439. if (isAFCrunning[0])
  440. $("#battleclose").click();
  441. }
  442. return ret;
  443. }
  444. var newOther___M = newOther;
  445. newOther = function (b) {
  446. setInterval(function () {
  447. for (var i in b) {
  448. if ((b[i].relation == 'en' || b[i].relation == 'cl-en')) {
  449.  
  450. if (((Math.abs(hero.x - b[i].x) <= 2) && (Math.abs(hero.y - b[i].y) <= 2) && (walnaleb == 'true') && (map.pvp == 3)&& (g.battle == false) )) {//
  451. _g("fight&a=attack&id=" + i);
  452. }
  453. }
  454. }
  455. }, 200)
  456. newOther___M(b);
  457. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement