Skip to content

Instantly share code, notes, and snippets.

@isc30
Last active September 11, 2017 07:30
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 isc30/2650f31697a35aedfb194dc955b5aebb to your computer and use it in GitHub Desktop.
Save isc30/2650f31697a35aedfb194dc955b5aebb to your computer and use it in GitHub Desktop.
!boton
function botonRisk(points)
{
return Math.max(0, (points - 100) * 10 / 50);
}
function boton()
{
$(".composer_rich_textarea").text("!boton");
$(".im_submit_send").trigger('mousedown');
setTimeout(function()
{
var user = "Isc30";
var stopRisk = 90; // 90% de posibilidad de fallo es buen momento de parar :D
var demisuke = $(".im_history_selected_wrap .im_history_message_wrap:has('.im_message_author:contains(\"Demisuke\")'):has('.im_message_text:contains(\"" + user + "\")')");
var message = demisuke.last().find(".im_message_text").text();
var points = message.substring(message.indexOf("pasará de ") + 10, message.indexOf(" puntos.")).split(" a ");
var previousPoints = parseInt(points[0]);
var currentPoints = parseInt(points[1]);
if (botonRisk(currentPoints) >= stopRisk) {
clearInterval(botonInterval);
}
}, 7000);
}
boton();
var botonInterval = setInterval(boton, 15500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment