Skip to content

Instantly share code, notes, and snippets.

@DavidEGx
Last active June 16, 2025 19:41
Show Gist options
  • Save DavidEGx/f0f1b571eb3c996e85ed542da66d8365 to your computer and use it in GitHub Desktop.
Save DavidEGx/f0f1b571eb3c996e85ed542da66d8365 to your computer and use it in GitHub Desktop.
Torneo Tortuga config
/**
* Torneo Tortuga config
*
* SETUP
* Add bookmarklet to:
* javascript:(function()%7Bconst%20MONTHS%20%3D%20%7B%0A%20%2201%22%3A%20%22Enero%22%2C%0A%20%2202%22%3A%20%22Febrero%22%2C%0A%20%2203%22%3A%20%22Marzo%22%2C%0A%20%2204%22%3A%20%22Abril%22%2C%0A%20%2205%22%3A%20%22Mayo%22%2C%0A%20%2206%22%3A%20%22Junio%22%2C%0A%20%2207%22%3A%20%22Julio%22%2C%0A%20%2208%22%3A%20%22Agosto%22%2C%0A%20%2209%22%3A%20%22Septiembre%22%2C%0A%20%2210%22%3A%20%22Octubre%22%2C%0A%20%2211%22%3A%20%22Noviembre%22%2C%0A%20%2212%22%3A%20%22Diciembre%22%0A%7D%3B%0A%0Adocument.querySelector('%23stage_type_selection%20%5Bdata-tournament-type%3D%22swissSystemV2%22%5D').click()%3B%0A%0Alet%20myyear%20%3D%20prompt(%22%C2%BFA%C3%B1o%3F%22)%3B%0Aif%20(myyear%20%3C%202000)%20%7B%0A%20%20myyear%20%3D%20%6020%24%7Bmyyear%7D%60%3B%0A%7D%0A%0Aconst%20maxDuration%20%3D%20document.querySelector('%23game_max_duration')%3B%0AmaxDuration.value%20%3D%20604800%3B%0AmaxDuration.dispatchEvent(new%20Event('change'%2C%20%7B%20bubbles%3A%20true%20%7D))%3B%0A%0Alet%20mymonth%20%3D%20prompt(%22%C2%BFMes%3F%22)%3B%0Amymonth%20%3D%20String(mymonth).padStart(2%2C%20'0')%3B%0A%0A%2F%2F%20Championshipt%20name%0Aconst%20NAME%20%3D%20%22Torneo%20Tortuga%20Carcassonne%20Spain%22%3B%0Adocument.querySelector('%23championship_name_wrap%20input').value%20%3D%20NAME%3B%0A%0A%2F%2F%20Tournament%20Name%0Adocument.querySelector('%5Bname%3Dtournament_name%5D').value%20%3D%20%60%24%7BMONTHS%5Bmymonth%5D%7D%20%24%7Bmyyear%7D%60%3B%0A%0A%2F%2F%20Allow%20early%20register%0Adocument.querySelector('%5Bname%3Dregistration_starts%5D').value%20%3D%20%22180%22%3B%0A%0A%2F%2F%20Allow%20many%20players%0Adocument.querySelector('%5Bname%3Dmax_players%5D').value%20%3D%20%22512%22%3B%0A%0A%2F%2F%20Set%20start%20date%0Adocument.querySelector('.input-date').value%20%3D%20%60%24%7Bmyyear%7D-%24%7Bmymonth%7D-01%60%3B%0Adocument.querySelector('.input-time').value%20%3D%20%2208%3A00%22%3B%0A%0A%2F%2F%20Playing%20hours%2010%3A00%20%E2%86%92%2022%3A00%0Aconst%20playingHours%20%3D%20document.querySelector('%23gameoption_206')%3B%0AplayingHours.value%20%3D%20%2211%22%3B%0AplayingHours.dispatchEvent(new%20Event('change'%2C%20%7B%20bubbles%3A%20true%20%7D))%3B%0A%0A%2F%2F%20Number%20of%20matches%20%3D%207%0Adocument.querySelector('%5Bname%3Dmode_option_swissSystemV2_103%5D').value%20%3D%207%3B%7D)()%3B
*
* USAGE
* 1. Go to https://boardgamearena.com/newtournament?game=1
* 2. Open bookarklet
*/
const MONTHS = {
"01": "Enero",
"02": "Febrero",
"03": "Marzo",
"04": "Abril",
"05": "Mayo",
"06": "Junio",
"07": "Julio",
"08": "Agosto",
"09": "Septiembre",
"10": "Octubre",
"11": "Noviembre",
"12": "Diciembre"
};
document.querySelector('#stage_type_selection [data-tournament-type="swissSystemV2"]').click();
let myyear = prompt("¿Año?");
if (myyear < 2000) {
myyear = `20${myyear}`;
}
const maxDuration = document.querySelector('#game_max_duration');
maxDuration.value = 604800;
maxDuration.dispatchEvent(new Event('change', { bubbles: true }));
let mymonth = prompt("¿Mes?");
mymonth = String(mymonth).padStart(2, '0');
// Championshipt name
const NAME = "Torneo Tortuga Carcassonne Spain";
document.querySelector('#championship_name_wrap input').value = NAME;
// Tournament Name
document.querySelector('[name=tournament_name]').value = `${MONTHS[mymonth]} ${myyear}`;
// Allow early register
document.querySelector('[name=registration_starts]').value = "180";
// Allow many players
document.querySelector('[name=max_players]').value = "512";
// Set start date
document.querySelector('.input-date').value = `${myyear}-${mymonth}-01`;
document.querySelector('.input-time').value = "08:00";
// Playing hours 10:00 → 22:00
const playingHours = document.querySelector('#gameoption_206');
playingHours.value = "11";
playingHours.dispatchEvent(new Event('change', { bubbles: true }));
// Number of matches = 7
document.querySelector('[name=mode_option_swissSystemV2_103]').value = 7;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment