@@ -34,10 +34,11 @@ var needSteemActiveKeySites = ['EpicDice','KryptoGames'];
34
34
var needSimulatorActiveKeySites = [ 'Simulator' ] ;
35
35
36
36
var nums = 0 , currency = 'btc' , base = 0 , isloop = false , iswin = false ;
37
+ var toggleDonate = false ;
37
38
var code ;
38
39
var startTime = new Date ( ) , settime , difftime = 0 , intervalBetTime = 0 ;
39
40
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 ;
41
42
var maxwinstreak = 0 , maxlossstreak = 0 , maxwinstreakamount = 0 , maxlossstreakamount = 0 , maxstreakamount = 0 , minstreakamount = 0 , maxbetamount = 0 ;
42
43
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 } ;
43
44
var currencies = [ 'BTC' , 'Doge' , 'LTC' , 'ETH' ] ;
@@ -259,6 +260,9 @@ screen.key(['enter'],async function(ch, key) {
259
260
if ( isloop ) {
260
261
await sleep ( intervalBetTime ) ;
261
262
betfunc ( ) ;
263
+ } else {
264
+ console . log ( "isloop is false" ) ;
265
+ let ret = await donate ( req ) ;
262
266
}
263
267
await saveLog ( logname , req . logdata + '\r\n' ) ;
264
268
i ++ ;
@@ -304,6 +308,28 @@ async function login(req) {
304
308
305
309
}
306
310
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
+
307
333
async function resetseed ( ) {
308
334
try {
309
335
let ret = await dice . resetseed ( req ) ;
0 commit comments