Last active
May 6, 2023 03:17
-
-
Save tajnymag/4e1d79cefe81ef040638d5e58500e867 to your computer and use it in GitHub Desktop.
Small cheat for properly playing s0urce.io
This file contains 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
let commandToWriteImg = document.getElementsByClassName('tool-type-img')[0]; | |
let commandPrompt = document.getElementById('tool-type-word'); | |
let dick = new Map(); | |
function saveToMap() { | |
dick.set(commandToWriteImg.src, commandPrompt.value); | |
} | |
function loadScript(url, callback) { | |
var script = document.createElement("script") | |
script.type = "text/javascript"; | |
script.src = url; | |
document.head.appendChild(script); | |
} | |
function readTranslateFill() { | |
Tesseract.recognize(commandToWriteImg) | |
.progress(function(p) { | |
console.log('progress', p) | |
}) | |
.then(function(result) { | |
commandPrompt.value = result.text.replace(/\s+/, "")[0].toLowerCase() + result.text.replace(/\s+/, "").slice(1); | |
saveToMap(); | |
$("#tool-type-form").submit(); | |
readTranslateFill(); | |
}); | |
} | |
loadScript("https://cdn.rawgit.com/naptha/tesseract.js/1.0.10/dist/tesseract.js"); |
dansleboby
commented
Jun 22, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment