Skip to content

Instantly share code, notes, and snippets.

@Dobby233Liu
Last active July 19, 2025 14:00
Show Gist options
  • Save Dobby233Liu/7e116ebd72643edfa98cd4b126e2a4ed to your computer and use it in GitHub Desktop.
Save Dobby233Liu/7e116ebd72643edfa98cd4b126e2a4ed to your computer and use it in GitHub Desktop.
QUOTEV SPEEDRUN: ANSWERS EVERY QUIZ WITH RANDOM ANSWERS, BECAUSE I DON'T CARE AND NEITHER SHOULD YOU
// ==UserScript==
// @name QUOTEV SPEEDRUN
// @version 1.2.2a
// @author Liu Wenyuan
// @namespace https://dobby233liu.neocities.org
// @description ANSWERS EVERY QUIZ WITH RANDOM ANSWERS, BECAUSE I DON'T CARE AND NEITHER SHOULD YOU
// @match https://www.quotev.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=quotev.com
// @grant none
// @require https://unpkg.com/[email protected]/minified/arrive.min.js
// @run-at document-idle
// @license WTFPL
// @downloadURL https://gist.github.com/Dobby233Liu/7e116ebd72643edfa98cd4b126e2a4ed/raw/quotev-speedrun.user.js
// @updateURL https://gist.github.com/Dobby233Liu/7e116ebd72643edfa98cd4b126e2a4ed/raw/quotev-speedrun.user.js
// @supportURL https://gist.github.com/Dobby233Liu/7e116ebd72643edfa98cd4b126e2a4ed
// ==/UserScript==
"use strict";
function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
function rnd(min, max) { return min + Math.round(Math.random() * (max-min)); }
function rnds(min, max) { return sleep(rnd(min, max)); }
async function doit(form) {
await sleep(250);
let showallTries = 0;
while (showallTries < 5 && form.querySelector(".q.hideInit"))
{
form.querySelector("#show_all_q > a").click();
await sleep(250);
}
const quizName = form.querySelector("#quizHeaderTitle > h1").innerText;
let sf;
const qs = form.querySelectorAll(".q");
const qn = qs.length;
console.warn(`[SPEEDRUN] quiz: ${quizName} (${form.action})`, `- ${qn} questions`);
for (let iN = 0; iN < qn; iN++)
{
const i = qs[iN];
console.warn(`[SPEEDRUN] hit #${iN+1}/${qn}:\n` + i.querySelector(":scope > .qt > .t").innerText);
const s = Array.from(i.querySelector(".quizQuesAnsArea").querySelectorAll(":scope > .opt"));
const chonum = i.dataset.multiselect ? rnd(1, s.length) : 1;
for (let j = 0; j < chonum; j++)
{
const ndx = Math.round(Math.random() * (s.length-1));
sf = s[ndx];
const optionText = sf.querySelector(":scope > div > label > div:last-child").innerText;
console.log(`[SPEEDRUN] chose #${ndx + 1} (choice #${j + 1}/${chonum})` + (optionText.trim() != "" ? ":\n" + optionText : ""));
sf.click();
await rnds(50, 100);
s.splice(ndx, 1);
}
await rnds(500, 750);
const nextbtn = sf.querySelector(":scope > div > .qbutton_small");
if (nextbtn)
{
nextbtn.click();
await rnds(500, 750);
}
}
await rnds(1000, 1100);
if (!document.querySelector(".result"))
{
console.warn("[SPEEDRUN] hitting submit button");
form.querySelector('input[type="submit"]').click(); // it has a custom event handler
await rnds(1000, 1100);
}
console.log(`[SPEEDRUN] done quiz: ${quizName}`);
}
document.arrive("#qform", { existing: true }, doit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment