Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name concave games boggle quick cheater
- // @namespace http://concavegames.com/quick_cheater
- // @version 0.1
- // @description Cheats on the boggle game on concavegames.com
- // @include http://concavegames.com/*
- // ==/UserScript==
- setTimeout(checkForGame, 100);
- var originalInitGame = null;
- var originalStartTimer = null;
- var timeLeft = 0;
- function checkForGame()
- {
- if(typeof unsafeWindow.canvasInitGame==="undefined" || typeof unsafeWindow.startTimer==="undefined")
- return setTimeout(checkForGame, 1000);
- originalInitGame = unsafeWindow.canvasInitGame;
- originalStartTimer = unsafeWindow.startTimer;
- unsafeWindow.canvasInitGame = myInitGame;
- unsafeWindow.startTimer = myStartTimer;
- }
- function myStartTimer(time)
- {
- timeLeft = time;
- originalStartTimer(time);
- }
- var wordsToPlay = null;
- var wordToPlay = null;
- var startAt = null;
- function myInitGame(board_c, words)
- {
- wordsToPlay = words.sort(function(a, b) { return a.length - b.length; }).map(function(a) { return a + "\n"; });
- startAt = Date.now();
- originalInitGame(board_c, words);
- setTimeout(playNextLetter, 1000);
- }
- function playNextLetter()
- {
- if(!wordToPlay)
- wordToPlay = wordsToPlay.pop();
- console.log(wordsToPlay.length);
- var letter = wordToPlay.substr(0, 1);
- wordToPlay = wordToPlay.substring(1);
- // Grabbed from the original source
- unsafeWindow.keysDown[letter.charCodeAt(0)] = true;
- unsafeWindow.keyboardSelected = unsafeWindow.keyboardSelected + letter;
- var positions = unsafeWindow.findWords2(unsafeWindow.keyboardSelected.toLowerCase(), unsafeWindow.board);
- if (positions.length == 0) {
- unsafeWindow.clearSelected();
- unsafeWindow.keyboardSelected = "";
- }
- else {
- unsafeWindow.emptySelected();
- for (i = 0; i < positions.length; i = i + 1) {
- unsafeWindow.selectedTiles.unshift(positions[i]);
- unsafeWindow.tiles[positions[i]].state = 1;
- }
- }
- // End grab
- if((Date.now()-startAt)<timeLeft)
- setTimeout(playNextLetter, 50);
- }
Advertisement
Add Comment
Please, Sign In to add comment