【问题标题】:I need a solution for a gambling script我需要一个赌博脚本的解决方案
【发布时间】:2016-02-24 06:50:25
【问题描述】:

我有一个赌博网站的脚本。

我需要的是,在两次调用函数multiply 之后,它会下注可能的最大赌注,然后调用函数reset,我的意思是在每两次连续亏损中,它会在我的帐户重置中下注全部余额最低赌注并继续玩,因为我意识到,在每 2 次输掉的“手动投注”赔率为 1.1 时,下一次将是赢。

就像:在 2 次 multiplyCalls 下注全部余额(即下图中的“MAX”按钮)并重置游戏以继续玩。我说的够清楚了吗?

我试图为此创建一个函数,但没有成功

“最大赌注”按钮元素代码为:

<a href="javascript:void(0);" id="double_your_btc_max" style="color: inherit;">MAX</a>

this is the printscreen

我要修改的脚本部分是这个,multiplyCalls 函数已经创建。我将var multiply = (current * 2).toFixed(8); 更改为var multiply = (current * 1).toFixed(8);,因为我的策略没有马丁格尔。

function multiply(){
        if(multiplyCalls < 2){ // test multiply
            var current = $('#double_your_btc_stake').val();
            var multiply = (current * 2).toFixed(8);
            $('#double_your_btc_stake').val(multiply);
            multiplyCalls++; // increment
        }else{
            reset();
            console.log('=== RESETING ===');
        }
}

这是完整的脚本:

var startValue = '0.00000001', // Don't lower the decimal point more than 4x of current balance
        stopPercentage = 0.001, // In %. I wouldn't recommend going past 0.08
        maxWait = 500, // In milliseconds
        stopped = false,
        stopBefore = 3; // In minutes
        multiplyCalls = 0; // <--- Added this global

var $loButton = $('#double_your_btc_bet_lo_button'),
                $hiButton = $('#double_your_btc_bet_hi_button');


function multiply(){
        if(multiplyCalls < 2){ // test multiply
            var current = $('#double_your_btc_stake').val();
            var multiply = (current * 1).toFixed(8);
            $('#double_your_btc_stake').val(multiply);
            multiplyCalls++; // increment
        }else{
            reset();
            console.log('=== RESETING ===');
        }
}

function getRandomWait(){
        var wait = Math.floor(Math.random() * maxWait ) + 100;

        console.log('Waiting for ' + wait + 'ms before next bet.');

        return wait ;
}

function startGame(){
        console.log('Game started!');
        reset();
        $loButton.trigger('click');
}

function stopGame(){
        console.log('Game will stop soon! Let me finish.');
        stopped = true;
}

function reset(){
        $('#double_your_btc_stake').val(startValue);

}

// quick and dirty hack if you have very little bitcoins like 0.0000001
function deexponentize(number){
        return number * 1000000;
}

function iHaveEnoughMoni(){
        var balance = deexponentize(parseFloat($('#balance').text()));
        var current = deexponentize($('#double_your_btc_stake').val());

        return ((balance*2)/100) * (current*2) > stopPercentage/100;
}

function stopBeforeRedirect(){
        var minutes = parseInt($('title').text());

        if( minutes < stopBefore )
        {
                console.log('Approaching redirect! Stop the game so we don\'t get redirected while loosing.');
                stopGame();

                return true;
        }

        return false;
}

// Unbind old shit
$('#double_your_btc_bet_lose').unbind();
$('#double_your_btc_bet_win').unbind();

// Loser
$('#double_your_btc_bet_lose').bind("DOMSubtreeModified",function(event){
        if( $(event.currentTarget).is(':contains("lose")') )
        {
                console.log('You LOST! Multiplying your bet and betting again.');

                multiply();

                setTimeout(function(){
                        $loButton.trigger('click');
                }, getRandomWait());

                //$loButton.trigger('click');
        }
});

// Winner
$('#double_your_btc_bet_win').bind("DOMSubtreeModified",function(event){
        if( $(event.currentTarget).is(':contains("win")') )
        {
                if( stopBeforeRedirect() )
                {
                        return;
                }

                if( iHaveEnoughMoni() )
                {
                        console.log('You WON! But don\'t be greedy. Restarting!');

                        reset();

                        if( stopped )
                        {
                                stopped = false;
                                return false;
                        }
                }
                else
                {
                        console.log('You WON! Betting again');
                }

                setTimeout(function(){
                        $loButton.trigger('click');
                }, getRandomWait());
                multiplyCalls = 0; // reset value
        }
});startGame

【问题讨论】:

    标签: javascript function if-statement


    【解决方案1】:

    因此,基本上,您希望在两次输球后将赌注最大化。因为乘法调用仅在丢失后发生,我们可以假设if(multiplyCalls &lt; 2) 位负责处理。所以在下面的else 中,你真正需要做的就是达到最大赌注而不是调用reset()。根据我对代码的理解,这应该足够了,对吗?

    function multiply(){
        if(multiplyCalls < 2){ // test multiply
            var current = $('#double_your_btc_stake').val();
            var multiply = (current * 1).toFixed(8);
            $('#double_your_btc_stake').val(multiply);
            multiplyCalls++; // increment
        }else{
            //reset(); /* instead of resetting here, let's max the bet. */
            $('#double_your_btc_max').trigger('click');
            console.log('=== RESETING ===');
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2019-11-17
      • 2016-03-31
      • 1970-01-01
      • 2021-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-26
      相关资源
      最近更新 更多