Bitcoin Forum
October 02, 2022, 04:38:58 PM *
News: Latest Bitcoin Core release: 23.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: MyDiceBot Online Simulator is Released NOW!  (Read 72 times)
mydicebot (OP)
Member
**
Offline Offline

Activity: 371
Merit: 12


View Profile WWW
January 30, 2019, 10:47:03 AM
 #1

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.


* You can adjust house edge to debug against.


* 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

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!