Skip to content

Instantly share code, notes, and snippets.

@lgg
Last active January 27, 2021 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgg/cf6f05e18c709ab3c0f228a860c36991 to your computer and use it in GitHub Desktop.
Save lgg/cf6f05e18c709ab3c0f228a860c36991 to your computer and use it in GitHub Desktop.
Своя игра online auto-clicker
clickerActivated = false;
function autoClicker(e) {
try {
if (e.currentTarget.children[0].classList.contains('tableBorder')) {
if (window.getComputedStyle(document.getElementById('table').children[0], null)['border-color'] === "rgb(255, 230, 130)") {
document.getElementById('playerButtonHost').children[0].click();
console.log('CLICKED')
}
}
} catch (e) {
}
}
$(document).keydown(function (e) {
console.log(e.which)
if (e.which === 81) { // q
console.log('clickerActive status' + clickerActivated);
if (clickerActivated) {
console.log('CLICKER ACTIVATED');
$('#table').bind('DOMSubtreeModified', autoClicker);
} else {
console.log('CLICKER DISABLED');
$('#table').removeEventListener("DOMSubtreeModified", autoClicker, false);
}
clickerActivated = !clickerActivated;
}
//e.preventDefault(); // prevent the default action (scroll / move caret)
});
/*
Style for border with selection: border-color: rgb(255, 230, 130);
*/
@EricSchlange
Copy link

Hello!
It returns "Cannot read property 'keydown' of undefined" when I'm trying to run it in the chrome console on the SI website. I am totally oblivious to js - is it me doing something incorrectly or it's not supposed to work at all?
Cheers!

@lgg
Copy link
Author

lgg commented Jan 27, 2021

Try to run this code in console only when the game is already loaded and the first question was already asked (so you have 'answer' button), maybe it could help. Also, the devs of SI website could change smth on the website.

As I remember it was only a draft and it don't work stable.
Unfortunately, I have no time now for patching/fixing this, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment