From 350f42c0c0229af47324c9662a7016aedc9a72c1 Mon Sep 17 00:00:00 2001 From: hori-hrzn Date: Sat, 25 Nov 2023 11:36:21 +0100 Subject: [PATCH] v1.1.0 Styling popup page, added random answering when the extension doesn't know the answer, fixed some questions text, removed temp file --- answers.js | 10 +++++----- content.js | 19 ++++++++++++++++--- plan.txt | 5 ----- popup.css | 18 ++++++++++++++++++ popup.html | 35 ++++++++++++++++++----------------- 5 files changed, 57 insertions(+), 30 deletions(-) delete mode 100644 plan.txt diff --git a/answers.js b/answers.js index 3a6f1f7..7a50219 100644 --- a/answers.js +++ b/answers.js @@ -208,22 +208,22 @@ globalThis.answers = { "In Grizzleheim, the Ravens want to bring about:": "The Everwinter, to cover the world in ice:", "Who is in the top level of the Tower of the Helephant?": "Lyon Lorestriker", "How long do you have to wait to join a new match after fleeing in PVP?": "5 minutes", - "What determines the colors of the manders in Krok?": "Where they come from and their school of focus", + "What determines the colors of the manders in Krok?": "Where they come from and their school of focus.", "What is the name of the new dance added with Khrysalis?": "The bee dance", "What is unique about Falmea's Classroom?": "There are scorch marks on the ceiling", - "What is Professor Falmea's favorite food?": "Pasta Arribata", + "What is Professor Falmea's favorite food?": "Pasta Arrabiata", "Which of these are not a lore spell?": "Fire Dragon", "What is the name of the book stolen from the Royal Museum?": "The Krokonomicon", "What school is the Gurtok Demon focused on?": "Balance", "What school is the spell Dark Nova": "Shadow", "What does the Time Ribbon Protect against?": "Time Flux", "What type of rank 8 spell is granted to Death students at level 58?": "Damage + DoT", - "What hand does Lady Oriel hold her wand in?": "Trick question, she has a sword", + "What hand does Lady Oriel hold her wand in?": "Trick question, she has a sword.", "Shaka Zebu is known best as:": "The Greatest Living Zebra Warrior", "Which Aztecan ponders the Great Questions of Life?": "Philosoraptor", "Which of these is NOT a Zafaria Anchor Stone?": "Rasik Anchor Stone", "Who is the Bear King of Grizzleheim?": "Valgard Goldenblade", - "An unmodified Sun Serpent does what?": "900 - 1000 Fire Damage + 300 Fire Damage to entire team", + "An unmodified Sun Serpent does what?": "900 � 1000 Fire Damage + 300 Fire Damage to entire team", "What is the name of the secret society in Krokotopia": "Order of the Fang", // "https://www.wizard101.com/quiz/trivia/game/pirate101-valencia-trivia" @@ -237,7 +237,7 @@ globalThis.answers = { "Who do you find in the Lecture Hall of Sivella?": "Ridolfo", "Why does Steed want you to attack Armada Ships?": "Make a Disguise", "You won't find this kind of Armada Troop in Sivella!": "Battle Angel", - "Historian Gonzago sends you on a “paper chase,” who do you talk to during that quest?": "Magdalena", + 'Historian Gonzago sends you on a "Paper Chase," who do you talk to during that quest?': "Magdalena", "Which one isn't a Scholar by name?": "Lorenzo", "What color of Windstone do you find in Marco Pollo's Tomb?": "Blue", "Which one isn't a Scholar by name?": "Caresini", diff --git a/content.js b/content.js index 6e1d998..7b0d1d4 100644 --- a/content.js +++ b/content.js @@ -60,9 +60,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { function answerQuestion(question) { - - - const answers = document.getElementsByClassName("answerText") console.log("The question is: "+question); @@ -72,8 +69,24 @@ function answerQuestion(question) { console.log("The answer is: ") console.log(answer); + // If there's no answer, we click a random answer to prevent the extension from stopping + if (answer == undefined) { + // Getting a random answer (for now, it's just the first answer) + const randomAnswer = answers[0].parentElement.getElementsByClassName("largecheckbox")[0]; + // We click it + setTimeout(() => + randomAnswer.click() + ,500) + // Clicking the button + const nextQuestionButton = document.getElementById("nextQuestion"); + setTimeout(() => + nextQuestionButton.click() + ,550) + return; + } + // If there's an answer (90% of cases) for (let i=0; i W101 TriviaMaker - - -

DO THEM ONE BY ONE

-

List of quizs available:

- + +
+

Remember to login!

+

List of quizs available:

+ + +
\ No newline at end of file