Instructions on how to easily find "bridges," that you can banish for Small World, based on the cards you're maindecking

If you have a suggestion for the site, create a topic here and telll us about it
Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Instructions on how to easily find "bridges," that you can banish for Small World, based on the cards you're maindecking

Post #1 by Christen57 » Mon Jan 15, 2024 8:33 pm

Previously, there was no way to easily find a full list of Small World bridges — cards you could banish from the deck for Small World in order to access the specific monster(s) you want.

However, thanks to javascript, I figured out how to write a code that automatically checks the stats of each monster in the main deck (Type, Attribute, Level, ATK, and DEF) then searches only for monsters that share exactly 1 of those stats with each of them, allowing you to easily find Small World targets you can run in order to search your monsters.

First, create a bookmark on your browser and give it any name. I will name mine "small world finder".

Image

In the URL / Address box, copy and paste this code:


Code: Select all

javascript:var MainDeckStats = {};
{let SmallWorldMainDeckCards = document.getElementById("deck_constructor").querySelector(".cards").children;
   for (let ii = 0; ii < SmallWorldMainDeckCards.length; ii++) {
      if (SmallWorldMainDeckCards[ii].id.includes("deck_card") &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/spell_attribute.webp" &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/trap_attribute.webp" &&
         SmallWorldMainDeckCards[ii].style.display == "block") {
         let SmallWorldMainDeckCardType = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".type_txt").textContent.slice(2,-1).toLowerCase();
         let SmallWorldMainDeckCardAttribute = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src.slice(36,-15).toUpperCase();
         let SmallWorldMainDeckCardLevel = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelectorAll(".level[style$='display: block;']").length;
         let SmallWorldMainDeckCardATK = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_atk_txt").textContent;
         let SmallWorldMainDeckCardDEF = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_def_txt").textContent;
         MainDeckStats[SmallWorldMainDeckCards[ii].id] = {
            type:SmallWorldMainDeckCardType.slice(0,SmallWorldMainDeckCardType.indexOf(" /")),
            attribute:SmallWorldMainDeckCardAttribute,
            level:SmallWorldMainDeckCardLevel,
            atk:SmallWorldMainDeckCardATK,
            def:SmallWorldMainDeckCardDEF
         };
      }
   }
}

function searchCardsE3(e) {
   var arrows = "";
   arrows += ~~($('#search').find('.arrow1 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow2 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow3 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow4 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow5 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow6 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow7 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow8 img').attr("src").indexOf("red") >= 0);
   var order = $('#search').find('.order_cb').val();
   saved_search = {
      "name": $('#search').find('.name_txt').val().trim(),
      "effect": $('#search').find('.desc_txt').val(),
      "card_type": $('#search').find('.card_cb').val(),
      "monster_color": $('#search').find('.card2_cb').val(),
      "type": str($('#search').find('.type_cb').val()),
      "ability": $('#search').find('.type2_cb').val(),
      "attribute": $('#search').find('.attrib_cb').val(),
      "level_low": $('#search').find('.lvll_txt').val(),
      "level_high": $('#search').find('.lvlh_txt').val(),
      "atk_low": $('#search').find('.atkl_txt').val(),
      "atk_high": $('#search').find('.atkh_txt').val(),
      "def_low": $('#search').find('.defl_txt').val(),
      "def_high": $('#search').find('.defh_txt').val(),
      "limit": $('#search').find('.limit_cb').val(),
      
      "order": order != "Alpha" ? order : null,
      "pendulum": ~~($('#search').find('.pendulum_cb').prop("checked")),
      "scale_low": $('#search').find('.scalel_txt').val(),
      "scale_high": $('#search').find('.scaleh_txt').val(),
      "tcg": ~~($('#search').find('.tcg_cb').prop("checked")),
      "ocg": ~~($('#search').find('.ocg_cb').prop("checked")),
      "ocg_list": ~~($('#' + currentLabel + ' .ocg_limit_rb').prop("checked")),
      
      "arrows": arrows.includes("1") ? arrows : null,
      "custom": ~~($('#search').find('.custom_cb').val()),
   };
   pageNumber = 1;
   if ($('#search .name_txt').val().length >= 3 || $('#search .desc_txt').val().length >= 3) {
      update_search = false;
   }
   searchCards3(e);
}

function searchCards3() {
   if (saved_search == null) {
      return;
   }
   if (awaiting_cards) {
      return;
   }
   awaiting_cards = true;
   var search = {"action":"Search cards", "search":saved_search, "page":~~pageNumber};
   
   
   if (!cards_fingerprint || [1,2,3,8].includes(saved_search.custom)) {
      filterObject(search.search);
      Send(search);
      return;
   }
   searching = true;
   var name = saved_search.name;
   var effect = saved_search.effect;
   var card_type = saved_search.card_type;
   var monster_color = saved_search.monster_color;
   var type = str(saved_search.type);
   var ability = saved_search.ability;
   var attribute = saved_search.attribute;
   var level_low = saved_search.level_low;
   var level_high = saved_search.level_high;
   var atk_low = saved_search.atk_low;
   var atk_high = saved_search.atk_high;
   var def_low = saved_search.def_low;
   var def_high = saved_search.def_high;
   var limit = saved_search.limit;
   var order = saved_search.order ?? "Alpha";
   var pendulum = saved_search.pendulum;
   var scale_low = saved_search.scale_low;
   var scale_high = saved_search.scale_high;
   var tcg = saved_search.tcg;
   var ocg = saved_search.ocg;
   var ocg_list = saved_search.ocg_list;
   var arrows = saved_search.arrows ?? "00000000";
   var custom_cards = saved_search.custom;
   
   var total = 0;
   var page = pageNumber;
      page = (20 * page) - 20;
   var full_search = false;
   var cards = [];
   if (name.length >= 3 || effect.length >= 3) {
      
   }
   var names = name.toLowerCase().split('*');
   var effects = effect.toLowerCase().split('*');
   var cards0 = Cards.slice();
   switch(order) {
      case "Date":
      case "Release Date":
         cards0.sort(sortCardsByDate);
         break;
      case "Updated":
      case "Last Updated":
         cards0.sort(sortCardsByUpdated);
         break;
      case "Alpha":
         cards0.sort(sortCards);
         break;
      default:
      case "New First":
         cards0.reverse();
         break;
   }
   outerloop:
   for (var i = 0; i < cards0.length; i++) {
      if (cards0[i].name == null) {
         continue;
      }
      if (cards0[i].name == "") {
         continue;
      }
      if (cards0[i].hidden == 1) {
         continue;
      }
      switch(saved_search.custom) {
         case 0:
            if (cards0[i].rush) {
               continue;
            }
            break;
         case 4:
            if (!GoatCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 5:
            if (!EdisonCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         
         case 6:
            if (!SpeedCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 7:
            if (!cards0[i].rush) {
               continue;
            }
            break;
      }
      if (saved_search.custom == 0 && cards0[i].rush) {
         continue;
      }
      if (saved_search.custom == 7 && !cards0[i].rush) {
         continue;
      }
      for (var j = 0; j < names.length; j++) {
         if (cards0[i].name_lowercase.indexOf(names[j]) < 0) {
            continue outerloop;
         }
      }
      for (var j = 0; j < effects.length; j++) {
         if (cards0[i].effect_lowercase.indexOf(effects[j]) < 0 && (!cards0[i].pendulum_effect || cards0[i].pendulum_effect_lowercase.indexOf(effects[j]) < 0)) {
            continue outerloop;
         }
      }
      if (full_search == true) {
         cards.push(cards0[i]);
         total++;
         continue;
      }
      if (cards0[i].card_type != "Monster" || cards0[i].monster_color == "Fusion" || cards0[i].monster_color == "Synchro" || cards0[i].monster_color == "Xyz" || cards0[i].monster_color == "Link") {
         continue;
      }
      if (monster_color != "") {
         if (monster_color == "Pendulum") {
            if (!cards0[i].pendulum) {
               continue;
            }
         }
         else if (!cards0[i].monster_color || cards0[i].monster_color.indexOf(monster_color) < 0) {
            continue;
         }
      }
      if (type != "") {
         if (cards0[i].type != type) {
            continue;
         }
      }
      if (ability != "") {
         if (!cards0[i].ability || cards0[i].ability.indexOf(ability) < 0) {
            continue;
         }
      }
      if (attribute != "") {
         if (cards0[i].attribute.indexOf(attribute) < 0) {
            continue;
         }
      }
      if (level_low != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level < parseInt(level_low)) {
            continue;
         }
      }
      if (level_high != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level > parseInt(level_high)) {
            continue;
         }
      }
      if (atk_low != "") {
         if (atk_low == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk < parseInt(atk_low)) {
               continue;
            }
         }
      }
      if (atk_high != "") {
         if (atk_high == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk > parseInt(atk_high)) {
               continue;
            }
         }
      }
      if (def_low != "") {
         if (def_low == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def < parseInt(def_low)) {
               continue;
            }
         }
      }
      if (def_high != "") {
         if (def_high == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def > parseInt(def_high)) {
               continue;
            }
         }
      }
      if (pendulum) {
         if (!cards0[i].pendulum) {
            continue;
         }
      }
      if (scale_low != "") {
         if (!cards0[i].pendulum || cards0[i].scale < parseInt(scale_low)) {
            continue;
         }
      }
      if (scale_high != "") {
         if (!cards0[i].pendulum || cards0[i].scale > parseInt(scale_high)) {
            continue;
         }
      }
      if (tcg == 1 || ocg == 1) {
         if (tcg == 1 && cards0[i].tcg == 0) {
            continue;
         }
         if (ocg == 1 && cards0[i].ocg == 0) {
            continue;
         }
      }
      if (limit != "") {
         if (saved_search.custom == 7) {
            if (cards0[i].ocg_limit == null) {
               cards0[i].ocg_limit = 3;
            }
            if (cards0[i].ocg_limit != parseInt(limit)) {
            
               if (!(cards0[i].rush == 2 && limit == 0)) {
                  continue;
               }
            }
         }
         
         else {
            if (cards0[i].tcg_limit == null) {
               cards0[i].tcg_limit = 3;
            }
            var card_limit = getLimit(cards0[i].id, cards0[i].tcg_limit);
            if (card_limit != parseInt(limit)) {
               continue;
            }
         }
      }
      if (arrows != "00000000") {
         if (!cards0[i].arrows) {
            continue;
         }
         if (arrows.substring(0, 1) == "1" && cards0[i].arrows.substring(0, 1) != "1") {
            continue;
         }
         if (arrows.substring(1, 2) == "1" && cards0[i].arrows.substring(1, 2) != "1") {
            continue;
         }
         if (arrows.substring(2, 3) == "1" && cards0[i].arrows.substring(2, 3) != "1") {
            continue;
         }
         if (arrows.substring(3, 4) == "1" && cards0[i].arrows.substring(3, 4) != "1") {
            continue;
         }
         if (arrows.substring(4, 5) == "1" && cards0[i].arrows.substring(4, 5) != "1") {
            continue;
         }
         if (arrows.substring(5, 6) == "1" && cards0[i].arrows.substring(5, 6) != "1") {
            continue;
         }
         if (arrows.substring(6, 7) == "1" && cards0[i].arrows.substring(6, 7) != "1") {
            continue;
         }
         if (arrows.substring(7, 8) == "1" && cards0[i].arrows.substring(7, 8) != "1") {
            continue;
         }
      }
      let MatchedOnce = true;
      for (let [key, value] of Object.entries(MainDeckStats)) {
         if (MatchedOnce == true) {
            if ((cards0[i].type.toLowerCase() == value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute == value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level == value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk == value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def == value.def))
            {}
            else {
               MatchedOnce = false;
            }
         }
      }
      if (MatchedOnce == false) {
         continue;
      }
      total++;
      if ((total > page && total <= page + 20) && full_search == false) {
         cards.push(cards0[i]);
      }
   }
   var result = {
      "action":"Search cards",
      "cards":cards,
      "total":total,
      "full_search":full_search
   };
   searchCardsResponse(result);
}
{let choice = confirm("Click OK to begin search or to go to previous page.\nClick Cancel to go next page.");
   if (choice == true) {
      if (pageNumber > 1) {
         pageNumber--;
         searchCards3();
      }
      else {
         searchCardsE3();
      }
   }
   else if ((pageNumber * 20) < totalCardsSearched) {
      pageNumber++;
      searchCards3();
   }
}


Save your bookmark. Then go to duelingbook's Deck Constructor and make sure all monsters in your main deck are monsters you wish to either banish from the hand off of Small World or search off of Small World.

Image

Next, click your bookmark, which will bring up a window that looks like this:

Image

Click OK, and the code will begin searching the database for only monsters that have exactly 1 of the same Type, Attribute, Level, ATK, or DEF as each of those monsters in your main deck.

Image

In this case, the only monster that has come up is Tainted Wisdom, a monster that only shares:
and the same attribute as A Cat of Ill Omen

It's currently the only monster in the game that shares exactly 1 stat with each of these 6 monsters. Any of these 6 monsters can be banished from the hand for Small World, along with Tainted Wisdom in the deck, to search another copy of any of these 6 monsters.

If searching for bridges and you end up with multiple pages of possible bridges, you can click the Cancel button on the bookmark (not the OK button) to go to the next page. For example, here I only include these monsters in the main deck:

Image

and when I click the bookmark and click OK, I get two pages of search results.

Image

So to advance to the next page of these search results, I click the bookmark then click Cancel.

Image

Make sure to use the bookmark's OK and Cancel buttons for moving between pages of the search results. If you use duelingbook's own left and right arrows, it will instead reset the entire search and bring all the cards back.

The code also works with custom or rush duel cards in the main deck.

Image

However, even with custom cards in the main deck, this code doesn't search cards from the "My Custom Cards," "All Custom Cards," or "My Favorite Cards" section.

eyal282
Posts: 101
Joined: Wed Sep 23, 2020 6:02 pm
Reputation: 1
Location: Dustshoot Phase

Post #2 by eyal282 » Tue Jan 16, 2024 7:22 pm

Nice.

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #3 by Christen57 » Sat Jan 27, 2024 7:47 pm

I made an update to my code that now takes advantage of duelingbook's getConfirmation2 function. Here's the updated code:

Code: Select all

javascript:var MainDeckStats = {};
{let SmallWorldMainDeckCards = document.getElementById("deck_constructor").querySelector(".cards").children;
   for (let ii = 0; ii < SmallWorldMainDeckCards.length; ii++) {
      if (SmallWorldMainDeckCards[ii].id.includes("deck_card") &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/spell_attribute.webp" &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/trap_attribute.webp" &&
         SmallWorldMainDeckCards[ii].style.display == "block") {
         let SmallWorldMainDeckCardType = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".type_txt").textContent.slice(2,-1).toLowerCase();
         let SmallWorldMainDeckCardAttribute = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src.slice(36,-15).toUpperCase();
         let SmallWorldMainDeckCardLevel = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelectorAll(".level[style$='display: block;']").length;
         let SmallWorldMainDeckCardATK = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_atk_txt").textContent;
         let SmallWorldMainDeckCardDEF = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_def_txt").textContent;
         MainDeckStats[SmallWorldMainDeckCards[ii].id] = {
            type:SmallWorldMainDeckCardType.slice(0,SmallWorldMainDeckCardType.indexOf(" /")),
            attribute:SmallWorldMainDeckCardAttribute,
            level:SmallWorldMainDeckCardLevel,
            atk:SmallWorldMainDeckCardATK,
            def:SmallWorldMainDeckCardDEF
         };
      }
   }
}

function searchCardsE3() {
   var arrows = "";
   arrows += ~~($('#search').find('.arrow1 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow2 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow3 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow4 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow5 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow6 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow7 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow8 img').attr("src").indexOf("red") >= 0);
   var order = $('#search').find('.order_cb').val();
   saved_search = {
      "name": $('#search').find('.name_txt').val().trim(),
      "effect": $('#search').find('.desc_txt').val(),
      "card_type": $('#search').find('.card_cb').val(),
      "monster_color": $('#search').find('.card2_cb').val(),
      "type": str($('#search').find('.type_cb').val()),
      "ability": $('#search').find('.type2_cb').val(),
      "attribute": $('#search').find('.attrib_cb').val(),
      "level_low": $('#search').find('.lvll_txt').val(),
      "level_high": $('#search').find('.lvlh_txt').val(),
      "atk_low": $('#search').find('.atkl_txt').val(),
      "atk_high": $('#search').find('.atkh_txt').val(),
      "def_low": $('#search').find('.defl_txt').val(),
      "def_high": $('#search').find('.defh_txt').val(),
      "limit": $('#search').find('.limit_cb').val(),
      
      "order": order != "Alpha" ? order : null,
      "pendulum": ~~($('#search').find('.pendulum_cb').prop("checked")),
      "scale_low": $('#search').find('.scalel_txt').val(),
      "scale_high": $('#search').find('.scaleh_txt').val(),
      "tcg": ~~($('#search').find('.tcg_cb').prop("checked")),
      "ocg": ~~($('#search').find('.ocg_cb').prop("checked")),
      "ocg_list": ~~($('#' + currentLabel + ' .ocg_limit_rb').prop("checked")),
      
      "arrows": arrows.includes("1") ? arrows : null,
      "custom": ~~($('#search').find('.custom_cb').val()),
   };
   pageNumber = 1;
   if ($('#search .name_txt').val().length >= 3 || $('#search .desc_txt').val().length >= 3) {
      update_search = false;
   }
   searchCards3();
}

function searchCards3() {
   if (saved_search == null) {
      return;
   }
   if (awaiting_cards) {
      return;
   }
   awaiting_cards = true;
   var search = {"action":"Search cards", "search":saved_search, "page":~~pageNumber};
   
   
   if (!cards_fingerprint || [1,2,3,8].includes(saved_search.custom)) {
      filterObject(search.search);
      Send(search);
      return;
   }
   searching = true;
   var name = saved_search.name;
   var effect = saved_search.effect;
   var card_type = saved_search.card_type;
   var monster_color = saved_search.monster_color;
   var type = str(saved_search.type);
   var ability = saved_search.ability;
   var attribute = saved_search.attribute;
   var level_low = saved_search.level_low;
   var level_high = saved_search.level_high;
   var atk_low = saved_search.atk_low;
   var atk_high = saved_search.atk_high;
   var def_low = saved_search.def_low;
   var def_high = saved_search.def_high;
   var limit = saved_search.limit;
   var order = saved_search.order ?? "Alpha";
   var pendulum = saved_search.pendulum;
   var scale_low = saved_search.scale_low;
   var scale_high = saved_search.scale_high;
   var tcg = saved_search.tcg;
   var ocg = saved_search.ocg;
   var ocg_list = saved_search.ocg_list;
   var arrows = saved_search.arrows ?? "00000000";
   var custom_cards = saved_search.custom;
   
   var total = 0;
   var page = pageNumber;
      page = (20 * page) - 20;
   var full_search = false;
   var cards = [];
   if (name.length >= 3 || effect.length >= 3) {
      
   }
   var names = name.toLowerCase().split('*');
   var effects = effect.toLowerCase().split('*');
   var cards0 = Cards.slice();
   switch(order) {
      case "Date":
      case "Release Date":
         cards0.sort(sortCardsByDate);
         break;
      case "Updated":
      case "Last Updated":
         cards0.sort(sortCardsByUpdated);
         break;
      case "Alpha":
         cards0.sort(sortCards);
         break;
      default:
      case "New First":
         cards0.reverse();
         break;
   }
   outerloop:
   for (var i = 0; i < cards0.length; i++) {
      if (cards0[i].name == null) {
         continue;
      }
      if (cards0[i].name == "") {
         continue;
      }
      if (cards0[i].hidden == 1) {
         continue;
      }
      switch(saved_search.custom) {
         case 0:
            if (cards0[i].rush) {
               continue;
            }
            break;
         case 4:
            if (!GoatCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 5:
            if (!EdisonCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         
         case 6:
            if (!SpeedCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 7:
            if (!cards0[i].rush) {
               continue;
            }
            break;
      }
      if (saved_search.custom == 0 && cards0[i].rush) {
         continue;
      }
      if (saved_search.custom == 7 && !cards0[i].rush) {
         continue;
      }
      for (var j = 0; j < names.length; j++) {
         if (cards0[i].name_lowercase.indexOf(names[j]) < 0) {
            continue outerloop;
         }
      }
      for (var j = 0; j < effects.length; j++) {
         if (cards0[i].effect_lowercase.indexOf(effects[j]) < 0 && (!cards0[i].pendulum_effect || cards0[i].pendulum_effect_lowercase.indexOf(effects[j]) < 0)) {
            continue outerloop;
         }
      }
      if (full_search == true) {
         cards.push(cards0[i]);
         total++;
         continue;
      }
      if (cards0[i].card_type != "Monster" || cards0[i].monster_color == "Fusion" || cards0[i].monster_color == "Synchro" || cards0[i].monster_color == "Xyz" || cards0[i].monster_color == "Link") {
         continue;
      }
      if (monster_color != "") {
         if (monster_color == "Pendulum") {
            if (!cards0[i].pendulum) {
               continue;
            }
         }
         else if (!cards0[i].monster_color || cards0[i].monster_color.indexOf(monster_color) < 0) {
            continue;
         }
      }
      if (type != "") {
         if (cards0[i].type != type) {
            continue;
         }
      }
      if (ability != "") {
         if (!cards0[i].ability || cards0[i].ability.indexOf(ability) < 0) {
            continue;
         }
      }
      if (attribute != "") {
         if (cards0[i].attribute.indexOf(attribute) < 0) {
            continue;
         }
      }
      if (level_low != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level < parseInt(level_low)) {
            continue;
         }
      }
      if (level_high != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level > parseInt(level_high)) {
            continue;
         }
      }
      if (atk_low != "") {
         if (atk_low == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk < parseInt(atk_low)) {
               continue;
            }
         }
      }
      if (atk_high != "") {
         if (atk_high == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk > parseInt(atk_high)) {
               continue;
            }
         }
      }
      if (def_low != "") {
         if (def_low == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def < parseInt(def_low)) {
               continue;
            }
         }
      }
      if (def_high != "") {
         if (def_high == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def > parseInt(def_high)) {
               continue;
            }
         }
      }
      if (pendulum) {
         if (!cards0[i].pendulum) {
            continue;
         }
      }
      if (scale_low != "") {
         if (!cards0[i].pendulum || cards0[i].scale < parseInt(scale_low)) {
            continue;
         }
      }
      if (scale_high != "") {
         if (!cards0[i].pendulum || cards0[i].scale > parseInt(scale_high)) {
            continue;
         }
      }
      if (tcg == 1 || ocg == 1) {
         if (tcg == 1 && cards0[i].tcg == 0) {
            continue;
         }
         if (ocg == 1 && cards0[i].ocg == 0) {
            continue;
         }
      }
      if (limit != "") {
         if (saved_search.custom == 7) {
            if (cards0[i].ocg_limit == null) {
               cards0[i].ocg_limit = 3;
            }
            if (cards0[i].ocg_limit != parseInt(limit)) {
            
               if (!(cards0[i].rush == 2 && limit == 0)) {
                  continue;
               }
            }
         }
         
         else {
            if (cards0[i].tcg_limit == null) {
               cards0[i].tcg_limit = 3;
            }
            var card_limit = getLimit(cards0[i].id, cards0[i].tcg_limit);
            if (card_limit != parseInt(limit)) {
               continue;
            }
         }
      }
      if (arrows != "00000000") {
         if (!cards0[i].arrows) {
            continue;
         }
         if (arrows.substring(0, 1) == "1" && cards0[i].arrows.substring(0, 1) != "1") {
            continue;
         }
         if (arrows.substring(1, 2) == "1" && cards0[i].arrows.substring(1, 2) != "1") {
            continue;
         }
         if (arrows.substring(2, 3) == "1" && cards0[i].arrows.substring(2, 3) != "1") {
            continue;
         }
         if (arrows.substring(3, 4) == "1" && cards0[i].arrows.substring(3, 4) != "1") {
            continue;
         }
         if (arrows.substring(4, 5) == "1" && cards0[i].arrows.substring(4, 5) != "1") {
            continue;
         }
         if (arrows.substring(5, 6) == "1" && cards0[i].arrows.substring(5, 6) != "1") {
            continue;
         }
         if (arrows.substring(6, 7) == "1" && cards0[i].arrows.substring(6, 7) != "1") {
            continue;
         }
         if (arrows.substring(7, 8) == "1" && cards0[i].arrows.substring(7, 8) != "1") {
            continue;
         }
      }
      let MatchedOnce = true;
      for (let [key, value] of Object.entries(MainDeckStats)) {
         if (MatchedOnce == true) {
            if ((cards0[i].type.toLowerCase() == value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute == value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level == value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk == value.atk && cards0[i].def != value.def)||
               (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def == value.def))
            {}
            else {
               MatchedOnce = false;
            }
         }
      }
      if (MatchedOnce == false) {
         continue;
      }
      total++;
      if ((total > page && total <= page + 20) && full_search == false) {
         cards.push(cards0[i]);
      }
   }
   var result = {
      "action":"Search cards",
      "cards":cards,
      "total":total,
      "full_search":full_search
   };
   searchCardsResponse(result);
}

function searchCards4() {
   if (pageNumber > 1) {
      pageNumber--;
      searchCards3();
   }
   else {
      searchCardsE3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

function searchCards5() {
   if ((pageNumber * 20) < totalCardsSearched) {
      pageNumber++;
      searchCards3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

searchCardsE3();
if ((pageNumber * 20) < totalCardsSearched) {
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}


Now, when you click the bookmark, the code will first check if the bridges it found can all fit into a single 20-card page. If so, it'll immediately present those bridges without making you click any additional button. If not, it'll bring up the following dialog box, where you can use the green and red buttons to navigate to the left-hand and right-hand pages respectively, then click the Cancel button when you're done.


Image

Renji Asuka
User avatar
Posts: 2708
Joined: Fri Dec 14, 2018 4:37 am
Reputation: 246

Post #4 by Renji Asuka » Sat Jan 27, 2024 9:00 pm

Or...you can preload your deck into https://small-world.yugioh-api.com/optimizer and figure out your bridges from there.
Image
Showing people that I'm The King of Games since September 30, 1996.

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #5 by Christen57 » Sat Jan 27, 2024 10:50 pm

Renji Asuka wrote:Or...you can preload your deck into https://small-world.yugioh-api.com/optimizer and figure out your bridges from there.


That site uses an outdated card database that stopped being updated as of February 2023 following Photon Hypernova. This means every card, that came after, is missing on that site.

My method uses duelingbook's own card database. So every time duelingbook updates with new cards, my code automatically picks up on those cards without me having to update anything on my end.

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #6 by Christen57 » Mon Feb 05, 2024 4:38 pm

Made a slight optimization to my code, reducing the amount of time it takes to run by about 30 milliseconds.

Code: Select all

javascript:var MainDeckStats = {};
{let SmallWorldMainDeckCards = document.getElementById("deck_constructor").querySelector(".cards").children;
   for (let ii = 0; ii < SmallWorldMainDeckCards.length; ii++) {
      if (SmallWorldMainDeckCards[ii].id.includes("deck_card") &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/spell_attribute.webp" &&
         SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src != "https://images.duelingbook.com/card/trap_attribute.webp" &&
         SmallWorldMainDeckCards[ii].style.display == "block") {
         let SmallWorldMainDeckCardType = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".type_txt").textContent.slice(2,-1).toLowerCase();
         let SmallWorldMainDeckCardAttribute = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".attribute").src.slice(36,-15).toUpperCase();
         let SmallWorldMainDeckCardLevel = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelectorAll(".level[style$='display: block;']").length;
         let SmallWorldMainDeckCardATK = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_atk_txt").textContent;
         let SmallWorldMainDeckCardDEF = SmallWorldMainDeckCards[ii].querySelector(".cardfront_content").querySelector(".card_def_txt").textContent;
         MainDeckStats[SmallWorldMainDeckCards[ii].id] = {
            type:SmallWorldMainDeckCardType.slice(0,SmallWorldMainDeckCardType.indexOf(" /")),
            attribute:SmallWorldMainDeckCardAttribute,
            level:SmallWorldMainDeckCardLevel,
            atk:SmallWorldMainDeckCardATK,
            def:SmallWorldMainDeckCardDEF
         };
      }
   }
}

function searchCardsE3() {
   var arrows = "";
   arrows += ~~($('#search').find('.arrow1 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow2 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow3 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow4 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow5 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow6 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow7 img').attr("src").indexOf("red") >= 0);
   arrows += ~~($('#search').find('.arrow8 img').attr("src").indexOf("red") >= 0);
   var order = $('#search').find('.order_cb').val();
   saved_search = {
      "name": $('#search').find('.name_txt').val().trim(),
      "effect": $('#search').find('.desc_txt').val(),
      "card_type": $('#search').find('.card_cb').val(),
      "monster_color": $('#search').find('.card2_cb').val(),
      "type": str($('#search').find('.type_cb').val()),
      "ability": $('#search').find('.type2_cb').val(),
      "attribute": $('#search').find('.attrib_cb').val(),
      "level_low": $('#search').find('.lvll_txt').val(),
      "level_high": $('#search').find('.lvlh_txt').val(),
      "atk_low": $('#search').find('.atkl_txt').val(),
      "atk_high": $('#search').find('.atkh_txt').val(),
      "def_low": $('#search').find('.defl_txt').val(),
      "def_high": $('#search').find('.defh_txt').val(),
      "limit": $('#search').find('.limit_cb').val(),
      
      "order": order != "Alpha" ? order : null,
      "pendulum": ~~($('#search').find('.pendulum_cb').prop("checked")),
      "scale_low": $('#search').find('.scalel_txt').val(),
      "scale_high": $('#search').find('.scaleh_txt').val(),
      "tcg": ~~($('#search').find('.tcg_cb').prop("checked")),
      "ocg": ~~($('#search').find('.ocg_cb').prop("checked")),
      "ocg_list": ~~($('#' + currentLabel + ' .ocg_limit_rb').prop("checked")),
      
      "arrows": arrows.includes("1") ? arrows : null,
      "custom": ~~($('#search').find('.custom_cb').val()),
   };
   pageNumber = 1;
   if ($('#search .name_txt').val().length >= 3 || $('#search .desc_txt').val().length >= 3) {
      update_search = false;
   }
   searchCards3();
}

function searchCards3() {
   if (saved_search == null) {
      return;
   }
   if (awaiting_cards) {
      return;
   }
   awaiting_cards = true;
   var search = {"action":"Search cards", "search":saved_search, "page":~~pageNumber};
   
   
   if (!cards_fingerprint || [1,2,3,8].includes(saved_search.custom)) {
      filterObject(search.search);
      Send(search);
      return;
   }
   searching = true;
   var name = saved_search.name;
   var effect = saved_search.effect;
   var card_type = saved_search.card_type;
   var monster_color = saved_search.monster_color;
   var type = str(saved_search.type);
   var ability = saved_search.ability;
   var attribute = saved_search.attribute;
   var level_low = saved_search.level_low;
   var level_high = saved_search.level_high;
   var atk_low = saved_search.atk_low;
   var atk_high = saved_search.atk_high;
   var def_low = saved_search.def_low;
   var def_high = saved_search.def_high;
   var limit = saved_search.limit;
   var order = saved_search.order ?? "Alpha";
   var pendulum = saved_search.pendulum;
   var scale_low = saved_search.scale_low;
   var scale_high = saved_search.scale_high;
   var tcg = saved_search.tcg;
   var ocg = saved_search.ocg;
   var ocg_list = saved_search.ocg_list;
   var arrows = saved_search.arrows ?? "00000000";
   var custom_cards = saved_search.custom;
   
   var total = 0;
   var page = pageNumber;
      page = (20 * page) - 20;
   var full_search = false;
   var cards = [];
   if (name.length >= 3 || effect.length >= 3) {
      
   }
   var names = name.toLowerCase().split('*');
   var effects = effect.toLowerCase().split('*');
   var cards0 = Cards.slice();
   switch(order) {
      case "Date":
      case "Release Date":
         cards0.sort(sortCardsByDate);
         break;
      case "Updated":
      case "Last Updated":
         cards0.sort(sortCardsByUpdated);
         break;
      case "Alpha":
         cards0.sort(sortCards);
         break;
      default:
      case "New First":
         cards0.reverse();
         break;
   }
   outerloop:
   for (var i = 0; i < cards0.length; i++) {
      if (cards0[i].name == null) {
         continue;
      }
      if (cards0[i].name == "") {
         continue;
      }
      if (cards0[i].hidden == 1) {
         continue;
      }
      switch(saved_search.custom) {
         case 0:
            if (cards0[i].rush) {
               continue;
            }
            break;
         case 4:
            if (!GoatCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 5:
            if (!EdisonCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         
         case 6:
            if (!SpeedCards.includes(cards0[i].id)) {
               continue;
            }
            break;
         case 7:
            if (!cards0[i].rush) {
               continue;
            }
            break;
      }
      if (saved_search.custom == 0 && cards0[i].rush) {
         continue;
      }
      if (saved_search.custom == 7 && !cards0[i].rush) {
         continue;
      }
      for (var j = 0; j < names.length; j++) {
         if (cards0[i].name_lowercase.indexOf(names[j]) < 0) {
            continue outerloop;
         }
      }
      for (var j = 0; j < effects.length; j++) {
         if (cards0[i].effect_lowercase.indexOf(effects[j]) < 0 && (!cards0[i].pendulum_effect || cards0[i].pendulum_effect_lowercase.indexOf(effects[j]) < 0)) {
            continue outerloop;
         }
      }
      if (full_search == true) {
         cards.push(cards0[i]);
         total++;
         continue;
      }
      if (cards0[i].card_type != "Monster" || cards0[i].monster_color == "Fusion" || cards0[i].monster_color == "Synchro" || cards0[i].monster_color == "Xyz" || cards0[i].monster_color == "Link") {
         continue;
      }
      if (monster_color != "") {
         if (monster_color == "Pendulum") {
            if (!cards0[i].pendulum) {
               continue;
            }
         }
         else if (!cards0[i].monster_color || cards0[i].monster_color.indexOf(monster_color) < 0) {
            continue;
         }
      }
      if (type != "") {
         if (cards0[i].type != type) {
            continue;
         }
      }
      if (ability != "") {
         if (!cards0[i].ability || cards0[i].ability.indexOf(ability) < 0) {
            continue;
         }
      }
      if (attribute != "") {
         if (cards0[i].attribute.indexOf(attribute) < 0) {
            continue;
         }
      }
      if (level_low != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level < parseInt(level_low)) {
            continue;
         }
      }
      if (level_high != "") {
         if (cards0[i].card_type != "Monster" || cards0[i].level > parseInt(level_high)) {
            continue;
         }
      }
      if (atk_low != "") {
         if (atk_low == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk < parseInt(atk_low)) {
               continue;
            }
         }
      }
      if (atk_high != "") {
         if (atk_high == "?") {
            if (cards0[i].atk != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].atk == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].atk > parseInt(atk_high)) {
               continue;
            }
         }
      }
      if (def_low != "") {
         if (def_low == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def < parseInt(def_low)) {
               continue;
            }
         }
      }
      if (def_high != "") {
         if (def_high == "?") {
            if (cards0[i].def != "?") {
               continue;
            }
         }
         else {
            if (cards0[i].def == "?") {
               continue;
            }
            if (cards0[i].card_type != "Monster" || cards0[i].def > parseInt(def_high)) {
               continue;
            }
         }
      }
      if (pendulum) {
         if (!cards0[i].pendulum) {
            continue;
         }
      }
      if (scale_low != "") {
         if (!cards0[i].pendulum || cards0[i].scale < parseInt(scale_low)) {
            continue;
         }
      }
      if (scale_high != "") {
         if (!cards0[i].pendulum || cards0[i].scale > parseInt(scale_high)) {
            continue;
         }
      }
      if (tcg == 1 || ocg == 1) {
         if (tcg == 1 && cards0[i].tcg == 0) {
            continue;
         }
         if (ocg == 1 && cards0[i].ocg == 0) {
            continue;
         }
      }
      if (limit != "") {
         if (saved_search.custom == 7) {
            if (cards0[i].ocg_limit == null) {
               cards0[i].ocg_limit = 3;
            }
            if (cards0[i].ocg_limit != parseInt(limit)) {
            
               if (!(cards0[i].rush == 2 && limit == 0)) {
                  continue;
               }
            }
         }
         
         else {
            if (cards0[i].tcg_limit == null) {
               cards0[i].tcg_limit = 3;
            }
            var card_limit = getLimit(cards0[i].id, cards0[i].tcg_limit);
            if (card_limit != parseInt(limit)) {
               continue;
            }
         }
      }
      if (arrows != "00000000") {
         if (!cards0[i].arrows) {
            continue;
         }
         if (arrows.substring(0, 1) == "1" && cards0[i].arrows.substring(0, 1) != "1") {
            continue;
         }
         if (arrows.substring(1, 2) == "1" && cards0[i].arrows.substring(1, 2) != "1") {
            continue;
         }
         if (arrows.substring(2, 3) == "1" && cards0[i].arrows.substring(2, 3) != "1") {
            continue;
         }
         if (arrows.substring(3, 4) == "1" && cards0[i].arrows.substring(3, 4) != "1") {
            continue;
         }
         if (arrows.substring(4, 5) == "1" && cards0[i].arrows.substring(4, 5) != "1") {
            continue;
         }
         if (arrows.substring(5, 6) == "1" && cards0[i].arrows.substring(5, 6) != "1") {
            continue;
         }
         if (arrows.substring(6, 7) == "1" && cards0[i].arrows.substring(6, 7) != "1") {
            continue;
         }
         if (arrows.substring(7, 8) == "1" && cards0[i].arrows.substring(7, 8) != "1") {
            continue;
         }
      }
      let MatchedOnce = true;
      for (let [key, value] of Object.entries(MainDeckStats)) {
         if ((cards0[i].type.toLowerCase() == value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
            (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute == value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
            (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level == value.level && cards0[i].atk != value.atk && cards0[i].def != value.def)||
            (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk == value.atk && cards0[i].def != value.def)||
            (cards0[i].type.toLowerCase() != value.type && cards0[i].attribute != value.attribute && cards0[i].level != value.level && cards0[i].atk != value.atk && cards0[i].def == value.def))
         {}
         else {
            MatchedOnce = false;
            break;
         }
      }
      if (MatchedOnce == false) {
         continue;
      }
      total++;
      if ((total > page && total <= page + 20) && full_search == false) {
         cards.push(cards0[i]);
      }
   }
   var result = {
      "action":"Search cards",
      "cards":cards,
      "total":total,
      "full_search":full_search
   };
   searchCardsResponse(result);
}

function searchCards4() {
   if (pageNumber > 1) {
      pageNumber--;
      searchCards3();
   }
   else {
      searchCardsE3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

function searchCards5() {
   if ((pageNumber * 20) < totalCardsSearched) {
      pageNumber++;
      searchCards3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

searchCardsE3();
if ((pageNumber * 20) < totalCardsSearched) {
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #7 by Christen57 » Fri Feb 09, 2024 8:28 pm

Christen57 wrote:
Renji Asuka wrote:Or...you can preload your deck into https://small-world.yugioh-api.com/optimizer and figure out your bridges from there.


That site uses an outdated card database that stopped being updated as of February 2023 following Photon Hypernova. This means every card, that came after, is missing on that site.

My method uses duelingbook's own card database. So every time duelingbook updates with new cards, my code automatically picks up on those cards without me having to update anything on my end.


Okay I just checked that website again this morning and it looks like it's been updated to include every card up to 2024's Phantom Nightmare.

I'd still recommend sticking with my own method for now though, since 1) it doesn't require each card to be manually plugged in like that website does and instead just requires the cards to be in your main deck, and 2) that website will again be outdated once the next set of cards come to the TCG; and when that happens, chances are its card database will take another year to get updated. Duelingbook's card database on the other hand updates within days, if not hours, whenever new cards release.

Renji Asuka
User avatar
Posts: 2708
Joined: Fri Dec 14, 2018 4:37 am
Reputation: 246

Post #8 by Renji Asuka » Sat Feb 10, 2024 3:22 am

Christen57 wrote:
Christen57 wrote:
Renji Asuka wrote:Or...you can preload your deck into https://small-world.yugioh-api.com/optimizer and figure out your bridges from there.


That site uses an outdated card database that stopped being updated as of February 2023 following Photon Hypernova. This means every card, that came after, is missing on that site.

My method uses duelingbook's own card database. So every time duelingbook updates with new cards, my code automatically picks up on those cards without me having to update anything on my end.


Okay I just checked that website again this morning and it looks like it's been updated to include every card up to 2024's Phantom Nightmare.

I'd still recommend sticking with my own method for now though, since 1) it doesn't require each card to be manually plugged in like that website does and instead just requires the cards to be in your main deck, and 2) that website will again be outdated once the next set of cards come to the TCG; and when that happens, chances are its card database will take another year to get updated. Duelingbook's card database on the other hand updates within days, if not hours, whenever new cards release.

DB doesn't update within days or hours of new cards dropping.

You're thinking of ygopro.
Image
Showing people that I'm The King of Games since September 30, 1996.

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #9 by Christen57 » Tue Feb 20, 2024 5:05 am

Renji Asuka wrote:
Christen57 wrote:
Christen57 wrote:
That site uses an outdated card database that stopped being updated as of February 2023 following Photon Hypernova. This means every card, that came after, is missing on that site.

My method uses duelingbook's own card database. So every time duelingbook updates with new cards, my code automatically picks up on those cards without me having to update anything on my end.


Okay I just checked that website again this morning and it looks like it's been updated to include every card up to 2024's Phantom Nightmare.

I'd still recommend sticking with my own method for now though, since 1) it doesn't require each card to be manually plugged in like that website does and instead just requires the cards to be in your main deck, and 2) that website will again be outdated once the next set of cards come to the TCG; and when that happens, chances are its card database will take another year to get updated. Duelingbook's card database on the other hand updates within days, if not hours, whenever new cards release.

DB doesn't update within days or hours of new cards dropping.

You're thinking of ygopro.


I meant it updates within days / hours of new cards dropping to the TCG, not the OCG.

Christen57
User avatar
Posts: 2065
Joined: Sun May 07, 2017 10:37 pm
Reputation: 189
Location: New York, United States of America

Post #10 by Christen57 » Tue Feb 20, 2024 5:07 am

Duelingbook made some minor changes to its Deck Constructor Card Search feature that caused the previous codes in this thread to no longer work. Here's my code, updated to work with these new changes.

Code: Select all

javascript:var MainDeckStats = {};
{let SmallWorldMainDeckCards = document.getElementById("deck_constructor").querySelectorAll('[class="cardfront unselectable deck_card ui-draggable ui-draggable-handle"][id^="deck_card"][style$="display: block;"] > [class="cardfront_content"]');
   for (let i = 0; i < SmallWorldMainDeckCards.length; i++) {
      if (SmallWorldMainDeckCards[i].querySelector(".attribute").src != "https://images.duelingbook.com/card/spell_attribute.webp" &&
         SmallWorldMainDeckCards[i].querySelector(".attribute").src != "https://images.duelingbook.com/card/trap_attribute.webp") {
         let SmallWorldMainDeckCardType = SmallWorldMainDeckCards[i].querySelector(".type_txt").textContent.slice(2,-1).toLowerCase();
         let SmallWorldMainDeckCardAttribute = SmallWorldMainDeckCards[i].querySelector(".attribute").src.slice(36,-15).toUpperCase();
         let SmallWorldMainDeckCardLevel = SmallWorldMainDeckCards[i].querySelectorAll(".level[style$='display: block;']").length;
         let SmallWorldMainDeckCardATK = SmallWorldMainDeckCards[i].querySelector(".card_atk_txt").textContent;
         let SmallWorldMainDeckCardDEF = SmallWorldMainDeckCards[i].querySelector(".card_def_txt").textContent;
         MainDeckStats[i] = {
            type:SmallWorldMainDeckCardType.slice(0,SmallWorldMainDeckCardType.indexOf(" /")),
            attribute:SmallWorldMainDeckCardAttribute,
            level:SmallWorldMainDeckCardLevel,
            atk:SmallWorldMainDeckCardATK,
            def:SmallWorldMainDeckCardDEF
         }
      }
   }
}

function searchCardsE3() {
    var _0x337fde = '';
    var _0x2dd427 = $('#search')['find']('.order_cb')['val']();
    saved_search = {
        'name': $('#search')['find']('.name_txt')['val']()['trim'](),
        'effect': $('#search')['find']('.desc_txt')['val'](),
        'card_type': $('#search')['find']('.card_cb')['val'](),
        'monster_color': $('#search')['find']('.card2_cb')['val'](),
        'type': str($('#search')['find']('.type_cb')['val']()),
        'ability': $('#search')['find']('.type2_cb')['val'](),
        'attribute': $('#search')['find']('.attrib_cb')['val'](),
        'level_low': $('#search')['find']('.lvll_txt')['val'](),
        'level_high': $('#search')['find']('.lvlh_txt')['val'](),
        'atk_low': $('#search')['find']('.atkl_txt')['val'](),
        'atk_high': $('#search')['find']('.atkh_txt')['val'](),
        'def_low': $('#search')['find']('.defl_txt')['val'](),
        'def_high': $('#search')['find']('.defh_txt')['val'](),
        'limit': $('#search')['find']('.limit_cb')['val'](),
        'order': _0x2dd427 != 'Alpha' ? _0x2dd427 : null,
        'pendulum': ~~$('#search')['find']('.pendulum_cb')['prop']('checked'),
        'scale_low': $('#search')['find']('.scalel_txt')['val'](),
        'scale_high': $('#search')['find']('.scaleh_txt')['val'](),
        'tcg': ~~$('#search')['find']('.tcg_cb')['prop']('checked'),
        'ocg': ~~$('#search')['find']('.ocg_cb')['prop']('checked'),
        'ocg_list': ~~$('#' + currentLabel + '\x20.ocg_limit_rb')['prop']('checked'),
        'arrows': _0x337fde['includes']('1') ? _0x337fde : null,
        'custom': ~~$('#search')['find']('.custom_cb')['val']()
    },
    pageNumber = -(-0x1 * -0x24a3 + 0x2a38 + -0x39bf) + (0x2e3 + 0xa2 + -0x1 * 0x37d) * (0xf24 + -0xd6c + 0x16 * -0xe) + (0x67a + 0x17df + 0x2 * -0xf2c) * (-0x24a8 + 0x1cd8 + 0x18cd),
    ($('#search\x20.name_txt')['val']()['length'] >= -0x7d * 0xb + -0x238 * 0x1 + 0xb * 0x2d7 + (0x4dc + -0x217c + 0x2b37) + (-0x1278 + -0x1 * -0x18c7 + 0x2 * 0x8) * -(0x121f * -0x1 + 0x16 * 0x1b1 + -0x65b * 0x3) || $('#search\x20.desc_txt')['val']()['length'] >= 0xba9 + -0x3a87 + 0x3 * 0x198f + -(0x8b6 * -0x3 + -0xe15 + 0xa9 * 0x3d) * (-0xf42 + -0x1dd6 + 0x2f7e) + -(-0x1ae3 * -0x1 + -0x3ce + -0x1714) * -(0x53 * 0x56 + 0x1e1f + -0x3639)) && (update_search = ![]),
    searchCards3();
}

function searchCards3(_0x2434a0) {
    if (saved_search == null)
        return;
    _0x2434a0 && (showDim(),
    $('#dim')['css']('pointer-events', 'none'));
    if (awaiting_cards)
        return;
    awaiting_cards = !![];
    var _0xc3e37a = {
        'action': 'Search\x20cards',
        'search': saved_search,
        'page': ~~pageNumber
    };
    if (!cards_fingerprint || [-(-0x1 * -0x54b + -0x28 + -0x1 * 0x521) * (0x2 * -0x907 + 0x1410 + -0x165) + -(0x1310 * 0x2 + 0xab1 + 0x8 * -0x61a) * -(-0x4ca * -0x1 + -0x139f + 0x259a) + -(-0xd65 + 0x253 * 0x9 + 0xe04), -(0x921 * 0x1 + -0x2 * -0xa15 + 0x19e1 * -0x1) * (-0xdab + 0x13d6 * 0x1 + -0x62a) + -(-0x1782 + 0x12cd + 0xac5) + (-0x6 * 0x390 + 0x758 + -0x35c * -0x7), -(-0x1fb3 + 0x27e6 + 0x11b7) + -(0x190e + 0x3f7 + 0x3 * -0x923) + (-0x2 * -0x1320 + 0x6e * 0x52 + -0x4809) * (-0x24b2 + -0x1b * 0x4d + 0x2ce4), -0xb * -0x336 + -0xcb6 + 0x70b * -0x1 + (0x1554 + -0x49b + -0x104c) * -(-0x17 * -0x9a + 0x4b4 * -0x1 + -0x91d) + -(-0x12ab + -0x977 * 0x4 + 0x45ee)]['includes'](saved_search['custom'])) {
        filterObject(_0xc3e37a['search']),
        Send(_0xc3e37a);
        return;
    }
    searching = !![];
    var _0xa9bbdc = saved_search['name']
      , _0x12ccd6 = saved_search['effect']
      , _0x10e58c = saved_search['card_type']
      , _0x57c44b = saved_search['monster_color']
      , _0x21413a = str(saved_search['type'])
      , _0x5329fc = saved_search['ability']
      , _0x1be0c2 = saved_search['attribute']
      , _0x4ca53a = saved_search['level_low']
      , _0x5699a1 = saved_search['level_high']
      , _0x1ae1aa = saved_search['atk_low']
      , _0xa932e9 = saved_search['atk_high']
      , _0xa0c252 = saved_search['def_low']
      , _0x491d03 = saved_search['def_high']
      , _0x8099a0 = saved_search['limit']
      , _0x51db8b = saved_search['order'] ?? 'Alpha'
      , _0x444fed = saved_search['pendulum']
      , _0x83dc25 = saved_search['scale_low']
      , _0xd79d9a = saved_search['scale_high']
      , _0x27b8d2 = saved_search['tcg']
      , _0x4bb833 = saved_search['ocg']
      , _0x140431 = saved_search['ocg_list']
      , _0x488551 = saved_search['arrows'] ?? '00000000'
      , _0x111d61 = saved_search['custom']
      , _0x463ae9 = (0x1e9a + 0x1d7e + -0x2767) * -(-0x1a2e + 0xe3 * 0xb + 0x106e) + (0xb6c + -0x2105 + -0x1 * -0x159a) * -(-0x1264 * 0x1 + 0xf * -0xcd + -0x2fdb * -0x1) + -(0x1e12 + 0x1891 * 0x1 + -0x83f * 0x2) * -(0xc3 * 0x2e + -0x2470 * 0x1 + 0x167)
      , _0x2c1384 = pageNumber;
    _0x2c1384 = (-(0xcd1 * 0x1 + -0x1a14 + -0x1cab * -0x1) + (-0x1744 + -0x3 * 0x1cf + 0x258a) * (-0x1 * 0x24b9 + 0x1 * 0x1399 + 0x1123) + (-0x1439 + 0x159 * 0x17 + -0x1 * 0xa31) * -(0x498 + 0x3 * 0x2b + 0x1 * -0x506)) * _0x2c1384 - (-0x7 * -0x101 + -0x1241 * -0x2 + 0x5 * -0x7af + -(-0x127c + 0x529 + 0x1179) * (-0x53b * 0x6 + 0x1601 + 0x969) + -(-0x204 + -0x2977 + 0xb * 0x683) * -(0xe * -0xc4 + 0x246c + -0x33 * 0x81));
    var _0x1b54f1 = ![]
      , _0xac3e47 = [];
    if (_0xa9bbdc['length'] >= 0xee4 * -0x2 + -0xb12 + 0x355d + (0x254a + -0x204e + 0x4f9 * -0x1) * (-0x1d3a + 0x1bd0 + 0x301) + (0x329 * -0x2 + 0xb * -0x19c + 0x294b) * -(0x105 * -0xa + 0xb99 + -0x166) || _0x12ccd6['length'] >= -(-0x1781 * 0x1 + -0xa49 * -0x3 + 0x1 * 0xbe9) * (-0x2179 + -0x2e * -0xb5 + 0xf4) + (-0x188b + -0xdf * -0x19 + -0xb3 * -0x4) * (0x4 * 0x4ae + -0x2400 + 0x2 * 0xa93) + -(0xf86 + -0x35d * -0x5 + -0x14ad)) {}
    var _0x35e858 = _0xa9bbdc['toLowerCase']()['split']('*')
      , _0x43349d = _0x12ccd6['toLowerCase']()['split']('*')
      , _0x5c9690 = Cards['slice']();
    switch (_0x51db8b) {
    case 'Date':
    case 'Release\x20Date':
        _0x5c9690['sort'](sortCardsByDate);
        break;
    case 'Updated':
    case 'Last\x20Updated':
        _0x5c9690['sort'](sortCardsByUpdated);
        break;
    case 'Alpha':
        _0x5c9690['sort'](sortByName);
        break;
    default:
    case 'New\x20First':
        _0x5c9690['reverse']();
        break;
    }
    _0x55f6fb: for (var _0x35f170 = -(0x306 * 0xb + -0x1 * 0x5b5 + 0x1 * -0x12ca) + -(0x5 * -0x8c + -0x653 + -0x4b3 * -0x2) * -(-0x13e * -0x1f + -0xc3e + -0x1a10) + -(-0x2 * -0xaf3 + 0x347 * 0x6 + 0x20a7 * -0x1); _0x35f170 < _0x5c9690['length']; _0x35f170++) {
        if (_0x5c9690[_0x35f170]['name'] == null)
            continue;
        if (_0x5c9690[_0x35f170]['name'] == '')
            continue;
        if (_0x5c9690[_0x35f170]['hidden'] == -(-0x2539 + -0x160c * 0x1 + -0x1da5 * -0x2) * (-0x98a + -0x26d2 + 0x372f) + -(-0x1b73 + 0x7ae + 0x13ce) * -(0x2 * 0x928 + -0xa24 + -0x1 * 0x7cf) + (-0x1ce9 + 0x177b * 0x2 + 0xcce))
            continue;
        switch (saved_search['custom']) {
        case -(0x1 * 0x46f0 + -0x757 * 0x3 + 0x2 * -0x607) + (0x4 * 0x2a7 + 0x1 * 0x248b + -0x1d08) * (0x7 * -0x34b + -0xaca + -0x21d9 * -0x1) + (-0x2d3 * 0x7 + -0x593 + -0x121 * -0x17):
            if (_0x5c9690[_0x35f170]['rush'])
                continue;
            if (_0x5c9690[_0x35f170]['card_type'] == 'Skill')
                continue;
            break;
        case (0x7 * -0x99 + 0x3e1 * 0x2 + 0xb * -0x53) * (0xd9 + -0x16de * 0x1 + 0x27b0) + -(-0x44 * 0x5b + 0x8d8 + 0x1 * 0x1c05) * (0x1593 + -0x1 * 0x16a1 + 0x110) + -(-0x11da * -0x2 + -0x4d5 * -0x1 + -0xd * 0x2dd) * (-0x5e3 * -0x6 + 0x5 * -0x6f7 + -0x7c):
            if (!GoatCards['includes'](_0x5c9690[_0x35f170]['id']))
                continue;
            break;
        case -(-0x3263 + 0x281 * 0x11 + 0x1 * 0x2d43) + (0xb * -0x95 + 0x185 + -0x43 * -0x13) * -(0x1074 + -0x7 * -0x56 + 0x1229 * -0x1) + (0xc0b * -0x2 + -0x17 * -0xd + 0x16ec) * (-0x3f11 + -0x148d * 0x1 + 0x87e7):
            if (!EdisonCards['includes'](_0x5c9690[_0x35f170]['id']))
                continue;
            break;
        case (0x961 * -0x1 + -0x1 * 0x17a9 + 0x210b) * -(-0x4 * -0x95f + 0x2962 + -0x37e8) + -(-0x1415 * -0x1 + -0x137b + -0x7 * -0xb1) + (-0x8db * -0x2 + 0x1 * -0x16b8 + 0x1 * 0x216f):
            if (!SpeedCards['includes'](_0x5c9690[_0x35f170]['id']))
                continue;
            break;
        case -(-0x4 * 0x93c + 0xa7d + 0x1a78) * (-0x1 * -0x1915 + 0x113d + -0x22bb) + (-0x1c56 + 0x24d4 + 0x1 * -0x87b) * (-0x2c5 * 0x9 + 0x15d7 + 0x413) + (-0x40 * -0xe3 + 0x2 * -0x206a + 0x2b17):
            if (!_0x5c9690[_0x35f170]['rush'])
                continue;
            break;
        case -(-0x653 + -0x1 * -0x1515 + 0x392) + -(0x819 + -0x3c * -0x22 + -0x1010) * (0x838 + 0x16b5 + 0x43e) + (-0x22c2 * -0x1 + -0x3ffe + 0x52c3 * 0x1):
            if (_0x5c9690[_0x35f170]['card_type'] != 'Skill')
                continue;
            break;
        }
        for (var _0x2c3d22 = 0xf6d * 0x1 + -0x1 * 0xdc7 + -0x1 * -0x3ab + -(-0x26bd * -0x1 + -0x1fc5 + -0x4d * 0x17) * (0x1d43 + -0x1 * 0x138e + 0x2 * -0x447) + -(0xd60 + -0x766 + -0x5f9) * -(-0x383 + 0x1ba9 + 0x12 * -0xce); _0x2c3d22 < _0x35e858['length']; _0x2c3d22++) {
            if (_0x5c9690[_0x35f170]['name_lowercase']['indexOf'](_0x35e858[_0x2c3d22]) < -(-0x31 * 0x6b + 0x13d * 0x2c + -0x5 * -0x1f) + (-0x265e + 0x75 * -0x5d + -0x5 * -0x1736) * (-0x141e + -0x120a + -0x2629 * -0x1) + -(0xa3d + 0x1 * -0x21f1 + 0x17bb) * (0x2 * -0x16b + 0x2e * 0x42 + -0x2fb * 0x3))
                continue _0x55f6fb;
        }
        for (var _0x2c3d22 = (0x2d * -0x4a + 0x351 * 0x3 + -0x92f * -0x1) * (0x1148 + -0x1654 + 0x50d) + -(0x2526 * 0x1 + 0x125 * -0x5 + -0x1111) + (0x386 * 0x8 + -0x18e4 + 0x30e * -0x1) * (-0x1f2d + -0x1ac0 + 0x3a0f); _0x2c3d22 < _0x43349d['length']; _0x2c3d22++) {
            if (_0x5c9690[_0x35f170]['effect_lowercase']['indexOf'](_0x43349d[_0x2c3d22]) < 0x3079 * -0x1 + -0x1 * 0x168a + -0x2 * -0x32e9 + (-0x4 * -0x9a3 + -0x1d3c + -0x94f) * (0x770 + -0x1a6 * -0xa + 0x1 * -0xaad) + -(0x3 * -0xcff + 0x3c23 + 0x16e8) * (0x23c5 * 0x1 + -0xba3 + -0x1821) && (!_0x5c9690[_0x35f170]['pendulum_effect'] || _0x5c9690[_0x35f170]['pendulum_effect_lowercase']['indexOf'](_0x43349d[_0x2c3d22]) < -(0xe0b + 0x19 * 0xc4 + -0x20ec) * (0x6 * 0x3 + 0x17dc + -0x1774) + (-0x9d9 + -0x75 * 0x4 + 0xbf0) * -(0x1c2f + 0x967 + 0x13c * -0x1e) + (0x377 * -0xe + -0x28d3 + 0x4cd * 0x21)))
                continue _0x55f6fb;
        }
        if (_0x1b54f1 == !![]) {
            _0xac3e47['push'](_0x5c9690[_0x35f170]),
            _0x463ae9++;
            continue;
        }
        if (_0x10e58c != '') {
            if (_0x5c9690[_0x35f170]['card_type']['indexOf'](_0x10e58c) < (0x1a5 * 0x13 + -0x16e5 * -0x1 + -0x3623) * -(-0x1b16 * -0x1 + -0x14 * -0xb9 + -0x261d) + -(-0x371 * 0x1 + -0xc85 + -0x283 * -0x9) + -(-0xdd8 * 0x2 + -0x105a * 0x2 + -0x9 * -0x745) * -(-0x2363 * 0x1 + 0xcc8 + 0x169d))
                continue;
        }
      switch (_0x5c9690[_0x35f170]['monster_color']) {
         case "Fusion":
         case "Synchro":
         case "Xyz":
         case "Link":
            continue;
      }
        if (_0x57c44b != '') {
            if (_0x57c44b == 'Pendulum') {
                if (!_0x5c9690[_0x35f170]['pendulum'])
                    continue;
            } else {
                if (!_0x5c9690[_0x35f170]['monster_color'] || _0x5c9690[_0x35f170]['monster_color']['indexOf'](_0x57c44b) < -(0x2baa + 0x8 * -0x5ab + 0x1b7a) + (-0xbb5 + -0x1 * -0x11f8 + 0x31f * -0x2) * -(-0x2bb * -0x4 + 0x1c59 + 0x5 * -0x73a) + (-0x1 * 0x3e47 + 0x2c1d + -0x1 * -0x3ba5))
                    continue;
            }
        }
        if (_0x21413a != '') {
            if (_0x5c9690[_0x35f170]['type'] != _0x21413a)
                continue;
        }
        if (_0x5329fc != '') {
            if (!_0x5c9690[_0x35f170]['ability'] || _0x5c9690[_0x35f170]['ability']['indexOf'](_0x5329fc) < 0xf99 + 0x1f7 * -0xe + -0x47 * -0x4d + (-0x18 * -0x11c + 0x48d * 0x5 + -0x3153) * -(0x1373 + 0x43 * -0x1c + 0x1 * -0xa3d) + (0x8 * 0x16e + 0x3 * -0xb3 + 0x793))
                continue;
        }
        if (_0x1be0c2 != '') {
            if (_0x5c9690[_0x35f170]['attribute']['indexOf'](_0x1be0c2) < (0x10ec + -0xbd9 * -0x1 + -0xd27) * -(0xb1 * 0x23 + 0x4 * -0x590 + 0x6 * -0x53) + (-0xb64 + 0x37fd + -0x2 * 0x7d3) + (0xf8c * -0x1 + 0x126d + -0xdf * -0xc) * -(-0xd0a * -0x2 + 0x1134 + -0x2b47))
                continue;
        }
        if (_0x4ca53a != '') {
            if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['level'] < parseInt(_0x4ca53a))
                continue;
        }
        if (_0x5699a1 != '') {
            if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['level'] > parseInt(_0x5699a1))
                continue;
        }
        if (_0x1ae1aa != '') {
            if (_0x1ae1aa == '?') {
                if (_0x5c9690[_0x35f170]['atk'] != '?')
                    continue;
            } else {
                if (_0x5c9690[_0x35f170]['atk'] == '?')
                    continue;
                if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['atk'] < parseInt(_0x1ae1aa))
                    continue;
            }
        }
        if (_0xa932e9 != '') {
            if (_0xa932e9 == '?') {
                if (_0x5c9690[_0x35f170]['atk'] != '?')
                    continue;
            } else {
                if (_0x5c9690[_0x35f170]['atk'] == '?')
                    continue;
                if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['atk'] > parseInt(_0xa932e9))
                    continue;
            }
        }
        if (_0xa0c252 != '') {
            if (_0xa0c252 == '?') {
                if (_0x5c9690[_0x35f170]['def'] != '?')
                    continue;
            } else {
                if (_0x5c9690[_0x35f170]['def'] == '?')
                    continue;
                if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['def'] < parseInt(_0xa0c252))
                    continue;
            }
        }
        if (_0x491d03 != '') {
            if (_0x491d03 == '?') {
                if (_0x5c9690[_0x35f170]['def'] != '?')
                    continue;
            } else {
                if (_0x5c9690[_0x35f170]['def'] == '?')
                    continue;
                if (_0x5c9690[_0x35f170]['card_type'] != 'Monster' || _0x5c9690[_0x35f170]['def'] > parseInt(_0x491d03))
                    continue;
            }
        }
        if (_0x444fed) {
            if (!_0x5c9690[_0x35f170]['pendulum'])
                continue;
        }
        if (_0x83dc25 != '') {
            if (!_0x5c9690[_0x35f170]['pendulum'] || _0x5c9690[_0x35f170]['scale'] < parseInt(_0x83dc25))
                continue;
        }
        if (_0xd79d9a != '') {
            if (!_0x5c9690[_0x35f170]['pendulum'] || _0x5c9690[_0x35f170]['scale'] > parseInt(_0xd79d9a))
                continue;
        }
        if (_0x27b8d2 == -(-0x6a * 0x5 + 0x3b0b + -0x3 * 0x8c2) + -(-0xfa * -0x30 + -0x1312 + 0x38 * 0x32) + (-0xaa5 * -0xa + -0x356c + -0x41b * -0x4) || _0x4bb833 == (0x151c + -0x1 * 0x24a3 + -0x11c * -0xe) * -(-0x1 * -0x71f + -0x1 * -0x261a + -0x23f3 * 0x1) + -(0x49c + 0x11af * 0x1 + 0xa30) + (0x37ba * -0x1 + 0x347 * -0x11 + 0x301 * 0x33)) {
            if (_0x27b8d2 == -(0xdc9 + -0x2a87 * -0x1 + 0x3 * -0x97f) + (-0x1fa6 + -0x862 + 0x11 * 0x413) + -(0x2 * -0x7a9 + 0x46f * 0x4 + -0x103) && _0x5c9690[_0x35f170]['tcg'] == 0x1181 * 0x1 + 0x2 * 0xfbb + -0x3b * 0x67 + (0x95a * 0x3 + -0x4f * 0xd + -0x1147) + -(0x124b + 0x7 * 0x34d + -0x28e4) * (0x10ac + 0x829 + -0x1896))
                continue;
            if (_0x4bb833 == (0x33c * 0xc + 0x1 * 0x1c78 + -0x4327 * 0x1) * (0x1743 + -0x1259 + -0x4ad) + (0x249b * 0x1 + 0xd99 + -0x3233) * -(-0x3d7 * 0x1 + -0x51b + 0xc4b) + -(-0x3 * -0x878 + 0x1a1 * -0x9 + -0x63c) && _0x5c9690[_0x35f170]['ocg'] == -(0x157d + -0x60d + -0xdd * 0xe) * -(-0x1a * -0xf + 0x870 + -0x9f2) + -(-0x7 * -0x31f + -0x1c5 * 0xb + 0x1e * -0x14) * (-0x298 + 0x2c4 + 0x162) + (0x705 * -0x2 + 0xc6f * 0x3 + -0x151f))
                continue;
        }
        if (_0x8099a0 != '') {
            if (saved_search['custom'] == -0x2f12 + -0x1052 + 0x2 * 0x32ba + (0xb83 + -0x1a80 + 0x1c2c) + -(-0x4ca3 * 0x1 + 0x586 * -0xd + 0xc7a9)) {
                _0x5c9690[_0x35f170]['ocg_limit'] == null && (_0x5c9690[_0x35f170]['ocg_limit'] = 0x67f * -0x1 + 0x70b * -0x2 + 0x394b + (-0x1d * -0xf3 + 0x91 * 0x1f + -0x4 * 0xb45) * (0x9 * -0x3de + 0x1abd + 0x11d7) + -(0x19bd + 0x1 * 0x10f5 + 0x1d3 * -0x13) * (-0x410 + 0x677 + 0x130 * -0x2));
                if (_0x5c9690[_0x35f170]['ocg_limit'] != parseInt(_0x8099a0) && parseInt(_0x8099a0) < (-0x31 + -0x2 * -0x6d3 + 0x139 * -0xb) * (-0x1ca4 + 0x54 * 0x65 + 0x811) + -(-0x1078 + -0x1762 + -0x3199 * -0x1) + -(0x124 * -0x20 + -0xae3 * -0x1 + 0x19a5) * (-0xcfa + 0x4 * 0x216 + 0x2 * 0x347)) {
                    if (!(_0x5c9690[_0x35f170]['rush'] == -(-0x114b + 0x12d5 + 0x182 * -0x1) * -(-0x1d7 + 0xc85 + 0x9c2 * -0x1) + -(0x597 + 0x2ae7 + 0x1127 * -0x1) + -(0x13 * 0x2b + 0xe * 0x15a + -0x160c) * -(-0x258d + -0xaa + 0x27a0) && _0x8099a0 == (0xb6f + -0xdd * 0x19 + 0x2903) * -(0xca0 + 0xf02 + -0xb * 0x283) + -(-0x1ae8 + 0x15d9 + -0x1 * -0x6ed) * -(-0x176b + -0x20a1 + -0x3816 * -0x1) + (0x1efb + 0x831 + -0xd7d * 0x2)))
                        continue;
                }
            } else {
                _0x5c9690[_0x35f170]['tcg_limit'] == null && (_0x5c9690[_0x35f170]['tcg_limit'] = -(-0x1bb0 + 0x40f + -0x1 * -0x3766) + -(-0x611 * -0x5 + -0x15a8 + -0x88 * 0x10) * -(0xcf7 + -0xe36 + 0x1e0) + (0x1 * -0x271 + 0xfb4 + -0x679 * 0x2) * (-0xb80 * -0x1 + 0x19a1 * -0x1 + 0x716 * 0x2));
                var _0x1c8580 = getLimit(_0x5c9690[_0x35f170]['id'], _0x5c9690[_0x35f170]['tcg_limit']);
                if (_0x1c8580 != parseInt(_0x8099a0) && parseInt(_0x8099a0) < -(-0xd98 + 0x1cb9 + -0x767) + -(0x1 * -0x2495 + 0x5ab * 0x1 + 0x1eeb) * -(0x28a8 + 0x446 * 0xf + -0x43a4) + -(0x3322 + -0x2dc9 + -0x8 * -0x301))
                    continue;
            }
        }
        if (_0x488551 != '00000000') {
            if (!_0x5c9690[_0x35f170]['arrows'])
                continue;
            if (_0x488551['substring'](-(0x1fa5 + 0x2 * -0x12ee + -0x8 * -0xd6) * -(-0x1937 + -0x16 * -0x1b7 + -0x310 * 0x4) + (-0x1 * 0x1c22 + 0x101c + -0xc07 * -0x1) * (0x843 + -0x1269 + 0x14f8) + -(0x6fd + -0x204b + 0x13 * 0x155) * (0x6 * 0xb57 + 0xe * 0x3c0 + -0x4e0d), (0x1f5c + -0xa7 * 0x35 + 0x1 * 0x33b) * (-0x2 * -0x376 + -0x112b + 0x12ae) + -(0x16c3 + 0x227f * 0x1 + -0x3940) * (0x124 + 0x24d8 + 0xf26 * -0x2) + (0x39 * 0x47 + 0x1 * -0x71d + -0x88d) * -(-0x1 * 0x2029 + 0x2 * 0xf8d + -0x18e * -0x1)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring']((0x6 * -0xa0 + 0x1ac0 + -0x22d * 0x9) * -(-0xf8b + 0x7d9 * 0x4 + -0xfd5) + -(-0x6 * -0x16d + -0x6 * -0x412 + -0x142a) * (-0x1 * -0x233b + 0x14da * -0x1 + -0x1cc * 0x8) + (-0x6d3 * -0x3 + 0x1b1 * 0x7 + -0x397 * 0x9) * (-0x2b39 + -0x2 * -0xbe9 + 0x2de3), -(-0x1e9 * 0xb + -0x66 * 0x2 + 0x4 * 0x575) * (-0x1a15 + -0xcd2 + 0x2d42) + (0xa7 * -0x14 + 0x3 * -0x11c + 0x345a) * -(-0x62b * 0x5 + 0x75 * 0x53 + -0x717) + (-0x20cc + -0x1280 + 0x3472) * (0x3 * -0x5e5 + 0x17 * 0x18c + 0x26 * -0x77)) != '1')
                continue;
            if (_0x488551['substring'](-(0x1e13 + -0x1a73 + -0x34a) * (0x74 * 0x3d + -0x191c + -0x21a * 0x1) + -(-0x6f5 + 0x10c2 + -0x3 * 0x1a3) + (0x4cc1 + 0x1 * -0x3338 + -0x1050 * -0x1), 0x1011 + 0x2046 + -0x2754 + (-0x1f53 + 0x9 * 0x37b + -0x435 * -0x1) * (-0xab7 + -0x1337 * -0x2 + -0x1 * 0x1bb3) + -(0x1ee8 + -0x243d + -0x2 * -0xf95)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](-(0x1eb9 + 0x1620 + -0x2d36) * (0x1f26 + 0x1d1c + -0x3c3f) + -(-0xbfb + 0x1c9e + -0x9 * -0x5b) + (0x4 * 0x152 + -0x432 + 0x29 * -0x4) * (0x1cbc + -0x5db + -0x1681 * 0x1), 0x1502 + 0x2138 + -0x2c50 + (-0x160f * -0x1 + 0x1824 + 0x5 * -0x5b3) + -(-0x1115 + 0x1a * 0x35 + 0xbf1) * (0x177f * -0x1 + 0x2011 * 0x1 + 0x34 * -0x28)) != '1')
                continue;
            if (_0x488551['substring']((0x1 * -0x16af + -0x11f2 + -0xa61 * -0x4) * (0x19ee + 0x12df + -0x58 * 0x82) + (0x183a + 0x3d * 0xa1 + 0x2 * -0x1471) + (-0xf5e * 0x1 + -0x5 * 0x380 + -0x1a5 * -0x14) * -(-0x678 + -0x2628 + 0x71 * 0x77), -(-0x336 * -0x1 + 0x5ee + 0x1 * -0x179) * -(-0x1 * -0x19f3 + 0x1 * 0x149c + 0x2 * -0x1746) + (-0xdd7 + 0x1e38 + -0x100e) * (-0x13 * -0xa0 + -0x5 * -0x97 + -0xed0) + -(0x2395 + -0x62c + -0x22 * 0x29)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](0x2e9f + 0x3c2c + -0x1283 * 0x4 + -(-0x1 * -0x1ba1 + 0x20c1 + -0x15ed * 0x2) + -(0x18c9 + -0xe * -0x123 + 0x1e * -0x15b) * (0x3 * -0x4a + -0x4 * 0x4fd + 0x1 * 0x169f), -0x20ca + 0xe35 * -0x2 + -0x80d * -0x9 + -(0xf19 + 0x1 * 0x2bba + -0x24af) + (0x15d * -0x14 + 0x653 + 0x15ab) * (-0x52 + 0xb83 + 0x5f * -0x1e)) != '1')
                continue;
            if (_0x488551['substring'](-(0x1b73 + 0x17d0 * 0x1 + -0x1 * 0x332b) * (0x11f7 + 0x1 * -0x25ea + -0x226 * -0xa) + (0x3 * -0x5b5 + 0xed0 + 0x1 * 0x269) + (0x2 * 0x1cd + 0x199d + 0x78a), (-0x9a3 * -0x4 + -0x196d + -0x1 * 0xd1e) * (-0x194a + -0x323b + 0x6d20) + (0xe * 0x291 + -0xdc4 + -0x9 * 0x273) * -(0x1e2b * -0x1 + -0x26 * 0x1f + 0x23f5) + (-0xd10 + -0x2146 * 0x1 + -0x3 * -0x1085)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](-(-0xb5 * 0x2f + 0xee9 + 0x1254) * -(0x181c + 0x1089 + -0x164f) + -(0x1127 + 0x1 * -0x810 + 0xd9d) * (-0x1d * -0x86 + -0x8 * 0x38 + 0x1eb * -0x7) + (-0x905 + 0x253c + -0x5e4 * 0x4) * -(0x1 * 0x1b05 + 0x1 * -0x8e1 + 0x7 * -0x297), (0x1 * 0x665 + -0x1eb7 * -0x1 + 0x1 * -0x24ed) * -(-0x1 * -0xa36 + 0x86f * -0x1 + -0x1b0) + (-0xb * -0xa7 + 0x1 * 0x15ad + 0x96) + (0xfae + -0x8b * -0x5 + -0x1264) * -(-0x678 * -0x4 + 0x2025 + 0x20d2 * -0x1)) != '1')
                continue;
            if (_0x488551['substring'](-(0x130f * -0x1 + -0x267b + 0x5f7c) + -(-0x3425 + 0x1 * -0x1c2b + -0xdd * -0x8a) + (-0x253a * 0x1 + 0x1 * 0x937b + -0x2179), 0x10 * -0xf8 + 0x6 * -0x5cf + 0x522b + (0x1bac + -0x71 * 0x53 + -0xe84 * -0x2) + -(0x217d * -0x1 + 0x1d0 * 0xd + 0x4 * 0x3a9) * (-0x1 * -0x22ed + -0x1 * -0x2cd + -0x25af)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](-(-0x2209 * -0x1 + -0x401c + 0x44b7 * 0x1) + (-0x881 * 0x3 + 0x22a5 + -0xb * 0xd4) * (-0x265c + 0x67 * 0x53 + -0x3 * -0x35f) + (0x505 * -0x1 + -0x31d * 0x1 + 0xfe6), -(0x1 * -0x9a7 + -0x4 * 0x337 + 0x24cd) + (0x275 * -0x1 + 0x2 * 0x3 + 0x1a0d) + -(0x2 * -0x1200 + 0x17a7 * 0x1 + 0x15a8)) != '1')
                continue;
            if (_0x488551['substring'](0x1db + 0x1e72 + -0x8f * 0x1a + -(-0x242b + -0x30d0 + 0x74dc) * (0x2 * -0x10d + -0x1067 + 0x1282) + -(-0x7b1 + 0x124b + -0xa99) * -(-0x256f + 0x1 * -0x579 + 0xd * 0x463), 0xb93 + -0x2429 * 0x1 + -0x1 * -0x2573 + -(0x12 * 0x3f1 + 0x1 * 0x92 + -0x2149) + (-0x291e + -0x1d15 + 0x5f97)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](-(0x2e2d * -0x1 + 0xe6e * -0x1 + -0x5f88 * -0x1) + (-0x2ce3 * 0x1 + -0x2498 + -0x222 * -0x32) + (-0x15f9 + -0x2 * 0x97 + 0x191c) * (-0xa98 + 0xcbb * -0x1 + -0xc * -0x1f2), (-0x1 * 0x449 + -0x1e0a + 0x2254) * -(0x2ff5 * -0x1 + 0x2b16 + 0x5d5 * 0x5) + -(-0x3 * -0x5b3 + 0x21f4 + -0x2957 * 0x1) + (-0x8db * -0x3 + -0xdf * -0x2b + -0x1e00)) != '1')
                continue;
            if (_0x488551['substring'](-(0x1 * -0xed5 + -0x304 + 0x16b4) + (-0x1 * -0x151b + 0xd4d + -0x943) + -(-0x2 * 0x292 + 0x476 + 0x1 * 0xb2) * (-0x2 * -0x101f + -0x1871 + -0x2bc), -(-0x4 * 0x1c4 + 0x59d * -0x2 + 0x1257) * (-0x1791 + 0x10e5 + 0x6fe) + -(0xd * -0x10b + -0x16f4 + 0x2acf) + (-0x1 * -0xb85 + 0x2d * -0x2b + 0x1 * 0x687)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring']((-0x109 * 0x21 + -0x144e + 0xca * 0x53) * -(0x11 * -0x7f + 0x4 * -0x631 + 0x2134) + (0x1bd6 + -0xf * 0x244 + -0x9 * -0xaf) * -(-0x1 * 0xbdc + -0x517 + 0x2535) + (-0x1 * -0x26a7 + -0x266a + 0x43c) * (0x9b7 * 0x1 + -0xd * -0x19b + -0x1 * 0x1e8f), (0x78c + 0xf8 * -0x28 + 0x27 * 0xda) * (0x4 * 0x79f + -0x12b1 + 0x1 * -0xbc1) + -(0x1ab3 + 0x3 * 0x68b + -0x2e53) * (-0x1 * 0x12b5 + -0x11 * -0xbb + 0x2109) + (0x9d6 + -0x1bda + 0x18b6)) != '1')
                continue;
            if (_0x488551['substring'](-(-0x8 * 0x1b7 + -0xd6 + 0x22d2) + (-0x4b * 0x55 + -0x1b53 + 0x343f) * (-0x1d11 + -0xd * 0x12b + 0x3006) + (0x21b9 + 0x1a + -0x2 * 0x10e7) * (0x1 * 0xa06 + -0x2 * -0x1127 + -0x5 * 0x8cf), -(-0x37 * 0x73 + -0x13db + 0x2ccc) + (-0x5c3 * 0x2 + 0x1 * -0x1aab + -0x2b0a * -0x1) + -(0x22 * 0x33 + -0x1a9d + 0x186c)) == '1' && _0x5c9690[_0x35f170]['arrows']['substring'](-(-0x22ae + 0x95c * 0x1 + -0x1 * -0x26e9) + -(-0x2b3 + -0x1fda + 0x24cd) * (0x29d * -0x3 + -0x8a2 + 0x107c) + -(0xd5b + -0x1630 + -0x973 * -0x1) * -(0x9dd + 0x6f1 * 0x2 + -0x179e), -(0x2360 + -0x7d6 * 0x1 + -0x1 * 0x1b83) * -(0x1ad8 + -0x146c + 0x125 * -0x1) + -(0x1 * 0x18af + 0x1d07 + -0x25d8) + (0x4d8 + 0x1c94 + -0x5 * 0x6af) * -(0x4ed + 0x4 * 0x265 + 0xba * 0x9)) != '1')
                continue;
        }
      let MatchedOnce = true;
      for (let [key, value] of Object.entries(MainDeckStats)) {
         if ((_0x5c9690[_0x35f170]['type'].toLowerCase() == value.type && _0x5c9690[_0x35f170]['attribute'] != value.attribute && _0x5c9690[_0x35f170]['level'] != value.level && _0x5c9690[_0x35f170]['atk'] != value.atk && _0x5c9690[_0x35f170]['def'] != value.def)||
            (_0x5c9690[_0x35f170]['type'].toLowerCase() != value.type && _0x5c9690[_0x35f170]['attribute'] == value.attribute && _0x5c9690[_0x35f170]['level'] != value.level && _0x5c9690[_0x35f170]['atk'] != value.atk && _0x5c9690[_0x35f170]['def'] != value.def)||
            (_0x5c9690[_0x35f170]['type'].toLowerCase() != value.type && _0x5c9690[_0x35f170]['attribute'] != value.attribute && _0x5c9690[_0x35f170]['level'] == value.level && _0x5c9690[_0x35f170]['atk'] != value.atk && _0x5c9690[_0x35f170]['def'] != value.def)||
            (_0x5c9690[_0x35f170]['type'].toLowerCase() != value.type && _0x5c9690[_0x35f170]['attribute'] != value.attribute && _0x5c9690[_0x35f170]['level'] != value.level && _0x5c9690[_0x35f170]['atk'] == value.atk && _0x5c9690[_0x35f170]['def'] != value.def)||
            (_0x5c9690[_0x35f170]['type'].toLowerCase() != value.type && _0x5c9690[_0x35f170]['attribute'] != value.attribute && _0x5c9690[_0x35f170]['level'] != value.level && _0x5c9690[_0x35f170]['atk'] != value.atk && _0x5c9690[_0x35f170]['def'] == value.def))
         {}
         else {
            MatchedOnce = false;
            break;
         }
      }
      if (MatchedOnce == false) {
         continue;
      }
        _0x463ae9++,
        _0x463ae9 > _0x2c1384 && _0x463ae9 <= _0x2c1384 + (-(-0x525 + 0xcb * -0x23 + 0xb * 0x469) + -(-0x1 * -0x1f71 + -0x294f * 0x1 + 0x1f27) + -(0x133d + -0x1c2b * 0x1 + 0x8ef * 0x1) * -(0x330f + -0x2782 + -0x11b * -0x17)) && _0x1b54f1 == ![] && _0xac3e47['push'](_0x5c9690[_0x35f170]);
    }
    var _0x149ea6 = {
        'action': 'Search\x20cards',
        'cards': _0xac3e47,
        'total': _0x463ae9,
        'full_search': _0x1b54f1
    };
    searchCardsResponse(_0x149ea6);
}

function searchCards4() {
   if (pageNumber > 1) {
      pageNumber--;
      searchCards3();
   }
   else {
      searchCardsE3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

function searchCards5() {
   if ((pageNumber * 20) < totalCardsSearched) {
      pageNumber++;
      searchCards3();
   }
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}

searchCardsE3();
if ((pageNumber * 20) < totalCardsSearched) {
   getConfirmation2("Small World Bridge Finder", "Click Yes to go to previous page. Click No to go next page.", searchCards4, searchCards5);
}


Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 49 guests