hwm_links_to_auction

Shows some links to offers in auction (2021.11.18)

  1. // ==UserScript==
  2. // @name hwm_links_to_auction
  3. // @description Shows some links to offers in auction (2021.11.18)
  4. // @version 2.30
  5. // @include http://178.248.235.15/auction.php
  6. // @include http://178.248.235.15/auction.php?cat=my*
  7. // @include https://www.heroeswm.ru/auction.php
  8. // @include https://www.heroeswm.ru/auction.php?cat=my*
  9. // @include https://www.lordswm.com/auction.php
  10. // @include https://www.lordswm.com/auction.php?cat=my*
  11. // @icon https://app.box.com/representation/file_version_34029013909/image_2048/1.png?shared_name=hz97b2qwo2ycc5ospb7ccffn13w3ehc4
  12. // @license GPL-3.0+
  13. // @namespace ee3188f25b047f7229cc78df2e732ef3
  14. // ==/UserScript==
  15. (function () {
  16. var version = "2.30";
  17. var elements = new Array('abrasive', 'snake_poison', 'tiger_tusk', 'ice_crystal', 'moon_stone', 'fire_crystal', 'meteorit', 'witch_flower', 'wind_flower', 'fern_flower', 'badgrib');
  18. var res = {
  19. 'b_wood' : 1,
  20. 'b_ore' : 2,
  21. 'b_mercury' : 3,
  22. 'b_sulphur' : 4,
  23. 'b_crystal' : 5,
  24. 'b_gem' : 6
  25. };
  26. var sectors = {
  27. "Empire Capital":"01",
  28. "East River":"02",
  29. "Tiger Lake":"03",
  30. "Rogues` Wood":"04",
  31. "Wolf Dale":"05",
  32. "Peaceful Camp":"06",
  33. "Lizard Lowland":"07",
  34. "Green Wood":"08",
  35. "Eagle Nest":"09",
  36. "Portal Ruins":"10",
  37. "Dragons` Caves":"11",
  38. "Shining Spring":"12",
  39. "Sunny Sity":"13",
  40. "Magma Mines":"14",
  41. "Bear Mountain":"15",
  42. "Fairy Trees":"16",
  43. "Harbour City":"17",
  44. "Mithril Coast":"18",
  45. "GreatWall":"19",
  46. "Titans` Valley":"20",
  47. "Fishing Village":"21",
  48. "Kingdom Capital":"22",
  49. "Ungovernable Steppe":"23",
  50. "Crystal Garden":"24",
  51. "East Island":"25",
  52. "Wilderness":"26",
  53. "Sublime Arbor":"27"
  54. };
  55.  
  56. var type_arts, art, search_s, elem, link_art, bool_el;
  57. var ems2, ems;
  58. ems = document.querySelectorAll( "b > a[href*='auction_lot_protocol.php']"); //Ї®«гзЁ«Ё ¬ ббЁў ўлбв ў«Ґ­­ле «®в®ў
  59. for (var i=0;i<ems.length;i++) {
  60. elem = ems[i].parentNode.parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0];
  61. while ((elem.tagName == 'DIV') && (elem.childElementCount>0)) elem=elem.childNodes[0];
  62. elem=elem.parentNode.childNodes[1];
  63. if (elem.tagName == 'img'){ //аҐбл Ё н«Ґ¬Ґ­вл
  64. art = elem.getAttribute('src');
  65. art = art.substring(art.lastIndexOf("/")+1,art.length-4);
  66. bool_el = false;
  67. for (var j=0;j<elements.length;j++) if (elements[j] == art) bool_el = true;
  68. if (bool_el) link_art = location.protocol+'//'+location.hostname+'/auction.php?cat=elements&art_type='+art;
  69. else if (res[art] != null) link_art = location.protocol+'//'+location.hostname+'/auction.php?cat=res&type='+res[art];
  70. else if (art == 'house_cert'){
  71. ems2 = ems[i].parentNode.parentNode.childNodes[3].data.replace(/(^\s+|\s+$)/g,'');
  72. link_art = location.protocol+'//'+location.hostname+'/auction.php?cat=cert&sort=0&art_type=sec_'+sectors[ems2];
  73. }
  74. } else {
  75. if (elem.tagName == 'A'){ //Їа®бвлҐ  авл
  76. art = elem.getAttribute('href');
  77. if (art.indexOf("&") !=-1) art = art.substring(art.indexOf("=")+1,art.indexOf("&"))
  78. else art = art.substring(art.indexOf("=")+1);
  79. }
  80. if (elem.tagName == 'TABLE'){ //б«®¦­®б®бв ў­лҐ Ё«Ё Ё¬Ґ­­лҐ  авл
  81. elem = elem.childNodes[0].childNodes[0].childNodes[0].childNodes[0];
  82. if (elem.tagName == 'TABLE') { //б«®¦­®б®бв ў­лҐ Ё¬Ґ­­лҐ  авл
  83. elem = elem.childNodes[0].childNodes[0].childNodes[0].childNodes[0];
  84. }
  85. art = elem.getAttribute('href');
  86. art = art.substring(art.indexOf("=")+1,art.indexOf("&"));
  87. }
  88. search_s = "option[value*='"+art+"']";
  89. ems2 = document.querySelectorAll(search_s);
  90. if (ems2.length > 0) {
  91. type_arts = ems2[0].getAttribute('value');
  92. type_arts = type_arts.substring(0,type_arts.indexOf("#"));
  93. link_art = location.protocol+'//'+location.hostname+'/auction.php?cat='+type_arts+'&art_type='+art;
  94. }
  95. }
  96. elem = ems[i].parentNode.parentNode;
  97. elem.appendChild(document.createElement('br'));
  98. var newa = document.createElement('a');
  99. newa.innerHTML = '<B>HA PblHOK</B> &gt;&gt;';
  100. newa.href = link_art;
  101. newa.setAttribute('class', 'pi');
  102. elem.appendChild(newa);
  103. }
  104. })();