Skip to content

Instantly share code, notes, and snippets.

@rougetimelord
Last active December 24, 2020 12:15
Show Gist options
  • Save rougetimelord/d47ab457672b0c704bc07b983ea73485 to your computer and use it in GitHub Desktop.
Save rougetimelord/d47ab457672b0c704bc07b983ea73485 to your computer and use it in GitHub Desktop.
javascript:var sell=()=>{var b=document.getElementsByClassName("inventory_iteminfo"),a=0;for(let c=0;c<b.length;c++)if(""===b[c].style.display){a=c;break}b=Number(document.getElementById("pagecontrol_cur").innerText);"none"!==document.getElementById("iteminfo"+a+"_item_market_actions").style.display?(console.log("selling"),a=100*Number(document.getElementById("iteminfo"+a+"_item_market_actions").childNodes[0].childNodes[1].innerText.replace(/(\r\n|\n|\r)/gm," ").replace(/\$/gm,"").split(" ")[2])- 2,SellCurrentSelection(),document.getElementById("market_sell_currency_input").value="$"+a/100,a=document.getElementById("market_sell_dialog_accept_ssa"),a.checked||a.click(),a=document.getElementById("market_sell_dialog_accept"),a.click(),a.click(),document.getElementById("market_sell_dialog_ok").click()):(console.log("gemming"),document.getElementById("iteminfo"+a+"_item_scrap_link").click(),setTimeout(()=>{document.getElementsByClassName("newmodal_buttons")[0].firstChild.click();setTimeout(()=> {document.getElementsByClassName("newmodal_buttons")[0].firstChild.click()},500)},500));setTimeout(()=>{console.log("done waiting")},1E4);for(a=1;a<b;a++)document.getElementById("pagebtn_next").click()};sell();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment