Neopets autofill

Auto selects multi-choice options for Wise King, Grumpy King, Symol Hole, Turmaculus, and Meteor. Forked from EatWoolooAsMuttonTiny's Grumpy Wise King autofill

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

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.

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

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

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         Neopets autofill
// @author       EatWoolooAsMuttonTiny, Tombaugh Regio
// @version      1.4
// @namespace    https://greasyfork.org/users/780470
// @description  Auto selects multi-choice options for Wise King, Grumpy King, Symol Hole, Turmaculus, and Meteor. Forked from EatWoolooAsMuttonTiny's Grumpy Wise King autofill
// @include      *://www.neopets.com/medieval/wiseking.phtml
// @include      *://www.neopets.com/medieval/symolhole.phtml
// @include      *://www.neopets.com/medieval/grumpyking.phtml
// @include      *://www.neopets.com/medieval/turmaculus.phtml
// @include      *://www.neopets.com/moon/meteor.phtml*
// @license      MIT
// @grant        none
// ==/UserScript==

function setElement() {
  switch(window.location.href.match(/\w+(?=\.phtml)/)[0]) {
    case 'turmaculus' : return 'select#wakeup option'
    case 'grumpyking': return '.form-container__2021 select option'
    case 'meteor': return 'form select option[value="1"]'
    case 'wiseking':
    case 'symolhole':
      return 'form select option'
    default:
      return ''
  }
}

document.querySelectorAll(setElement()).forEach((e, i, options) => options[ Math.floor(Math.random() * (options.length - 1)) + 1 ].selected = true)