Skip to content

Instantly share code, notes, and snippets.

@isc30
Last active Sep 11, 2017
Embed
What would you like to do?
!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