-
-
Save zoten/a2c71d6629560f5ead965442804bc161 to your computer and use it in GitHub Desktop.
BiteTheBot hack
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
// ==UserScript== | |
// @include https://web.telegram.org/* | |
// ==/UserScript== | |
var url = "https://web.telegram.org/#/im?p=@bitethebot"; | |
const action_timeout = 6000; | |
const min_timeout = 60000; | |
const max_timeout = 300000; | |
const start_timeout = 5000; | |
const max_timeout_delta = max_timeout - min_timeout; | |
var hack0 = function() { | |
if(window.location.href == url) { | |
//document.getElementsByClassName('composer_rich_textarea')[0].innerHTML = ":rocket: Extra"; | |
//unsafeWindow.$('.im_submit').trigger('mousedown'); | |
unsafeWindow.$('button:contains(Extra)').trigger('click'); | |
window.setTimeout(hack1, action_timeout); | |
} | |
else { | |
window.setTimeout(hack0, action_timeout); | |
} | |
}; | |
var hack1 = function() { | |
if(window.location.href == url) { | |
//document.getElementsByClassName('composer_rich_textarea')[0].innerHTML = ":beer: Beer"; | |
//unsafeWindow.$('.im_submit').trigger('mousedown'); | |
unsafeWindow.$('button:contains(Beer)').trigger('click'); | |
window.setTimeout(hack2, action_timeout); | |
} | |
else { | |
window.setTimeout(hack1, action_timeout); | |
} | |
}; | |
var hack2 = function() { | |
if(window.location.href == url) { | |
unsafeWindow.$('button:contains(Half Pint)').trigger('click'); | |
window.setTimeout(hack3, action_timeout); | |
} | |
else { | |
window.setTimeout(hack2, action_timeout); | |
} | |
}; | |
var hack3 = function() { | |
if(window.location.href == url) { | |
//document.getElementsByClassName('composer_rich_textarea')[0].innerHTML = ":arrow_backward: Back"; | |
//unsafeWindow.$('.im_submit').trigger('mousedown'); | |
unsafeWindow.$('button:contains(Back)').trigger('click'); | |
//random between 1 ad 5 minutes | |
window.setTimeout(hack0, Math.round(min_timeout + Math.random() * max_timeout_delta)); | |
} | |
else { | |
window.setTimeout(hack3, action_timeout); | |
} | |
}; | |
window.setTimeout(hack0, start_timeout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment