function generateBanlist() {
  var whilteListCheckBox = document.querySelector(".form-check-input").checked;
  var select = document.getElementById("limitation");
  var cardType = document.getElementById("typeFilters").value;
  var value = select.options[select.selectedIndex].value;
  let searchValue = document.getElementById("search-field").value.toString();

  var textBanlist = String(value);
  //console.log(textBanlist);

  //1.0 Check Input Card & Whitelist boolean
  //1.1 Check Whitelist.
  if (whilteListCheckBox) {
    //1.2 Check limitation & Add Selected Card (?Whitelist: True?)
    if (value == 4) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 1" + "\n";
    } else if (value == 5) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 2" + "\n";
    } else if (value == 6) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 3" + "\n";
    } else {
      textContent =
        "$whitelist" + "\n" + searchValue + " " + textBanlist + "\n";
    }
  }

  if (!whilteListCheckBox) {
    //1.3 Check limitation & Add Selected Card (?Whitelist: False?)
    if (value == 4) {
      textContent = "+" + searchValue + " 1" + "\n";
    } else if (value == 5) {
      textContent = "+" + searchValue + " 2" + "\n";
    } else if (value == 6) {
      textContent = "+" + searchValue + " 3" + "\n";
    } else {
      textContent = searchValue + " " + textBanlist + "\n";
    }
  }

  //1.4 Check Filters & Add them to banlist file.
  if (cardType == "Monster") {
    textContent += "0x1" + "\n";
  } else if (cardType == "Spell") {
    textContent += "0x2" + "\n";
  } else if (cardType == "Trap") {
    textContent += "0x4" + "\n";
  }

  //1.5 When finish checking filters
  var blob = new Blob([textContent], { type: "text/plain;charset=utf-8" });
  saveAs(blob, "banlist.lflist.conf");

  //

  //Check whiltelist
  // if (whilteListCheckBox) {
  //     //Do whitelist text file!
  //     console.log("Marked as whiltelist!");
  //     if (value == 4) {
  //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 1" + "\n"], { type: "text/plain;charset=utf-8" })
  //         saveAs(blob, "banlist.lflist.conf")
  //     }
  //     else if (value == 5) {
  //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 2" + "\n"], { type: "text/plain;charset=utf-8" })
  //         saveAs(blob, "banlist.lflist.conf");
  //     }
  //     else if (value == 6) {
  //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 3" + "\n"], { type: "text/plain;charset=utf-8" });
  //         saveAs(blob, "banlist.lflist.conf");
  //     }
  //     else {
  //         var blob = new Blob(["$whitelist" + "\n" + searchValue + " " + textBanlist + "\n"],
  //             { type: "text/plain;charset=utf-8" }
  //         );
  //         saveAs(blob, "banlist.lflist.conf");
  //     }
  //     return 0;

  // }

  // if (value == "nill") {
  //     alert("Please select your card name & limitation!");
  // }
  // else if (value == 4) { //CONDS location == "side..", attribute= "", lvl/rank ="" , mons type , subtype=""

  //     var blob = new Blob(["+" + searchValue + " 1" + "\n" + "@023" + "\n"],
  //         { type: "text/plain;charset=utf-8" }
  //     );

  //     saveAs(blob, "banlist.lflist.conf");
  // }
  // else if (value == 5) {
  //     var blob = new Blob(["+" + searchValue + " 2" + "\n"],
  //         { type: "text/plain;charset=utf-8" }
  //     );
  //     saveAs(blob, "banlist.lflist.conf");
  // }
  // else if (value == 6) {
  //     var blob = new Blob(["+" + searchValue + " 3" + "\n"],
  //         { type: "text/plain;charset=utf-8" }
  //     );
  //     saveAs(blob, "banlist.lflist.conf");
  // }
  // else {
  //     var blob = new Blob([searchValue + " " + textBanlist + "\n" + searchValue + " " + textBanlist],
  //         { type: "text/plain;charset=utf-8" }
  //     );
  //     saveAs(blob, "banlist.lflist.conf");
  // }
}
//This function will create a text file that contains the custom banlist the user generated!
This function will create a text file that contains the custom banlist the user generated!
This function will create a text file that contains the custom banlist the user generated!
function generateBanlist() {
  var whilteListCheckBox = document.querySelector(".form-check-input").checked;
  var select = document.getElementById("limitation");
  var cardType = document.getElementById("typeFilters").value;
  var value = select.options[select.selectedIndex].value;
  let searchValue = document.getElementById("search-field").value.toString();
  var textBanlist = String(value);
  if (whilteListCheckBox) {
    if (value == 4) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 1" + "\n";
    } else if (value == 5) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 2" + "\n";
    } else if (value == 6) {
      textContent = "$whitelist" + "\n" + "+" + searchValue + " 3" + "\n";
    } else {
      textContent =
        "$whitelist" + "\n" + searchValue + " " + textBanlist + "\n";
    }
  }
  if (!whilteListCheckBox) {
    if (value == 4) {
      textContent = "+" + searchValue + " 1" + "\n";
    } else if (value == 5) {
      textContent = "+" + searchValue + " 2" + "\n";
    } else if (value == 6) {
      textContent = "+" + searchValue + " 3" + "\n";
    } else {
      textContent = searchValue + " " + textBanlist + "\n";
    }
  }
  if (cardType == "Monster") {
    textContent += "0x1" + "\n";
  } else if (cardType == "Spell") {
    textContent += "0x2" + "\n";
  } else if (cardType == "Trap") {
    textContent += "0x4" + "\n";
  }
  var blob = new Blob([textContent], { type: "text/plain;charset=utf-8" });
  saveAs(blob, "banlist.lflist.conf");
  Check whiltelist
   if (whilteListCheckBox) {
       Do whitelist text file!
       console.log("Marked as whiltelist!");
       if (value == 4) {
           var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 1" + "\n"], { type: "text/plain;charset=utf-8" })
           saveAs(blob, "banlist.lflist.conf")
       }
       else if (value == 5) {
           var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 2" + "\n"], { type: "text/plain;charset=utf-8" })
           saveAs(blob, "banlist.lflist.conf");
       }
       else if (value == 6) {
           var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 3" + "\n"], { type: "text/plain;charset=utf-8" });
           saveAs(blob, "banlist.lflist.conf");
       }
       else {
           var blob = new Blob(["$whitelist" + "\n" + searchValue + " " + textBanlist + "\n"],
               { type: "text/plain;charset=utf-8" }
           );
           saveAs(blob, "banlist.lflist.conf");
       }
       return 0;
   }
   if (value == "nill") {
       alert("Please select your card name & limitation!");
   }
   else if (value == 4) { CONDS location == "side..", attribute= "", lvl/rank ="" , mons type , subtype=""
       var blob = new Blob(["+" + searchValue + " 1" + "\n" + "@023" + "\n"],
           { type: "text/plain;charset=utf-8" }
       );
       saveAs(blob, "banlist.lflist.conf");
   }
   else if (value == 5) {
       var blob = new Blob(["+" + searchValue + " 2" + "\n"],
           { type: "text/plain;charset=utf-8" }
       );
       saveAs(blob, "banlist.lflist.conf");
   }
   else if (value == 6) {
       var blob = new Blob(["+" + searchValue + " 3" + "\n"],
           { type: "text/plain;charset=utf-8" }
       );
       saveAs(blob, "banlist.lflist.conf");
   }
   else {
       var blob = new Blob([searchValue + " " + textBanlist + "\n" + searchValue + " " + textBanlist],
           { type: "text/plain;charset=utf-8" }
       );
       saveAs(blob, "banlist.lflist.conf");
   }
}
function generateBanlist ( ) { var whilteListCheckBox = document . querySelector ( ".form-check-input" ) . checked ; var select = document . getElementById ( "limitation" ) ; var cardType = document . getElementById ( "typeFilters" ) . value ; var value = select . options [ select . selectedIndex ] . value ; let searchValue = document . getElementById ( "search-field" ) . value . toString ( ) ; var textBanlist = String ( value ) ; if ( whilteListCheckBox ) { if ( value == 4 ) { textContent = "$whitelist" + "\n" + "+" + searchValue + " 1" + "\n" ; } else if ( value == 5 ) { textContent = "$whitelist" + "\n" + "+" + searchValue + " 2" + "\n" ; } else if ( value == 6 ) { textContent = "$whitelist" + "\n" + "+" + searchValue + " 3" + "\n" ; } else { textContent = "$whitelist" + "\n" + searchValue + " " + textBanlist + "\n" ; } } if ( ! whilteListCheckBox ) { if ( value == 4 ) { textContent = "+" + searchValue + " 1" + "\n" ; } else if ( value == 5 ) { textContent = "+" + searchValue + " 2" + "\n" ; } else if ( value == 6 ) { textContent = "+" + searchValue + " 3" + "\n" ; } else { textContent = searchValue + " " + textBanlist + "\n" ; } } if ( cardType == "Monster" ) { textContent += "0x1" + "\n" ; } else if ( cardType == "Spell" ) { textContent += "0x2" + "\n" ; } else if ( cardType == "Trap" ) { textContent += "0x4" + "\n" ; } var blob = new Blob ( [ textContent ] , { type : "text/plain;charset=utf-8" } ) ; saveAs ( blob , "banlist.lflist.conf" ) ; }
This function will create a text file that contains the custom banlist the user generated!
This function will create a text file that contains the custom banlist the user generated!
//console.log(textBanlist); //1.0 Check Input Card & Whitelist boolean //1.1 Check Whitelist. //1.2 Check limitation & Add Selected Card (?Whitelist: True?) //1.3 Check limitation & Add Selected Card (?Whitelist: False?) //1.4 Check Filters & Add them to banlist file. //1.5 When finish checking filters // //Check whiltelist // if (whilteListCheckBox) { //     //Do whitelist text file! //     console.log("Marked as whiltelist!"); //     if (value == 4) { //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 1" + "\n"], { type: "text/plain;charset=utf-8" }) //         saveAs(blob, "banlist.lflist.conf") //     } //     else if (value == 5) { //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 2" + "\n"], { type: "text/plain;charset=utf-8" }) //         saveAs(blob, "banlist.lflist.conf"); //     } //     else if (value == 6) { //         var blob = new Blob(["$whitelist" + "\n" + "+" + searchValue + " 3" + "\n"], { type: "text/plain;charset=utf-8" }); //         saveAs(blob, "banlist.lflist.conf"); //     } //     else { //         var blob = new Blob(["$whitelist" + "\n" + searchValue + " " + textBanlist + "\n"], //             { type: "text/plain;charset=utf-8" } //         ); //         saveAs(blob, "banlist.lflist.conf"); //     } //     return 0; // } // if (value == "nill") { //     alert("Please select your card name & limitation!"); // } // else if (value == 4) { //CONDS location == "side..", attribute= "", lvl/rank ="" , mons type , subtype="" //     var blob = new Blob(["+" + searchValue + " 1" + "\n" + "@023" + "\n"], //         { type: "text/plain;charset=utf-8" } //     ); //     saveAs(blob, "banlist.lflist.conf"); // } // else if (value == 5) { //     var blob = new Blob(["+" + searchValue + " 2" + "\n"], //         { type: "text/plain;charset=utf-8" } //     ); //     saveAs(blob, "banlist.lflist.conf"); // } // else if (value == 6) { //     var blob = new Blob(["+" + searchValue + " 3" + "\n"], //         { type: "text/plain;charset=utf-8" } //     ); //     saveAs(blob, "banlist.lflist.conf"); // } // else { //     var blob = new Blob([searchValue + " " + textBanlist + "\n" + searchValue + " " + textBanlist], //         { type: "text/plain;charset=utf-8" } //     ); //     saveAs(blob, "banlist.lflist.conf"); // }