Guest User

Untitled

a guest
Jun 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. const importTA = document.getElementById('import');
  2. const itaPN = importTA.parentNode;
  3.  
  4.  
  5. let el = document.createElement('div');
  6. itaPN.appendChild(el);
  7.  
  8. let inpt = document.createElement('span');
  9. inpt.innerText = 'Add Sequence TT2 Data';
  10. el.appendChild(inpt);
  11.  
  12. let br = document.createElement('br');
  13. el.appendChild(br);
  14.  
  15. let inp = document.createElement('textarea');
  16. inp.setAttribute('id', 'stt2');
  17. el.appendChild(inp);
  18.  
  19. let inps = document.createElement('input');
  20. inps.setAttribute('type', 'submit');
  21.  
  22. inps.addEventListener("click", function(){
  23.  
  24. exportData();
  25. let ed = (document.getElementById('export').innerText).split('=');
  26.  
  27. let eds = ed[ed.length - 2].split('|');
  28.  
  29. const k = {
  30. 'Book of Shadows': 'bos_',
  31. 'Stone of the Valrunes': 'sov_',
  32. 'Chest of Contentment': 'coc_',
  33. 'Heroic Shield': 'hs_',
  34. 'Book of Prophecy': 'bop_',
  35. 'Khrysos Bowl': 'kb_',
  36. 'Zakynthos Coin': 'zc_',
  37. 'Great Fay Medallion': 'gfa_',
  38. 'Coins of Ebizu': 'coe_',
  39. 'Heavenly Sword': 'hsw_',
  40. 'Divine Retribution': 'dr_',
  41. 'Drunken Hammer': 'dh_',
  42. 'Samosek Sword': 'ss_',
  43. 'The Retaliator': 'tr_',
  44. 'Hero \'s Blade': 'hb_',
  45. 'The Sword of Storms': 'tsos_',
  46. 'Furies Bow': 'fb_',
  47. 'Charm of the Ancient': 'cota_',
  48. 'Tiny Titan Tree': 'ttt_',
  49. 'Helm of Hermes': 'hh_',
  50. 'Fruit of Eden': 'foe_',
  51. 'Influential Elixir': 'ie_',
  52. 'O\'Ryan\'s Charm': 'orc_',
  53. 'Heart of Storms': 'hos2_',
  54. 'Apollo Orb': 'ao_',
  55. 'Earrings of Portara': 'eop_',
  56. 'Avian Feather': 'af_',
  57. 'Corrupted Rune Heart': 'hos_',
  58. 'Durendal Sword': 'td_',
  59. 'Helheim Skull': 'hs2_',
  60. 'Ring of Calisto': 'roc_',
  61. 'Blade of Damocles': 'bod_',
  62. 'Helmet of Madness': 'hom_',
  63. 'Titanium Plating': 'tp_',
  64. 'Moonlight Bracelet': 'mb_',
  65. 'Amethyst Staff': 'as_',
  66. 'Invader \'s Gjalarhorn': 'ig_',
  67. 'Titan Mask': 'tm_',
  68. 'Royal Toxin': 'rt_',
  69. 'Laborer \'s Pendant': 'lp_',
  70. 'Bringer of Ragnarok': 'bor_',
  71. 'Parchment of Foresight': 'pof_',
  72. 'Elixir of Eden': 'eoe_',
  73. 'Hourglass of the Impatient': 'hoti_',
  74. 'Phantom Timepiece': 'pt_',
  75. 'Forbidden Scroll': 'fs_',
  76. 'Ring of Fealty': 'rof_',
  77. 'Glacial Axe': 'ga_',
  78. 'Aegis': 'a_',
  79. 'Swamp Gauntlet': 'sg_',
  80. 'Infinity Pendulum': 'ip_',
  81. 'Gloves of Kuma': 'gok_',
  82. 'Titan Spear': 'ts_',
  83. 'Oak Staff': 'os_',
  84. 'The Arcana Cloak': 'tac_',
  85. 'Hunter\'s Ointment': 'ho_',
  86. 'Ambrosia Elixir': 'ae_',
  87. 'Mystic Staff': 'ms_',
  88. 'Mystical Beans of Senzu': 'mbos_',
  89. 'Egg of Fortune': 'eof_',
  90. 'Divine Chalice': 'dc_',
  91. 'Invader \'s Shield': 'is_',
  92. 'Axe of Muerte': 'aom_',
  93. 'Essence of the Kitsune': 'eotk_',
  94. 'Boots of Hermes': 'boh_',
  95. 'Oberon Pendant': 'op_',
  96. 'Lucky Foot of Al-mi\'raj': 'lfoa_',
  97. 'Lost King \'s Mask': 'lkm_',
  98. 'Staff of Radiance': 'sor_',
  99. 'Morgelai Sword': 'msw_',
  100. 'The Master \'s Sword': 'tms_',
  101. 'Aram Spear': 'as2_',
  102. 'Ward of the Darkness': 'wod_'
  103. };
  104.  
  105. startImport();
  106. let t = document.getElementById('stt2').value;
  107. let lines = t.split('\n');
  108.  
  109. for (let i = 0; i < lines.length; i++) {
  110. let line = lines[i].split(',');
  111. if (line[0] === 'ID' || line[1] === 'Name' || line[2] === 'Level') continue;
  112. let n = k[line[1]];
  113. let level = line[2];
  114. for (let j = 0; j < eds.length; j++) {
  115. if (eds[j].indexOf(n) === 0) {
  116. let p = eds[j].split('_');
  117. eds[j] = `${n}${p[1]}_${level}`;
  118. }
  119. }
  120. }
  121.  
  122. document.getElementById('import').value = ed.slice(0,8).join('=') + '=' + eds.join('|') + '=' + ed[ed.length -1];
  123. });
  124. el.appendChild(inps);
Add Comment
Please, Sign In to add comment