Bitcoin Forum

Economy => Gambling discussion => Topic started by: mydicebot on January 30, 2019, 10:47:03 AM



Title: MyDiceBot Online Simulator is Released NOW!
Post by: mydicebot on January 30, 2019, 10:47:03 AM
MyDiceBot Official Site:

https://mydicebot.com

MyDiceBot Online Simulator:

https://simulator.mydicebot.com

You guys can coding and debugging the strategies/scripts online, without download MyDiceBot app.

* No matter what operation system (Win, Mac, Linux, or others) you have, you could have a try.

* You could debugging your own script in Simulator without any risk.
https://cdn.steemitimages.com/DQmWqtp17R3NMX9WgmDs3DTAXX5rQJE3hHEBwv2QntoEJYP/Selection_112.png

* You can adjust house edge to debug against.
https://cdn.steemitimages.com/DQmXA9C15LGnMGn2sCL7tKrbd2rhQN9pbsLqgfc4moF4WUr/Selection_114.png

* Simulation Code is here, using generated server seed and client seed, then HASH to calculate final roll result.
Code:
    async _simulatorBet(amount, target, condition, houseEdge ) {
        let betInfo = {};
        betInfo.id = 'MyDiceBot_'+Math.random().toString(16).substring(2).substr(0,10);
        betInfo.amount = parseFloat(amount);
        let serverSeed = Math.random().toString(36).substring(2);
        let clientSeed = Math.random().toString(36).substring(2);
        let cryptoHmac = crypto.createHmac('sha256', serverSeed);
        let resultSeed = cryptoHmac.update(`${clientSeed}`).digest('hex');
        let resultNumber = parseInt(resultSeed.substr(0, 10), 16);
        let diceRoll = (resultNumber % 1000000)+1;
        let factor = 1000000/(target+1);
        if(condition == 'over') {
            factor = 1000000/(999999-target+1);
        }
        let profit = (amount * factor) * (1 - houseEdge) - amount;
        console.log(amount,factor,betInfo.amount, houseEdge);
        betInfo.roll_number = diceRoll/10000;
        betInfo.win = false;
        if(condition == 'over') {
            if(target<diceRoll) {
                betInfo.win = true;
            }
        } else {
            if(target>diceRoll){
                betInfo.win = true;
            }
        }
        if(betInfo.win) {
            betInfo.payout = parseFloat((betInfo.amount+profit)).toFixed(8);
            betInfo.profit = parseFloat(profit).toFixed(8);
        } else {
            betInfo.payout = 0;
            betInfo.profit = parseFloat(-betInfo.amount).toFixed(8);
        }
        console.log(betInfo);
        return betInfo;
    }

Youtube Demo
* Manual/Auto Bet: https://www.youtube.com/watch?v=zQl2Os2wg_I
* Script Bet: https://www.youtube.com/watch?v=u7MXeReh0VE