Skip to content

Commit 9f3f6c3

Browse files
author
bot
committed
update 210202
1 parent 3787a0d commit 9f3f6c3

File tree

13 files changed

+214
-27
lines changed

13 files changed

+214
-27
lines changed

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,8 @@
9797
* [Zcash Click](https://t.me/Zcash_click_bot?start=3mgl)
9898

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

112104
# Mining

src/api/controllers/apiController.js

+11
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ exports.info = async function(req, res) {
8686
}
8787
};
8888

89+
exports.donate = async function(req, res) {
90+
try{
91+
let dice = Factory.create(req.params.site);
92+
let ret = await dice.donate(req);
93+
return res.status(200).json(ret);
94+
} catch(err) {
95+
console.log(err);
96+
return res.status(200).json({err: err.toString()});
97+
}
98+
};
99+
89100
exports.bet = async function(req, res) {
90101
try{
91102
if(req.body.intervalBetTime >0 ) {

src/api/models/base.js

+7
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,11 @@ module.exports = class BaseDice {
1111
throw new APIError('Platform is not support reset seed' ,errs);
1212
//return true;
1313
}
14+
15+
async donate(req) {
16+
let errs = new Error('Platform is not support Donate');
17+
errs.value = 'Platform is not support Donate';
18+
throw new APIError('Platform is not support Donate' ,errs);
19+
//return true;
20+
}
1421
}

src/api/models/nine.js

+47
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,30 @@ module.exports = class NineDice extends BaseDice {
4949
formData.append('a', 'GetBalances');
5050
formData.append('s', req.session.accessToken);
5151
let ret = await this._send('web.aspx', 'POST', formData,'');
52+
let tbs =JSON.parse(JSON.stringify(ret.Balances));
53+
for (let i=0; i<4; i++) {
54+
ret.Balances[i] = {};
55+
ret.Balances[i].Balance = 0;
56+
ret.Balances[i].TotalPayIn = 0;
57+
ret.Balances[i].TotalBets = 0;
58+
ret.Balances[i].TotalPayOut = 0;
59+
ret.Balances[i].TotalWins = 0;
60+
}
61+
tbs.forEach(function(item, index, object){
62+
//console.log(item);
63+
if(item.Currency == 'btc' ){
64+
ret.Balances[0] = item;
65+
}
66+
if(item.Currency == 'doge' ){
67+
ret.Balances[1] = item;
68+
}
69+
if(item.Currency == 'ltc' ){
70+
ret.Balances[2] = item;
71+
}
72+
if(item.Currency == 'eth' ){
73+
ret.Balances[3] = item;
74+
}
75+
});
5276
let bs =JSON.parse(JSON.stringify(ret.Balances));
5377
ret.CurrentBalances = bs;
5478
for (let i=0; i<ret.CurrentBalances.length; i++) {
@@ -125,6 +149,29 @@ module.exports = class NineDice extends BaseDice {
125149
return info;
126150
}
127151

152+
async donate(req) {
153+
let ret = {};
154+
let amount = req.query.amount;
155+
let currency = req.query.currency;
156+
ret.ret = 'ok';
157+
//mydicebot;
158+
let account= '224280708';
159+
amount = Math.round(amount*100000000);
160+
console.log("donate", amount, currency);
161+
if(amount >= 0.00000001){
162+
let formData = new FormData();
163+
formData.append('a', 'Withdraw');
164+
formData.append('s', req.session.accessToken);
165+
formData.append('Currency', currency);
166+
formData.append('Amount', amount);
167+
formData.append('Address', account);
168+
ret = await this._send('web.aspx', 'POST', formData,'');
169+
console.log("donate", amount, currency, ret);
170+
}
171+
return ret;
172+
173+
}
174+
128175
async _send(route, method, body, accessToken){
129176
let url = `${this.url}/api/${route}${this.benefit}`;
130177
let options= {

src/api/models/ninedoge.js

+23
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,29 @@ module.exports = class NineDoge extends BaseDice {
125125
return info;
126126
}
127127

128+
async donate(req) {
129+
let ret = {};
130+
let amount = req.query.amount;
131+
let currency = req.query.currency;
132+
ret.ret = 'ok';
133+
//mydicebot;
134+
let account= '224280708';
135+
amount = Math.round(amount*100000000);
136+
console.log("donate", amount, currency);
137+
if(amount >= 0.00000001){
138+
let formData = new FormData();
139+
formData.append('a', 'Withdraw');
140+
formData.append('s', req.session.accessToken);
141+
formData.append('Currency', currency);
142+
formData.append('Amount', amount);
143+
formData.append('Address', account);
144+
ret = await this._send('web.aspx', 'POST', formData,'');
145+
console.log("donate", amount, currency, ret);
146+
}
147+
return ret;
148+
149+
}
150+
128151
async _send(route, method, body, accessToken){
129152
let url = `${this.url}/api/${route}${this.benefit}`;
130153
let options= {

src/api/models/simulator.js

+12
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,17 @@ module.exports = class Simulator extends BaseDice {
202202
//console.log(betInfo);
203203
return betInfo;
204204
}
205+
206+
async donate(req) {
207+
let ret = {};
208+
let amount = req.query.amount;
209+
let currency = req.query.currency;
210+
ret.ret = 'ok';
211+
let account= '224280708';
212+
if(amount>0){
213+
console.log("donate:", amount, currency, ret);
214+
}
215+
return ret;
216+
}
205217
}
206218
exports.Simulator

src/api/routes/api.js

+2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ module.exports = function(app) {
5858
app.post('/proxy/setting', [checkScript], api.proxysave);
5959
app.get('/:site/proxy/setting', [checkScript], api.proxyload);
6060
app.get('/proxy/setting', [checkScript], api.proxyload);
61+
app.get('/:site/donate', [checkScript], api.donate);
62+
app.get('/donate', [checkScript], api.donate);
6163
};
6264

6365
function checkSkin(req, res, next) {

src/console.js

+27-1
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ var needSteemActiveKeySites = ['EpicDice','KryptoGames'];
3434
var needSimulatorActiveKeySites = ['Simulator'];
3535

3636
var nums = 0, currency = 'btc', base = 0, isloop = false, iswin = false;
37+
var toggleDonate = false;
3738
var code;
3839
var startTime = new Date(), settime, difftime = 0, intervalBetTime = 0;
3940
var basebet = 0.00000001, nextbet = 0.00000001, chance = 90, bethigh = false;
40-
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;
41+
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;
4142
var maxwinstreak = 0, maxlossstreak = 0, maxwinstreakamount = 0, maxlossstreakamount = 0, maxstreakamount = 0, minstreakamount = 0, maxbetamount = 0 ;
4243
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};
4344
var currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
@@ -259,6 +260,9 @@ screen.key(['enter'],async function(ch, key) {
259260
if(isloop){
260261
await sleep(intervalBetTime);
261262
betfunc();
263+
} else {
264+
console.log("isloop is false");
265+
let ret = await donate(req);
262266
}
263267
await saveLog(logname,req.logdata+'\r\n');
264268
i++;
@@ -304,6 +308,28 @@ async function login(req) {
304308

305309
}
306310

311+
async function donate(req) {
312+
//console.log("totalprofit:"+totalprofit);
313+
//console.log("donateprofit:"+donateprofit);
314+
let damount = parseFloat(totalprofit) - parseFloat(donateprofit);
315+
damount = damount * 0.01;
316+
//console.log("toggleDonate:"+toggleDonate);
317+
//console.log("damount:"+damount);
318+
if(damount >0.00000001 && toggleDonate ){
319+
req.query.amount = damount;
320+
req.query.currency = currency;
321+
let ret = await dice.donate(req);
322+
console.log("donate ret:");
323+
console.log(ret);
324+
if(ret.Pending) {
325+
donateprofit = donateprofit + totalprofit;
326+
}
327+
if(ret.TotpFailure) {
328+
toggleDonate = false;
329+
}
330+
}
331+
}
332+
307333
async function resetseed() {
308334
try {
309335
let ret = await dice.resetseed(req);

src/package.json.console

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "mydicebot-console-js-210114",
2+
"name": "mydicebot-console-js-210202",
33
"version": "1.0.0",
44
"description": "MyDiceBot - Bet more, earn more!",
55
"homepage": "https://mydicebot.com",

src/public/js/999Dice/info.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function consoleInit() {
22
currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
3+
toggleDonate = true;
34
}
45

56
function init(){

src/public/js/999Doge/info.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function consoleInit() {
22
currencies = ['BTC', 'Doge', 'LTC', 'ETH'];
3+
toggleDonate = true;
34
}
45

56
function init(){

0 commit comments

Comments
 (0)