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".
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.
Next, click your bookmark, which will bring up a window that looks like this:
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.
In this case, the only monster that has come up is Tainted Wisdom, a monster that only shares:
- the same level as 3-Hump Lacooda
- the same ATK as the level 5 vanilla monster
- the same level as 4-Starred Ladybug of Doom
- the same DEF as the three 7 Colored Fish
- the same attribute as 8-Claws Scorpion
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:
and when I click the bookmark and click OK, I get two pages of search results.
So to advance to the next page of these search results, I click the bookmark then click Cancel.
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.
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.