Disclaimer 1: Please generally don't paste random JavaScript code in your browser console unless you know what you are reading.
Disclaimer 2: These scripts most likely break rule 12 of Flight Rising's terms of use. Use at your own risk, and probably don't go around posting them on the forums etc.
Why bother then?: I've created these as minor quality of life features for myself, to remove some needless clicking and data entry. Not much more than that really.
P.S. you can double click the code segments to select the whole thing for copying.I use this to create an apparel wishlist for a dragon's bio. Makes it easy to check if a piece is available in the marketplace.
The output text should look like so for each item:
var items = document.getElementsByClassName("mseup"); var output = ""; for (let i = 0; i < items.length; i++) { const element = items[i]; var text = element.children[0].src.split("/"); text = text[text.length-1].split(".")[0]; var itemName = element.innerText.trim(); output +="[item="+itemName+"]" output += "[url=https://www1.flightrising.com/game-database/item/"+ text +"]"+itemName+"[/url]\n"; } console.log(output);I may update this code to work in places other than the dressing room, like getting a list of the apparel a dragon is already wearing.
Adds keyboard controls to each dropdown to cycle through all the values without having to click it first.
var elements = document.getElementsByClassName("scry-options")[0].children; var INCLUDED_CONTROLS = [true,false,false,true,true,true,true,true,true,true,true]; var BREED_INDEX = 1; var GENE_INDEXES = [2, 4, 6]; var BASIC_INDEX = [14, 10, 10]; const rows = new Map(); const SUBMIT = document.getElementsByName("predict")[0] function getDropDowns(){ var count = 1; for (let i = 0; i < elements.length-1; i++) { if(!INCLUDED_CONTROLS[i]) continue; // add number text to rows const row = elements[i].children; row[0].innerText += (count).toString(); rows.set(count, row[1].children[0]); count += 1; } } getDropDownText = dropdown => dropdown.options[dropdown.selectedIndex].text function handleBreedChange(){ // this doesn't really work right (and could be simplified for that reason) but prevents ancient/modern weirdness so it stays as is for now const breedElement = rows.get(BREED_INDEX) const breedOption = breedElement.options[breedElement.selectedIndex]; var texts = [] GENE_INDEXES.forEach(element => {texts.push(getDropDownText(rows.get(element)))}); if(breedOption.dataset["type"] == "modern"){ for (let i = 0; i < texts.length; i++) { texts[i] = texts[i].split(" "[0]) } } else{ for (let i = 0; i < texts.length; i++) { if(texts[i] == "Basic") continue; texts[i] = texts[i].split(" "[0]) + " ("+breedOption.text+")"; } } for (let i = 0; i < texts.length; i++) { const dropdown = rows.get(GENE_INDEXES[i]); const value = Array.from(dropdown.options).filter(x => x.text == texts[i]); var indexValue = BASIC_INDEX[i]; if(value.length != 0){ indexValue = value[0].index } dropdown.selectedIndex = indexValue; } } function handleGeneDropDown(geneDropDown){ const breedValue = rows.get(BREED_INDEX).value; const options = Array.from(geneDropDown.options).filter(x => x.dataset["breedId"].split(",").includes(breedValue)); const curretOption = geneDropDown.selectedOptions[0]; const itemIndex = options.indexOf(curretOption); if(itemIndex == -1 || itemIndex + 1 >= options.length) geneDropDown.selectedIndex = options[0].index; else geneDropDown.selectedIndex = options[itemIndex + 1].index; } getDropDowns(); //add keyboard event document.addEventListener("keyup", function (event){ if(event.key == "Enter"){ SUBMIT.click(); return; } const number = parseInt(event.key); if(isNaN(number)) return; const element = rows.get(number); if (element == undefined) return; if(GENE_INDEXES.includes(number)) handleGeneDropDown(element); else element.selectedIndex ++; if(number == BREED_INDEX) handleBreedChange(); element.focus(); })Not sure it's appropriate to call this a snippet. *coughs*