Last active
June 13, 2020 05:19
-
-
Save nathanielbd/035568e3b265ebb2f254883623ea8a12 to your computer and use it in GitHub Desktop.
Scripts for trolling on skribbl.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// guess from a database of words by matching regex | |
// CTRL-SHIFT-i, copy-paste into console, press `ENTER`: | |
// ---BEGIN--- | |
var guesser = null; | |
function cheat() { | |
var url = "https://skribbliohints.github.io/words.json"; | |
var guesses = []; | |
var i = 0; | |
fetch(url) | |
.then(res => res.json()) | |
.then((out) => { | |
guesser = setInterval(function() { | |
if (guesses.length > i) { | |
$("#inputChat").val(guesses[i]); | |
$("#formChat").submit(); | |
i++; | |
} | |
}, 1500); | |
for (var k in out) { | |
var hint = $("#currentWord")[0].textContent; | |
var regex = '^' + String.raw`\b` + hint.replace(/_/g, '[a-zA-Z0-9]').replace(/ /g, String.raw`\s`) + String.raw`\b` + '$'; | |
var pattern = new RegExp(regex); | |
if (pattern.test(k)) { | |
guesses.push(k); | |
console.log(k); | |
} | |
} | |
}) | |
.catch(err => { throw err }); | |
} | |
function restart() { | |
clearInterval(guesser); | |
cheat(); | |
} | |
function disable() { | |
clearInterval(guesser); | |
} | |
// you should press button when another letter is revealed and when a new word is selected | |
var button = document.createElement("input"); | |
button.type = "button"; | |
button.value = "Restart Guesser"; | |
button.onclick = restart; | |
var buttonList = document.getElementById("containerGamePlayers"); | |
buttonList.appendChild(button); | |
// you should press this button if you want to chat or manually input an answer | |
var disableButton = document.createElement("input"); | |
disableButton.type = "button"; | |
disableButton.value = "Disable Guesser"; | |
disableButton.onclick = disable; | |
buttonList.appendChild(disableButton); | |
cheat(); | |
// ---END--- | |
// spam a copypasta | |
// anything >1 message per second will get you kicked for spam | |
var text = "a funny copypasta"; | |
var arr = text.split(" "); | |
var i = 0; | |
setInterval(function(){ | |
$("#inputChat").val(arr.slice(i,i+10).join(" ")); | |
i = i+10; | |
$("#formChat").submit(); | |
}, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment