|
3 | 3 | // @name:ja Kーアンチボット |
4 | 4 | // @namespace http://tampermonkey.net/ |
5 | 5 | // @homepage https://theusaf.org |
6 | | -// @version 3.5.2 |
| 6 | +// @version 3.5.3 |
7 | 7 | // @icon https://cdn.discordapp.com/icons/641133408205930506/31c023710d468520708d6defb32a89bc.png |
8 | 8 | // @description Remove all bots from a kahoot game. |
9 | 9 | // @description:es eliminar todos los bots de un Kahoot! juego. |
@@ -55,7 +55,7 @@ if (window.localStorage.kahootThemeScript) { |
55 | 55 | } |
56 | 56 |
|
57 | 57 | let patchMessageCompletion = new Promise(() => {}); |
58 | | -const antibotVersion = "3.5.2"; |
| 58 | +const antibotVersion = "3.5.3"; |
59 | 59 |
|
60 | 60 | // Should allow for default behavior and reload page |
61 | 61 | if (location.pathname.includes("/oauth2/")) { |
@@ -125,7 +125,6 @@ const PATCHES = { |
125 | 125 | * @returns {string} |
126 | 126 | */ |
127 | 127 | globalFunctions(code) { |
128 | | - // Access global functions. Also gains direct access to the controllers? |
129 | 128 | const globalFuncRegex = |
130 | 129 | /\({[^"`]*?quiz[^"`]*?startQuiz:([$\w]+).*?}\)=>{(?=var)/, |
131 | 130 | [globalFuncMatch, globalFuncLetter] = code.match(globalFuncRegex); |
@@ -160,6 +159,25 @@ const PATCHES = { |
160 | 159 | })()})` |
161 | 160 | ); |
162 | 161 | }, |
| 162 | + /** |
| 163 | + * Accesses core data. |
| 164 | + * |
| 165 | + * @param {string} code The code to patch |
| 166 | + * @returns {string} |
| 167 | + */ |
| 168 | + gameCore(code) { |
| 169 | + const coreDataRegex = /([$\w]+)\.game\.core/, |
| 170 | + [, coreDataLetter] = code.match(coreDataRegex); |
| 171 | + return code.replace( |
| 172 | + coreDataRegex, |
| 173 | + `(()=>{ |
| 174 | + if(typeof windw !== "undefined"){ |
| 175 | + windw.antibotData.kahootInternals.kahootCore = ${coreDataLetter}; |
| 176 | + } |
| 177 | + return ${coreDataLetter}.game.core; |
| 178 | + })()` |
| 179 | + ); |
| 180 | + }, |
163 | 181 | /** |
164 | 182 | * Access game settings |
165 | 183 | * 3.2.8 --> added back to core data |
@@ -247,6 +265,7 @@ function patcher(code, url) { |
247 | 265 | code = PATCHES.questionTime(code); |
248 | 266 | code = PATCHES.globalFunctions(code); |
249 | 267 | code = PATCHES.quizInformation(code); |
| 268 | + code = PATCHES.gameCore(code); |
250 | 269 | code = PATCHES.gameSettingsOld(code); |
251 | 270 | code = PATCHES.twoFactor(code); |
252 | 271 | code = patchMainScript(code); |
|
0 commit comments