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...
KeePass is stored locally on your own machine, so it's safe.
More sample scripts are provided.
Git Commit
https://github.com/mydicebot/mydicebot.github.io/commit/10658227d060f760c990e0582beba359371c85b2
KeePass Check
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
Thank you for your contribution @mydicebot ! It is nice to see you continue development of the lovely bots!
console.log
- do we need them?if(ch>98.99 || ch<0.0001) { return false return false } } return true;
could be just a one-linerreturn 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 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.Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
In our last Algorithmic Curation Round, consisting of 254 contributions, your post is ranked at #133.
Evaluation of your UA score:
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) :
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: