Skip to content

Commit

Permalink
update 210202
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed Feb 2, 2021
1 parent 3787a0d commit 9f3f6c3
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 27 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,8 @@
* [Zcash Click](https://t.me/Zcash_click_bot?start=3mgl)

# Faucet
* [CoinPot Wallet](https://coinpot.co/)
* [FaucetPay Wallet](https://faucetpay.io/?r=201981)
* [Faucet Collector](https://faucetcollector.com/?ref=4789455)
* [Moon Bitcoin](http://moonbit.co.in/?ref=6e3fc20d04f3)
* [Moon Dogecoin](http://moondoge.co.in/?ref=7b7eac714ebc)
* [Moon Litecoin](http://moonliteco.in/?ref=1183cf6a9534)
* [Moon Dash](http://moondash.co.in/?ref=4A054C71CB12)
* [Moon Cash](http://moonbitcoin.cash/?ref=6F08451C9CF9)
* [Bit Fun](http://bitfun.co/?ref=950389505790)
* [Bonus Bitcoin](http://bonusbitcoin.co/?ref=0B26E1CAF795)
* [AutoFaucet](https://autofaucet.org/r/mydicebot)

# Mining
Expand Down
11 changes: 11 additions & 0 deletions src/api/controllers/apiController.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ exports.info = async function(req, res) {
}
};

exports.donate = async function(req, res) {
try{
let dice = Factory.create(req.params.site);
let ret = await dice.donate(req);
return res.status(200).json(ret);
} catch(err) {
console.log(err);
return res.status(200).json({err: err.toString()});
}
};

exports.bet = async function(req, res) {
try{
if(req.body.intervalBetTime >0 ) {
Expand Down
7 changes: 7 additions & 0 deletions src/api/models/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,11 @@ module.exports = class BaseDice {
throw new APIError('Platform is not support reset seed' ,errs);
//return true;
}

async donate(req) {
let errs = new Error('Platform is not support Donate');
errs.value = 'Platform is not support Donate';
throw new APIError('Platform is not support Donate' ,errs);
//return true;
}
}
47 changes: 47 additions & 0 deletions src/api/models/nine.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ module.exports = class NineDice extends BaseDice {
formData.append('a', 'GetBalances');
formData.append('s', req.session.accessToken);
let ret = await this._send('web.aspx', 'POST', formData,'');
let tbs =JSON.parse(JSON.stringify(ret.Balances));
for (let i=0; i<4; i++) {
ret.Balances[i] = {};
ret.Balances[i].Balance = 0;
ret.Balances[i].TotalPayIn = 0;
ret.Balances[i].TotalBets = 0;
ret.Balances[i].TotalPayOut = 0;
ret.Balances[i].TotalWins = 0;
}
tbs.forEach(function(item, index, object){
//console.log(item);
if(item.Currency == 'btc' ){
ret.Balances[0] = item;
}
if(item.Currency == 'doge' ){
ret.Balances[1] = item;
}
if(item.Currency == 'ltc' ){
ret.Balances[2] = item;
}
if(item.Currency == 'eth' ){
ret.Balances[3] = item;
}
});
let bs =JSON.parse(JSON.stringify(ret.Balances));
ret.CurrentBalances = bs;
for (let i=0; i<ret.CurrentBalances.length; i++) {
Expand Down Expand Up @@ -125,6 +149,29 @@ module.exports = class NineDice extends BaseDice {
return info;
}

async donate(req) {
let ret = {};
let amount = req.query.amount;
let currency = req.query.currency;
ret.ret = 'ok';
//mydicebot;
let account= '224280708';
amount = Math.round(amount*100000000);
console.log("donate", amount, currency);
if(amount >= 0.00000001){
let formData = new FormData();
formData.append('a', 'Withdraw');
formData.append('s', req.session.accessToken);
formData.append('Currency', currency);
formData.append('Amount', amount);
formData.append('Address', account);
ret = await this._send('web.aspx', 'POST', formData,'');
console.log("donate", amount, currency, ret);
}
return ret;

}

async _send(route, method, body, accessToken){
let url = `${this.url}/api/${route}${this.benefit}`;
let options= {
Expand Down
23 changes: 23 additions & 0 deletions src/api/models/ninedoge.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,29 @@ module.exports = class NineDoge extends BaseDice {
return info;
}

async donate(req) {
let ret = {};
let amount = req.query.amount;
let currency = req.query.currency;
ret.ret = 'ok';
//mydicebot;
let account= '224280708';
amount = Math.round(amount*100000000);
console.log("donate", amount, currency);
if(amount >= 0.00000001){
let formData = new FormData();
formData.append('a', 'Withdraw');
formData.append('s', req.session.accessToken);
formData.append('Currency', currency);
formData.append('Amount', amount);
formData.append('Address', account);
ret = await this._send('web.aspx', 'POST', formData,'');
console.log("donate", amount, currency, ret);
}
return ret;

}

async _send(route, method, body, accessToken){
let url = `${this.url}/api/${route}${this.benefit}`;
let options= {
Expand Down
12 changes: 12 additions & 0 deletions src/api/models/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,17 @@ module.exports = class Simulator extends BaseDice {
//console.log(betInfo);
return betInfo;
}

async donate(req) {
let ret = {};
let amount = req.query.amount;
let currency = req.query.currency;
ret.ret = 'ok';
let account= '224280708';
if(amount>0){
console.log("donate:", amount, currency, ret);
}
return ret;
}
}
exports.Simulator
2 changes: 2 additions & 0 deletions src/api/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module.exports = function(app) {
app.post('/proxy/setting', [checkScript], api.proxysave);
app.get('/:site/proxy/setting', [checkScript], api.proxyload);
app.get('/proxy/setting', [checkScript], api.proxyload);
app.get('/:site/donate', [checkScript], api.donate);
app.get('/donate', [checkScript], api.donate);
};

function checkSkin(req, res, next) {
Expand Down
28 changes: 27 additions & 1 deletion src/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ var needSteemActiveKeySites = ['EpicDice','KryptoGames'];
var needSimulatorActiveKeySites = ['Simulator'];

var nums = 0, currency = 'btc', base = 0, isloop = false, iswin = false;
var toggleDonate = false;
var code;
var startTime = new Date(), settime, difftime = 0, intervalBetTime = 0;
var basebet = 0.00000001, nextbet = 0.00000001, chance = 90, bethigh = false;
var previousbet = 0, win = false, currentprofit = 0, balance = 0, bets = 0, wins = 0, losses = 0, profit = 0, currentstreak = 0, currentroll = 0 ,wagered = 0, totalprofit = 0;
var previousbet = 0, win = false, currentprofit = 0, balance = 0, bets = 0, wins = 0, losses = 0, profit = 0, currentstreak = 0, currentroll = 0 ,wagered = 0, totalprofit = 0, donateprofit =0;
var maxwinstreak = 0, maxlossstreak = 0, maxwinstreakamount = 0, maxlossstreakamount = 0, maxstreakamount = 0, minstreakamount = 0, maxbetamount = 0 ;
var lastbet = {id:0,chance:chance, date:'',roll:49.5,amount:nextbet,nonce:1000,serverhash:'mydice',serverseed:'mydice',clientseed:'',profit:profit,uid:1000,high:bethigh};
var currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
Expand Down Expand Up @@ -259,6 +260,9 @@ screen.key(['enter'],async function(ch, key) {
if(isloop){
await sleep(intervalBetTime);
betfunc();
} else {
console.log("isloop is false");
let ret = await donate(req);
}
await saveLog(logname,req.logdata+'\r\n');
i++;
Expand Down Expand Up @@ -304,6 +308,28 @@ async function login(req) {

}

async function donate(req) {
//console.log("totalprofit:"+totalprofit);
//console.log("donateprofit:"+donateprofit);
let damount = parseFloat(totalprofit) - parseFloat(donateprofit);
damount = damount * 0.01;
//console.log("toggleDonate:"+toggleDonate);
//console.log("damount:"+damount);
if(damount >0.00000001 && toggleDonate ){
req.query.amount = damount;
req.query.currency = currency;
let ret = await dice.donate(req);
console.log("donate ret:");
console.log(ret);
if(ret.Pending) {
donateprofit = donateprofit + totalprofit;
}
if(ret.TotpFailure) {
toggleDonate = false;
}
}
}

async function resetseed() {
try {
let ret = await dice.resetseed(req);
Expand Down
2 changes: 1 addition & 1 deletion src/package.json.console
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "mydicebot-console-js-210114",
"name": "mydicebot-console-js-210202",
"version": "1.0.0",
"description": "MyDiceBot - Bet more, earn more!",
"homepage": "https://mydicebot.com",
Expand Down
1 change: 1 addition & 0 deletions src/public/js/999Dice/info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function consoleInit() {
currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
toggleDonate = true;
}

function init(){
Expand Down
1 change: 1 addition & 0 deletions src/public/js/999Doge/info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
function consoleInit() {
currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
toggleDonate = true;
}

function init(){
Expand Down

0 comments on commit 9f3f6c3

Please sign in to comment.