Skip to content

Instantly share code, notes, and snippets.

@erayarslan
Created December 12, 2015 17:21
Show Gist options
  • Select an option

  • Save erayarslan/c59c1515297eb3b2999d to your computer and use it in GitHub Desktop.

Select an option

Save erayarslan/c59c1515297eb3b2999d to your computer and use it in GitHub Desktop.
lel
// localStorage.level = 1000; if u want : )
var click = function () {
document.body.dispatchEvent(new Event('mousedown'));
};
var getElementRotate = function (id) {
try {
var values = window
.getComputedStyle(document.getElementById(id), null)
.getPropertyValue("transform")
.split('(')[1].split(')')[0]
.split(',');
return Math.round(Math.atan2(values[1], values[0]) * (180/Math.PI));
} catch (e) {
//
}
};
var l = getElementRotate("locker");
document.body.addEventListener("DOMSubtreeModified", function(e) {
l = getElementRotate("locker");
run();
}, false);
click();
var run = function () {
setTimeout(function () {
var k = getElementRotate("key");
if (l == k || l + 1 == k) {
click();
} else {
run();
}
}, 0);
};
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment