original by: plurple
contributing users name can be seen in the version history
Where do I get it?
Install the userscript from here: https://tools.conquerclub.com/playerinvites/
Should work on all browsers supporting Tampermonkey
What does it do?
Allows you to paste in a list of names to the game creation page so you don't need to copy them one at a time. Most useful for us tournament makers of multiplayer tournaments
Changelog
- Uploaded
Paste your list of names each on a new line into the provided box. Perfect for copying names from a spreadsheet or random.org.
clicking out of the box will transfer the names to the individual invite boxes. (you can click directly on the submit button and it will transfer them before you click the button
Code: Select all
// ==UserScript==
// @name Conquer Club - Player Invites
// @author Plurple
// @match https://www.conquerclub.com/player.php?mode=start*
// @match http://www.conquerclub.com/player.php?mode=start*
// @match https://beta.conquerclub.com/player.php?mode=start*
// @match http://beta.conquerclub.com/player.php?mode=start*
// @grant none
// @version 1.1.1
// @description A way to save me time in my multiplayer tournaments
// @run-at document-idle
// ==/UserScript==
(function () {
'use strict';
const containerSelector = '#invite-player';
let textarea;
function removeBulkUI() {
if (textarea) {
textarea.remove();
textarea = null;
}
}
function fillInputsAndSubmit() {
if (!textarea) return;
const names = textarea.value
.split('\n')
.map(n => n.trim())
.filter(n => n);
const inputs = document.querySelectorAll('input[id^="textbox"]');
if (names.length > inputs.length) {
alert(`You entered ${names.length} names but only ${inputs.length} player slots are available.`);
}
inputs.forEach((input, idx) => {
input.value = names[idx] || '';
console.log(`Set ${input.id} = "${input.value}"`);
});
const form = textarea.closest('form');
if (form) {
console.log('Submitting form...');
form.submit();
} else {
console.warn('Form element not found!');
}
}
function injectBulkUI(numRows) {
const container = document.querySelector(containerSelector);
if (!container) return;
removeBulkUI();
const inputs = document.querySelectorAll('input[id^="textbox"]');
if (inputs.length === 0) return;
textarea = document.createElement('textarea');
textarea.id = 'bulk-fill-textarea';
textarea.placeholder = "Enter player names, one per line...\n(Loses focus or Ctrl+Enter submits)";
textarea.style.width = '300px';
textarea.style.marginBottom = '10px';
textarea.style.marginLeft = '150px';
textarea.rows = numRows;
textarea.autofocus = false;
textarea.addEventListener('blur', () => {
fillInputsAndSubmit();
});
textarea.addEventListener('keydown', e => {
if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
e.preventDefault();
fillInputsAndSubmit();
}
});
container.prepend(textarea);
console.log(`Bulk UI injected for ${inputs.length} players.`);
}
function watchPlayerInputs() {
const container = document.querySelector(containerSelector);
if (!container) return;
const observer = new MutationObserver(() => {
const inputs = document.querySelectorAll('input[id^="textbox"]');
if (inputs.length === 0) {
removeBulkUI();
} else {
if (!textarea) {
injectBulkUI(inputs.length);
}
}
});
observer.observe(container, { childList: true, subtree: true });
}
function watchPlayerCountRadios() {
const radios = document.querySelectorAll('input[name="np"]');
radios.forEach(radio => {
radio.addEventListener('change', () => {
console.log(`Number of players changed to ${radio.value}`);
removeBulkUI();
setTimeout(() => {
injectBulkUI(radio.value);
}, 100);
});
});
}
function init() {
const container = document.querySelector(containerSelector);
if (!container) return;
const inputs = document.querySelectorAll('input[id^="textbox"]');
injectBulkUI(inputs.length);
watchPlayerInputs();
watchPlayerCountRadios();
console.log("Bulk Player Filler with Auto Submit initialized.");
}
function waitForContainer() {
const container = document.querySelector(containerSelector);
if (container) {
init();
return;
}
const obs = new MutationObserver(() => {
const target = document.querySelector(containerSelector);
if (target) {
obs.disconnect();
init();
}
});
obs.observe(document.body, { childList: true, subtree: true });
}
if (document.readyState === "complete" || document.readyState === "interactive") {
waitForContainer();
} else {
window.addEventListener("DOMContentLoaded", waitForContainer, { once: true });
}
})();







