NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name fold
// @namespace http://tampermonkey.net/
// @version 1.1
// @author Ahab [1735214]
// @match https://www.torn.com/page.php?sid=holdem
// @updateURL https://openuserjs.org/meta/Ahab/fold.meta.js
// @downloadURL https://openuserjs.org/install/Ahab/fold.user.js
// @license MIT
// @grant none
// ==/UserScript==
var x = 0
function fold(){
$(document).on('keyup',function(e) {
if(e.which == 13) {
if($('div[class*="buttonsWrap_"]').children().length == 3){
if($($('div[class*="buttonsWrap_"]').children()[2]).is('[class*="queued__"]')){
$($('div[class*="buttonsWrap_"]').children()[2]).prop('disabled', true)
}
if($($('div[class*="buttonsWrap_"]').children()[2]).is(":not('[class*='queued__']')")){
$($('div[class*="buttonsWrap_"]').children()[2]).prop('disabled', false)
x = 0
}
if($($('div[class*="buttonsWrap_"]').children()[2])[0].innerText == 'FOLD'){
$('div[class*="buttonsWrap_"]').children()[2].click()
}
}
if($('div[class*="won_"]') && $('div[class*="won_"]').is(':last-child') && x == 0){
x = 1
$.post('https://www.torn.com/page.php?sid=holdemData&rfcv='+getRFC(), {
step: 'nextGame'
})
}
}
})
}
var tableCheck = setInterval(() => {
if($('div[class*="table_"]').length == 1){
clearInterval(tableCheck)
fold();
}
}, 100);