MyDiceBot - 190212 is released with KeePass integrated NOW!

in #utopian-io5 years ago

mydicebot-steemit.png

Feature Update

  • KeePass is supported, so you can store username/password/api-key/token in KeePass, to avoid input them again and again and again and again...
    mydicebot-login-keepass.png
  • KeePass is stored locally on your own machine, so it's safe.
    mydicebot-login-keepass-on.png

  • More sample scripts are provided.
    Selection_150.png

Git Commit

exports.keecheck = async function(req, res) {
    try{
        let keepassfile = req.query.keepassfile;
        let filePath = path.resolve(path.join(process.execPath, '../keepass/')+keepassfile+'.kdbx');
        if (fs.existsSync(filePath)) {
            return res.status(200).json(true);
        } else {
            return res.status(200).json(false);
        }
    } catch(err) {
        console.log(err);
        res.render('error',{err: err.toString()});
    }
};
  • KeePass Load
exports.keeload = async function(req, res) {
    try{
        let filePath = path.resolve(path.join(process.execPath, '../keepass/')+req.body.keepassfile+'.kdbx');
        let cred = new kdbxweb.Credentials(kdbxweb.ProtectedValue.fromString(req.body.keepassword));
        let data  = await fs.readFileSync(filePath);
        let db = await kdbxweb.Kdbx.load(new Uint8Array(data).buffer, cred);
        let kees = {};
        for (let group of db.groups) {
            if(group.name == 'mydicebot') {
                for (let subGroup of group.groups) {
                    let entrys = [];
                    for (let entry of subGroup.entries) {
                        let en = {};
                        en['username'] = field(entry, 'UserName');
                        en['password'] = field(entry, 'Password');
                        en['apikey'] = field(entry, 'ApiKey');
                        entrys.push(en);
                    }
                    kees[subGroup.name] = entrys;
                }
            }
        }
        return res.status(200).send(kees);
    } catch(err) {
        console.log(err);
        res.render('error',{err: err.toString()});
    }
};
  • KeePass Registration
exports.keereg = async function(req, res) {
    try{
        let filePath = path.resolve(path.join(process.execPath, '../keepass/')+req.body.keepassfile+'.kdbx');
        let cred = new kdbxweb.Credentials(kdbxweb.ProtectedValue.fromString(req.body.keepassword));
        let db = kdbxweb.Kdbx.create(cred, 'mydicebot');
        //let subGroup = db.createGroup(db.getDefaultGroup(), 'mydicebot');
        db.save().then(ab => {
            fs.writeFileSync(filePath, Buffer.from(ab));
            return res.status(200).json('ok');
        });
    } catch(err) {
        console.log(err);
        res.render('error',{err: err.toString()});
    }
};
  • KeePass Save
exports.keesave = async function(req, res) {
    try{
        let filePath = path.resolve(path.join(process.execPath, '../keepass/')+req.query.keepassfile+'.kdbx');
        let cred = new kdbxweb.Credentials(kdbxweb.ProtectedValue.fromString(req.query.keepassword));
        let db = kdbxweb.Kdbx.create(cred, 'mydicebot');
        for(let k1  in req.body) {
            let subGroup = db.createGroup(db.getDefaultGroup(), k1);
            if(typeof req.body[k1] == 'string') {
                req.body[k1] = JSON.parse(req.body[k1]);
            }
            for(let k2  in req.body[k1]) {
                let entry = db.createEntry(subGroup);
                db.meta.customData.key = 'MyDiceBot#' + k2;
                entry.fields.Title = 'MyDiceBot_'+k1+'_' + k2;
                entry.fields.UserName = (req.body[k1][k2].username =='') ? req.body[k1][k2].apikey : req.body[k1][k2].username;
                entry.fields.Password = req.body[k1][k2].password;
                entry.fields.ApiKey = req.body[k1][k2].apikey;
                entry.fields.URL = registerUrls[k1];
                entry.fields.GitHubUrl = mydiceUrls['GitHub'];
                entry.fields.DiscordUrl = mydiceUrls['Discord'];
                entry.fields.OfficialSiteUrl = mydiceUrls['Home'];
                entry.fields.OnlineSimulatorUrl = mydiceUrls['Sim'];
                entry.times.update();
            }
        }
        db.save().then(ab => {
            fs.writeFileSync(filePath, Buffer.from(ab));
            return res.status(200).json('ok');
        });
    } catch(err) {
        console.log(err);
        res.render('error',{err: err.toString()});
    }
};
  • KeePass Init
exports.keefiles = async function(req, res) {
    try{
        //let filePath = path.resolve(path.join(__dirname, '../../script/lua/'));
        let filePath = path.resolve(path.join(process.execPath, '../keepass/'));
        let paths = await getFiles(filePath, 'kdbx');
        return res.status(200).json(paths);
    } catch(err) {
        console.log(err);
        res.render('error',{err: err.toString()});
    }
};

MyDiceBot

  • https://mydicebot.com
  • MyDiceBot is World #1 Cross-Platform Dicing Bot.
  • Multiple platforms are supported, including Windows, Mac, Linux, and Web.
  • Multiple blockchains are supported, including STEEM.
  • Multiple programming languages are supported such as Lua.
  • Open Source and Free Forever

Supporting Dice Sites (alphabet sequence)

Quick Start

  • Download MyDiceBot Binaries here: MyDiceBot Releases.
  • Different execution methods on different platforms.
    • Linux (Open Terminal)

      chmod +x mydicebot-linux
      
      ./mydicebot-linux
      
    • Mac (Open Terminal)

      chmod +x mydicebot-macos
      
      ./mydicebot-macos
      
    • Windows (Open Command Prompt)

      mydicebot-win.exe
      
  • Choose Dice Site, Input username/password/2FA/APIKey, then Login.
  • Bet and WIN.

Startup Options

  • -port (port is 3000 by default)

    mydicebot-win.exe -port 12345
    
    
    

MyDiceBot Official Site

MyDiceBot Online Simulator

MyDiceBot Discord Chat

MyDiceBot Download

mydicebot-steemit.png

Sort:  

Thank you for your contribution @mydicebot ! It is nice to see you continue development of the lovely bots!

  1. all work is squeezed into a single commit which is highly discouraged
  2. no comments at all.
  3. commented-out code could have to be just removed
  4. lots of console.log - do we need them?
  5. if(ch>98.99 || ch<0.0001) { return false return false } } return true; could be just a one-liner return ch<=98.99&&ch>=1e-4

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

thanks for reviewing, voting u.

Thank you for your review, @justyy! Keep up the good work!

Hi @mydicebot!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 1.201 which ranks you at #47165 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 254 contributions, your post is ranked at #133.

Evaluation of your UA score:
  • Only a few people are following you, try to convince more people with good work.
  • The readers like your work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

Congratulations @mydicebot! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 900 upvotes. Your next target is to reach 1000 upvotes.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

Valentine challenge - Love is in the air!

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.040
BTC 70597.89
ETH 3559.60
USDT 1.00
SBD 4.77