TKR Politics and War Default Declaration Replacer

Replaces the default war declaration reasons in P&W with quotes from The Stormlight Archives

目前为 2019-08-22 提交的版本。查看 最新版本

// ==UserScript==
// @name         TKR Politics and War Default Declaration Replacer
// @namespace    http://www.knightsradiant.pw/
// @version      0.2
// @description  Replaces the default war declaration reasons in P&W with quotes from The Stormlight Archives
// @author       Talus
// @match        https://politicsandwar.com/nation/war/declare/*
// ==/UserScript==
// ********************
// * ADD QUOTES BELOW *
// ********************
// RULES:
// 1. Keep quotes in alphabetical order to avoid duplicates.
// 2. Maximum declaration reason length is 61 characters. ie. don't be longer than the below line
//  "012345678901234567890123456789012345678901234567890123456789"
var QUOTES = [
    "Authority comes from the men who give it to you.",
    "Authority doesn't come from a rank.",
    "How you live is more important than what you accomplish.",
    "If I should die, I would do so having lived my life right.",
    "If we accept who we are when we fall, the journey ends.",
    "In the end, all men die.",
    "It is not the destination that matters, but how one arrives.",
    "Many strive to defend the sanctity of ignorance.",
    "Somebody has to step forward and do what is right.",
    "Strength does not make one capable of rule.",
    "The hallmark of insecurity is bravado.",
    "This world, it is a tempest sometimes."
];
// ******************************************************************
// * DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING *
// ******************************************************************
var REASON_SELECTOR = "#rightcolumn > form > table > tbody > tr:nth-child(16) > td:nth-child(2) > input[type=text]";
(function() {
    'use strict';
    var randomQuoteIndex = Math.floor(Math.random() * QUOTES.length);
    var randomQuote = QUOTES[randomQuoteIndex];
    document.querySelector(REASON_SELECTOR).value = randomQuote;
})();