Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.78 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Quizlet Match Exploit
  3. // @namespace Breze
  4. // @version 1.0
  5. // @description The time will freeze and the answers will be the same color
  6. // @author You
  7. // @match https://quizlet.com/*/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. //Ignore the variable gravityScore because it doesn't work any more, but I decided to keep the code here
  13. var gravityScore,
  14. href = window.location.href;
  15. //<br><br><button class="UIButton" id="customWaitButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>
  16. (function() {
  17. initLoad();
  18. function initLoad() {
  19. if (href.includes("quizlet.com")) {
  20. if (href.includes("/learn")) {
  21. cAlert('<h2>Game Mode: Learn</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Just wait for this script to finish!<br><br><button class="UIButton" id="learnButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  22. getId("learnButton").addEventListener("click", function() {
  23. document.getElementById("customMessageContainer").remove();
  24. learn();
  25. });
  26.  
  27. } else if (href.includes("/flashcards")) {
  28. cAlert('<h2>Game Mode: Flashcards</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Changelog:</h4>+ Added Match time freeze for regular match and diagrams<br>+ Added Gravity score exploit to get ANY score you want!<br>+ Added custom alert box<br>+ Fixed graphics<br>- Removed useless alert boxes.<h4>Instructions:</h4>Umm why are you here? Go cheat somewhere else...<br><br><button class="UIButton" id="flashcardsButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  29. getId("flashcardsButton").addEventListener("click", function() {
  30. document.getElementById("customMessageContainer").remove();
  31. });
  32. } else if (href.includes("/write")) {
  33. cAlert('<h2>Game Mode: Write</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>You dont even have to wait,<br> this is my favorite one to watch!<br><br><button class="UIButton" id="writeButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  34. getId("writeButton").addEventListener("click", function() {
  35. document.getElementById("customMessageContainer").remove();
  36. write();
  37. });
  38. } else if (href.includes("/spell")) {
  39. cAlert('<h2>Game Mode: Spell</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Hold down enter and wait.<br><br><button class="UIButton" id="spellButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  40. getId("spellButton").addEventListener("click", function() {
  41. document.getElementById("customMessageContainer").remove();
  42. spell();
  43. });
  44. } else if (href.includes("/test")) {
  45. cAlert('<h2>Game Mode: Test</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><br><h4>Instructions:</h4>Right click to toggle answers.<br>(Be subtle when using)<br><br><button class="UIButton" id="testButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  46. getId("testButton").addEventListener("click", function() {
  47. document.getElementById("customMessageContainer").remove();
  48. testMode();
  49. });
  50. } else if (href.includes("/micromatch")) {
  51. cAlert('<h2>Game Mode: Micromatch</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="micromatchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  52. getId("micromatchButton").addEventListener("click", function() {
  53. document.getElementById("customMessageContainer").remove();
  54. micromatch();
  55. });
  56. } else if (href.includes("/match")) {
  57. cAlert('<h2>Game Mode: Match</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="matchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  58. getId("matchButton").addEventListener("click", function() {
  59. document.getElementById("customMessageContainer").remove();
  60. match();
  61. });
  62. } else if (href.includes("/gravity")) {
  63. try {
  64. document.getElementsByClassName("UIModal is-white is-open")[0].style.display = "none"
  65. } catch (e) {}
  66. cAlert('<h2>Game Mode: Gravity</h2>Thank you for using Breze\'s Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br> <h4>What score would you like?: <input type="number" id="gravityScoreInput" value="4294967295" onchange="gravityScore = parseInt(this.value);"></input></h4><br><br><button class="UIButton" id="gravityButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>');
  67. getId("gravityButton").addEventListener("click", function() {
  68. document.getElementById("customMessageContainer").remove();
  69. gravity();
  70. });
  71.  
  72. } else {
  73. }
  74. }
  75.  
  76. function testMode() {
  77. var question = getClass("TermText notranslate lang-en");
  78. for (var i = 0; i < question.length; i++) {
  79. question[i].innerHTML += '<br><small style="font-weight: bold; display: block;" class="answers">' + findAnswerGlobal(question[i].innerHTML) + "</small>";
  80. }
  81. window.oncontextmenu = function(e) {
  82. e.preventDefault();
  83. var answer = getClass("answers");
  84. if (answer[0].style.display == "block") {
  85. for (var i = 0; i < answer.length; i++) {
  86. answer[i].style.display = "none";
  87. }
  88. } else {
  89. for (var i = 0; i < answer.length; i++) {
  90. answer[i].style.display = "block"
  91. }
  92. }
  93. }
  94. }
  95.  
  96. function gravity() {
  97. if (gravityScore === undefined) {
  98. gravityScore = parseInt(prompt("Enter exact score:"));
  99. }
  100.  
  101. var t = window.QJP([], [], ["hyek"]).a,
  102. n = t.grader.grade.bind(t.grader);
  103. t._startGame(), t.dataMap = t.dataMap.update("points", function(t) {
  104. return gravityScore;
  105. });
  106. for (var o = 0; o < 99; o++) t._advanceLevel();
  107.  
  108. function s(e) {
  109. t.grader.grade = function(e, t, n) {
  110. return !0;
  111. }, e(), t.grader.grade = n
  112. }
  113. s(function() {
  114. console.log(null);
  115. });
  116. var a = t._promptCopyAnswer.bind(t);
  117. t._promptCopyAnswer = function(e) {
  118. a(e), setTimeout(function() {
  119. s(function() {
  120. t._checkCopiedAnswer({
  121. liveTermId: e,
  122. answer: ""
  123. });
  124. });
  125. }, 0);
  126. };
  127. }
  128.  
  129. function write() {
  130. //This is sad... but works better...
  131. var remaining = parseInt(document.getElementsByClassName("LearnModeProgressBar-value")[0].innerHTML);
  132. for (var i = 0; i < remaining; i++) {
  133. getId("user-answer").value = Math.random();
  134. getId("js-learnModeAnswerButton").click();
  135. getClass("js-learnModeOverrideIncorrect")[0].click();
  136. }
  137. /*
  138. var buttons = document.querySelectorAll("button"),
  139. span = document.querySelectorAll("span");
  140.  
  141. if (getId("user-answer")) {
  142. getId("user-answer").disabled = true;
  143. getId("user-answer").value = findAnswerGlobal(getClass("qDef lang-en TermText")[0].innerHTML);
  144. for (var i = 0; i < buttons.length; i++) {
  145. if (buttons[i].childNodes[0].innerHTML == "Answer") {
  146. buttons[i].click();
  147. }
  148. }
  149. try {
  150. for (var i = 0; i < span.length; i++) {
  151. if (span[i].childNodes[0].childNodes[0].innerHTML == "Override: I was right") {
  152. span[i].click;
  153. }
  154. }
  155. } catch (e) {}
  156. write();
  157. } else {
  158. for (var i = 0; i < buttons.length; i++) {
  159. if (buttons[i].innerHTML == "Press any key to continue") {
  160. buttons[i].click();
  161. } else if (buttons[i].innerHTML == "Start Over") {
  162. return 1;
  163. }
  164. }
  165. setTimeout(write, 0);
  166. }
  167. */
  168. }
  169.  
  170. function spell() {
  171. if (getClass("SpellModeControls-progressValue")[0].innerHTML == "100%") {
  172. return 1;
  173. }
  174. if (getId("js-spellInput") !== null) {
  175. getId("js-spellInput").value = findAnswerGlobal(getClass("qDef lang-en TermText")[0].innerHTML);
  176. setTimeout(spell, 10);
  177. }
  178. }
  179.  
  180. function match() {
  181. button = getClass("UIButton UIButton--hero")[0], button && button.click();
  182. setTimeout(function() {
  183. var matchLoop = setInterval(function() {
  184. waitForMatch();
  185. }, 0);
  186.  
  187. function waitForMatch() {
  188. if (getClass("MatchModeQuestionScatterTile") || getClass("MatchModeQuestionGridBoard-tile")) {
  189. for (var F = setTimeout(";"), i = 0; i < F; i++) clearTimeout(i);
  190. var tiles = getClass("MatchModeQuestionScatterTile");
  191. var colors = ["#FF0000", "#FF0000", "#FF6600", "#FF6600", "#FFFF00", "#FFFF00", "#00FF00", "#00FF00", "#00FFFF", "#00FFFF", "#0033FF", "#0033FF", "#FF00FF", "#FF00FF", "#CC00FF", "#CC00FF", "#6E0DD0", "#6E0DD0", "#C0C0C0", "#C0C0C0", "#FFFFFF", "#FFFFFF", "#A52A2A", "#A52A2A", "#F6CFFF", "#F6CFFF", "#CFD9FF", "#CFD9FF", "#FBFFA3", "#FBFFA3", "#FFD1A3", "#FFD1A3", "#710000", "#710000"];
  192. for (var i = 0; i < tiles.length; i++) {
  193. tiles[i].style.backgroundColor = colors[i];
  194. for (var j = 0; j < tiles.length; j++) {
  195. if (tiles[j].childNodes[0].innerHTML == findAnswerGlobal(tiles[j].childNodes[0].innerHTML)) {
  196. tiles[j].style.backgroundColor = colors[i];
  197. }
  198. }
  199. }
  200. clearTimeout(matchLoop);
  201. }
  202. }
  203. }, 500);
  204. }
  205.  
  206. function micromatch() {
  207. button = getClass("UIButton UIButton--hero")[0], button && button.click();
  208. setTimeout(function() {
  209. setTimeout(function() {
  210. for (var F = setTimeout(";"), o = 0; o < F; o++) clearTimeout(o);
  211. }, 0);
  212.  
  213. var tiles = getClass("MatchModeQuestionGridTile-text"); //[0].childNodes[0].innerHTML
  214. for (var i = 0; i < tiles.length; i++) {
  215.  
  216. if (getClass("MatchModeQuestionGridTile")[i].classList[1] != "is-selected") {
  217. click(getClass("MatchModeQuestionGridBoard-tile")[i].childNodes[0], "pointerdown");
  218. }
  219. for (var j = 0; j < tiles.length; j++) {
  220. if (tiles[j].childNodes[0].innerHTML == findAnswerGlobal(tiles[i].childNodes[0].innerHTML)) {
  221. if (getClass("MatchModeQuestionGridTile")[j].classList[1] != "is-selected") {
  222. click(getClass("MatchModeQuestionGridBoard-tile")[j].childNodes[0], "pointerdown");
  223. j = tiles.length;
  224. }
  225. }
  226. }
  227. }
  228. function click(e, t) {
  229. if (e.fireEvent) e.fireEvent("on" + t);
  230. else {
  231. var n = document.createEvent("Events");
  232. n.initEvent(t, !0, !1), e.dispatchEvent(n);
  233. }
  234. }
  235. }, 500);
  236. }
  237.  
  238. function learn() {
  239. if (getClass("ProgressSegmentedSemicircle-percent")[0].innerHTML = "100%") {
  240. return 1;
  241. }
  242. checkCheckbox();
  243. if (getClass("AssistantMultipleChoiceQuestionPromptView-inner")[0] !== undefined) {
  244. var answer = findAnswerGlobal(getClass("FormattedText notranslate TermText lang-en")[0].innerHTML);
  245. var q1 = getClass("FormattedText notranslate TermText lang-en")[1];
  246. var q2 = getClass("FormattedText notranslate TermText lang-en")[2];
  247. var q3 = getClass("FormattedText notranslate TermText lang-en")[3];
  248. var q4 = getClass("FormattedText notranslate TermText lang-en")[4];
  249. if (answer == q1.innerHTML) {
  250. q1.click();
  251. } else if (answer == q2.innerHTML) {
  252. q2.click();
  253. } else if (answer == q3.innerHTML) {
  254. q3.click();
  255. } else if (answer == q4.innerHTML) {
  256. q4.click();
  257. } else {
  258. console.error("ERROR: Unable to find / click answer");
  259. return 0;
  260. }
  261. getClass("UIButton")[4].click();
  262. setTimeout(learn, 10);
  263. } else {
  264. setTimeout(learn, 100);
  265. }
  266. }
  267.  
  268. function checkCheckbox() {
  269. document.getElementsByClassName("UIButton UIButton--whiteBorder UIButton--fill")[0].click();
  270. if (document.getElementsByClassName("UICheckbox-input")[3].checked && document.getElementsByClassName("UICheckbox-input")[2].checked !== true && document.getElementsByClassName("UICheckbox-input")[4].checked !== true) {
  271. document.getElementsByClassName("UIButton UIButton--inverted")[0].click();
  272. return 1;
  273. }
  274. if (document.getElementsByClassName("UICheckbox-input")[4].checked === true) {
  275. document.getElementsByClassName("UICheckbox-input")[4].click();
  276. }
  277. if (document.getElementsByClassName("UICheckbox-input")[2].checked === true) {
  278. document.getElementsByClassName("UICheckbox-input")[2].click();
  279. }
  280. if (document.getElementsByClassName("UICheckbox-input")[3].checked === false) {
  281. document.getElementsByClassName("UICheckbox-input")[3].click();
  282. }
  283. document.getElementsByClassName("UIButton UIButton--inverted")[0].click();
  284. }
  285.  
  286. function findAnswerGlobal(question) {
  287. if (Quizlet.assistantModeData !== undefined) { //Quizlet.assistantModeData.terms
  288. return getAnswer(Quizlet.assistantModeData.terms, question);
  289. } else if (Quizlet.learnGameData !== undefined) { //Quizlet.learnGameData.allTerms
  290. return getAnswer(Quizlet.learnGameData.allTerms, question);
  291. } else if (Quizlet.testModeData !== undefined) { //Quizlet.testModeData.terms
  292. return getAnswer(Quizlet.testModeData.terms, question);
  293. } else if (Quizlet.spellModeData !== undefined) { //Quizlet.spellModeData.spellGameData.termsById
  294. return getAnswer(Quizlet.spellModeData.spellGameData.termsById, question);
  295. } else if (Quizlet.matchModeData !== undefined) { //Quizlet.matchModeData.terms
  296. return getAnswer(Quizlet.matchModeData.terms, question);
  297. } else if (Quizlet.gravityModeData !== undefined) { //Quizlet.gravityModeData.terms
  298. return getAnswer(Quizlet.gravityModeData.terms, question);
  299. } else {
  300. return 0;
  301. }
  302.  
  303. function getAnswer(s, t) {
  304. var e = s;
  305. if (t.indexOf("_") != "-1") {
  306. if (t.slice(-1) == "_") { //Underscore at end
  307. for (var i=0; i<e.length; i++) {
  308. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  309. return e[i].word;
  310. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  311. return e[i].definition;
  312. }
  313. }
  314. } else if (t[0] == "_") {
  315. for (var i=0; i<e.length; i++) { //Underscore at start
  316. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1") {
  317. return e[i].word;
  318. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1") {
  319. return e[i].definition;
  320. }
  321. }
  322. } else {
  323. for (var i=0; i<e.length; i++) { //Underscore in middle
  324. if (e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1" && e[i].definition.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  325. return e[i].word;
  326. } else if (e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]) != "-1" && e[i].word.indexOf(getClass("qDef lang-en TermText")[0].innerHTML.split("_")[0]) != "-1") {
  327. return e[i].definition;
  328. }
  329. }
  330. }
  331. }
  332. var answers = [];
  333. for (var i=0; i<e.length; i++) {
  334. e[i].definition = e[i].definition.replace("\n", "<br>");
  335. e[i].word = e[i].word.replace("\n", "<br>");
  336. if (t == e[i].word) {
  337. answers.push(e[i].definition);
  338. } else if (t == e[i].definition) {
  339. answers.push(e[i].word);
  340. }
  341. }
  342. return answers[Math.floor(Math.random() * answers.length)];
  343. }
  344. }
  345. }
  346.  
  347. function cAlert(message) {
  348. var html = '<div class="UIModal is-white is-open" id="customMessageContainer" role="document" tabindex="-1"> <div class="UIModal-box"> <div class="UIModalHeader"> <div class="UIModalHeader-wrapper"> <span class="UIModalHeader-close"> <div class="UIModalHeader-closeIconButton"> <span class="UIIconButton"> <button class="UIButton UIButton--inverted" type="button" id="customCloseButton" onclick="document.getElementById(&quot;customMessageContainer&quot;).remove();"> <span class="UIButton-wrapper"> <svg class="UIIcon UIIcon--x-thin"> <noscript></noscript> <use xlink:href="#x-thin"></use> <noscript></noscript> </svg> </span> </button> </span> </div> </span> <div class="UIModalHeader-childrenWrapper"> <h3 class="UIHeading UIHeading--three"><span id="customTitle">Ray D. Adams Quizlet Exploit</span></h3> </div> </div> </div> <div class="UIModalBody"> <div class="UIDiv SetPageEmbedModal-content"> <div> <p class="UIParagraph"><span id="customMessage">'+message+'</span></p></div></div></div></div></div>';
  349. var j = document.createElement('div');
  350. j.innerHTML = html;
  351. document.body.appendChild(j);
  352. }
  353. })();
  354.  
  355. function getId(id) {
  356. return document.getElementById(id);
  357. }
  358.  
  359. function getClass(id) {
  360. return document.getElementsByClassName(id);
  361. }
  362.  
  363. //var learnInsertJs = "function figure(match) {termsWord = window.Quizlet.assistantModeData.terms.filter(function z(x) {return x.word == match}); termsDefinition = window.Quizlet.assistantModeData.terms.filter(function z(x) {return x.definition === match}); if (termsWord.length > 0) {return termsWord[0].definition;}; if (termsDefinition.length > 0) {return termsDefinition[0].word;}}; function solve() {input = document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-content > div > span:nth-child(2) > div > div > div.AssistantScrollableViewLayout-content > div > div.AssistantMultipleChoiceQuestionPromptView-promptArea > div > div > div > span').innerHTML; output = figure(input); outs = document.querySelectorAll('.AssistantMultipleChoiceQuestionPromptView-termOptionInner > div > span'); for (var i = 0; i < outs.length; i++) {if (outs[i].innerText === output) {outs[i].click();}}; document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-content > div > span:nth-child(3) > div > div.AssistantFixedActionLayout-action > div > button').click(); if (document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-controls > div > div > div > div.ModeControls-main > div.ModeControls-progress > div > div > div > svg > text.ProgressSegmentedSemicircle-text.ProgressSegmentedSemicircle-progressText > tspan').innerHTML.slice(0, -1) !== '100') {setTimeout(solve, 10);};}; solve();"
  364.  
  365. //backupOptionsSet = "/*document.querySelector('#AssistantModeTarget > div > div > div > div.ModeLayout-controls > div > div > div > div.ModeControls-main > div.ModeControls-actions > div > button > span > span').click(); if (document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(3) > label > input').checked) {document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(3) > label > input').click();}; if (document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(1) > label > input').checked) {document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalBody > div > div:nth-child(3) > div > div > div > div > div > div:nth-child(1) > label > input').click();}; document.querySelector('body > div:nth-child(4) > div.UIModal.is-white.is-open > div > div.UIModalHeader > div > span > div > span > button > span').click();*/"
  366. /*
  367. function solveLearn() {
  368. script = document.createElement('script');
  369. script.textContent = learnInsertJs;
  370. (document.head||document.documentElement).appendChild(script);
  371. script.remove();
  372. }
  373.  
  374. chrome.runtime.onMessage.addListener(
  375. function(request, sender, sendResponse) {
  376. if (request.run == "write") {
  377. iters = parseInt($(".LearnModeProgressBar-value").html())
  378. for (var i = 0; i < iters; i++) {
  379.  
  380. $("#user-answer")[0].value = "*";
  381. $("#js-learnModeAnswerButton")[0].click();
  382. document.evaluate('//*[@id="js-learnModeInner"]/div[1]/div/div[2]/div/div[2]/span/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();
  383. }
  384. sendResponse({out: 0});
  385. }
  386. else if (request.run === "learn") {
  387. solveLearn();
  388. sendResponse({out: 0});
  389. }
  390. else {
  391. sendResponse({out: 1});
  392. }
  393. });
  394. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement