Skip to content

Commit

Permalink
v1.1.0 Styling popup page, added random answering when the extension …
Browse files Browse the repository at this point in the history
…doesn't know the answer, fixed some questions text, removed temp file
  • Loading branch information
hori-hrzn committed Nov 25, 2023
1 parent 49be3a5 commit 350f42c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 30 deletions.
10 changes: 5 additions & 5 deletions answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand Down
19 changes: 16 additions & 3 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<answers.length;i++) {
console.log(answers[i].textContent.trim());
if (answers[i].textContent.trim() == answer){
Expand Down
5 changes: 0 additions & 5 deletions plan.txt

This file was deleted.

18 changes: 18 additions & 0 deletions popup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.main-container {
display: flex;
flex-direction: column;
width: 200px;
background-color: black;
color: white;
}
.main-container a {
color: white;
}
.main-container a:visited {
color: rgb(0, 189, 0);
}

.main-container li {
font-size: large;
margin-bottom: 6px;
}
35 changes: 18 additions & 17 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,24 @@
<script src="popup.js"></script>
<title>W101 TriviaMaker</title>
</head>
<body>
<button id="startButtonPopup">Start</button>
<h2>DO THEM ONE BY ONE</h2>
<h3>List of quizs available:</h3>
<ul>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-zafaria-trivia">1- Zafaria</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-wizard-city-trivia">2- Wizard City</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-spells-trivia">3- Spells</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-spellbinding-trivia">4- Spellbinding</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-mystical-trivia">5- Mystical</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-marleybone-trivia">6- Marleybone</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-magical-trivia">7- Magical</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-conjuring-trivia">8- Conjuring</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-adventuring-trivia">9- Adventuring</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/pirate101-valencia-trivia">10- Valencia</a></li>

</ul>
<body style="background-color: black;">
<div class="main-container">
<h2>Remember to login!</h2>
<h3>List of quizs available:</h3>
<ul>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-zafaria-trivia">1- Zafaria</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-wizard-city-trivia">2- Wizard City</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-spells-trivia">3- Spells</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-spellbinding-trivia">4- Spellbinding</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-mystical-trivia">5- Mystical</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-marleybone-trivia">6- Marleybone</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-magical-trivia">7- Magical</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-conjuring-trivia">8- Conjuring</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/wizard101-adventuring-trivia">9- Adventuring</a></li>
<li><a target="_blank" href="https://www.wizard101.com/quiz/trivia/game/pirate101-valencia-trivia">10- Valencia</a></li>

</ul>
<button id="startButtonPopup" style="width: fit-content; align-self: center;">Start</button>
</div>
</body>
</html>

0 comments on commit 350f42c

Please sign in to comment.