Grumpy Wise King autofill

Auto-fills in random answers for the Grumpy King and Wise King

Stan na 05-06-2020. Zobacz najnowsza wersja.

// ==UserScript==
// @name         Grumpy Wise King autofill
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Auto-fills in random answers for the Grumpy King and Wise King
// @author       u/EatWoolooAsMutton
// @match        http://www.neopets.com/medieval/wiseking.phtml
// @match        http://www.neopets.com/medieval/grumpyking.phtml
// @grant        none
// ==/UserScript==

(function() {
    var d = document;
    var select = d.getElementsByName("form")[0].getElementsByTagName("select");
    for (var i = 0; i < select.length; i++) {
        var option = select[i].getElementsByTagName("option");
        var answer = option[Math.floor(Math.random() * (option.length - 1)) + 1];
        answer.selected = true;
    }
})();