Last active
September 11, 2017 07:30
-
-
Save isc30/2650f31697a35aedfb194dc955b5aebb to your computer and use it in GitHub Desktop.
!boton
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
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