Warframe WTB

Auto WTB message

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Warframe WTB
// @namespace   Sygnano
// @description Auto WTB message
// @include     *warframe.market/*
// @version     1.3
// @grant       none
// ==/UserScript==

var buttonParent = document.getElementsByClassName("search-exist")[0];
var button = document.createElement("button");         
                    
buttonParent.appendChild(button);   
button.innerHTML = "Create WTB/WTS Messages";
button.onclick = function() { addMessages() };

function addMessages()
{
  var sellList = null;
  var login = null;
  var name = null;
  var price = 0;
  
  var msgButton = null;

    sellList = document.getElementsByClassName("success");
    name = document.getElementsByClassName("twitter-typeahead")[0].childNodes[2].innerHTML;
    for (var i = 0; i < sellList.length; i++)
     {
       if (sellList[i].childNodes[1].childNodes[1].childNodes[0].childNodes[0])
         continue;
       login = sellList[i].childNodes[1].childNodes[1].href.substring(window.location.protocol == "https:" ? 33 : 32);
       price = sellList[i].childNodes[3].innerHTML;
       msgButton = document.createElement("button");
       msgButton.innerHTML = "Whisper";
       msgButton.value = "/w ".concat(login).concat(" Hi, I'd like to ").concat(sellList[i].parentNode.parentNode.id == "sell-table" ? "buy your " : "sell my ").concat(name).concat(" listed for ").concat(price).concat("p on warframe.market");
       msgButton.addEventListener("click", function(){whisp(this);});
       sellList[i].childNodes[1].childNodes[1].removeAttribute("href");
       sellList[i].childNodes[1].childNodes[1].childNodes[0].appendChild(msgButton);
     }
}

function whisp(txt)
{
  window.prompt("Ctrl-C to copy, Ctrl-V to paste", txt.value);
}