Skip to content

Commit f3e639d

Browse files
author
bot
committed
start & resume
1 parent c9d0236 commit f3e639d

File tree

4 files changed

+94
-65
lines changed

4 files changed

+94
-65
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
* [Bit Fun](http://bitfun.co/?ref=950389505790)
106106
* [Bonus Bitcoin](http://bonusbitcoin.co/?ref=0B26E1CAF795)
107107
* [Faucet Collector](https://faucetcollector.com/?ref=4789455)
108+
* [AutoFaucet](https://autofaucet.org/r/mydicebot)
109+
* [FaucetPay](https://faucetpay.io/?r=201981)
108110

109111
# Mining
110112
* [CryptoTab](https://cryptotabbrowser.com/4760331)
@@ -222,6 +224,8 @@ bash start.sh
222224
|---|---|
223225
|__dobet()__|The loop of bets|
224226
|__stop()__|Stop the bet|
227+
|__start()__|Start the bet (from very beginning) after stop()|
228+
|__resume()__|Resume the bet (from current stopping) after stop()|
225229
|__resetsession()__|Reset the session|
226230
|__resetseed()__|Reset the client seed|
227231
|__sound(path_of_the_sound)__|Sound notificaiton|

src/package.json.console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "mydicebot-console-200419",
2+
"name": "mydicebot-console-200425",
33
"version": "1.0.0",
44
"description": "MyDiceBot - Bet more, earn more!",
55
"homepage": "https://mydicebot.com",

src/views/info.pug

Lines changed: 88 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ block content
1818
var lastbet = {id:0,chance:chance, date:1585642326,roll:49.5,amount:nextbet,nonce:1000,serverhash:'mydice',serverseed:'mydice',clientseed:'mydice',profit:profit,uid:1000,high:bethigh};
1919
var humps = ['baseBet', 'nextBet', 'betHigh', 'previousBet', 'currentProfit', 'currentStreak','currentRoll','lastBet.Id','lastBet.Chance','lastBet.date','lastBet.Roll','lastBet.Amount','lastBet.nonce','lastBet.serverhash','lastBet.serverseed','lastBet.clientseed','lastBet.Profit','lastBet.uid','lastBet.high','lastBet'];
2020
var maxwinstreak = 0, maxlossstreak = 0, maxwinstreakamount = 0, maxlossstreakamount = 0, maxstreakamount = 0, minstreakamount = 0, maxbetamount= 0 ;
21+
fengari.load('function stop()\nisloop = false \n js.global:stop() \n print(isloop)\nend')();
22+
fengari.load('function resetseed()\n js.global:resetseed() \nend')();
23+
fengari.load('function resetsession()\n js.global:resetsession() \nend')();
24+
fengari.load('function sound(file)\n js.global:sound(file) \nend')();
25+
fengari.load('function message(text, type, expire)\n js.global:message(text, type, expire) \nend')();
26+
fengari.load('function start()\n js.global:start() \nend')();
27+
fengari.load('function resume()\n js.global:resume() \nend')();
2128
webix.protoUI({
2229
name:"mydicebot_dataview"
2330
}, webix.ui.dataview, webix.OverlayBox );
@@ -186,6 +193,7 @@ block content
186193
{view: "label", label: "<a target='_blank' href='http://bitfun.co/?ref=950389505790'>BitFun</a>"},
187194
{view: "label", label: "<a target='_blank' href='http://bonusbitcoin.co/?ref=0B26E1CAF795'>BonusBitcoin</a>"},
188195
{view: "label", label: "<a target='_blank' href='https://faucetcollector.com/?ref=4789455'>FaucetCollector</a>"},
196+
{view: "label", label: "<a target='_blank' href='https://autofaucet.org/r/mydicebot'>AutoFaucet</a>"},
189197
]
190198
};
191199

@@ -231,7 +239,7 @@ block content
231239
faucet_site_info_2,
232240
mining_site_info,
233241
exchange_site_info,
234-
todo_dice_site_info,
242+
// todo_dice_site_info,
235243
];
236244

237245
var random_site_ref_info = {
@@ -1881,66 +1889,7 @@ block content
18811889
document.getElementById("python_stop_button").click();
18821890
}
18831891
} else {
1884-
currencyValue = $$("bet_currency_selection").getValue() -1;
1885-
//bethigh = false;
1886-
//if(currentLanguage == 'lua') fengari.load('bethigh= false')();
1887-
initScriptBalance(currencyValue, function(){
1888-
code = $$("script_bet_coding_board").getValue();
1889-
if (currentLanguage != 'py') {
1890-
code = $$("script_bet_coding_board").getValue().toLowerCase();
1891-
}
1892-
humps.forEach(function(element) {
1893-
code = code.replace(new RegExp(element, "gm"), element.toLowerCase());
1894-
});
1895-
try {
1896-
if(currentLanguage == 'lua') {
1897-
code = code.replace(/!=/g,"~=");
1898-
code = code.replace(/!/g,"not ");
1899-
code = code.replace(/base/g,'basebet');
1900-
code = code.replace(/basebetbet/g,'basebet');
1901-
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\+\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1+$2 ');
1902-
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\-\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1-$2 ');
1903-
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\*\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1*$2 ');
1904-
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\/\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1/$2 ');
1905-
fengari.load('lastbet = {}\n')();
1906-
fengari.load('currencies = {}\n')();
1907-
fengari.load('basebet='+basebet+'\nnextbet='+nextbet+'\nchance='+chance+'\nbethigh='+bethigh+'\n')();
1908-
fengari.load('function stop()\nisloop = false \n js.global:stop() \n print(isloop)\nend')();
1909-
fengari.load('function resetseed()\n js.global:resetseed() \nend')();
1910-
fengari.load('function resetsession()\n js.global:resetsession() \nend')();
1911-
fengari.load('function sound(file)\n js.global:sound(file) \nend')();
1912-
fengari.load('function message(text, type, expire)\n js.global:message(text, type, expire) \nend')();
1913-
fengari.load('nextbet=basebet\nbalance='+balance+'\nbets='+bets+'\nwins='+wins+'\nlosses='+ losses +'\nprofit='+profit+'\npreviousbet='+previousbet+'\ncurrentprofit='+currentprofit+'\ncurrentstreak='+currentstreak+'\ncurrentroll='+currentroll+'\nisloop=true\n')();
1914-
fengari.load('lastbet.id="'+lastbet.id+'"\nlastbet.chance='+lastbet.chance+'\nlastbet.date='+lastbet.date+'\nlastbet.roll='+lastbet.roll+'\nlastbet.amount='+ lastbet.amount +'\nlastbet.nonce="'+lastbet.nonce+'"\nlastbet.serverhash="'+lastbet.serverhash+'"\nlastbet.serverseed="'+lastbet.serverseed+'"\nlastbet.clientseed="'+lastbet.clientseed+'"\nlastbet.profit='+lastbet.profit+'\nlastbet.uid="'+lastbet.uid+'"\nlastbet.high='+lastbet.high+'\n')();
1915-
for(i=0;i<currencies.length;i++){
1916-
fengari.load('currencies[#currencies+1]="'+ currencies[i]+'"\n')();
1917-
}
1918-
fengari.load(code)();
1919-
}
1920-
if (currentLanguage == 'py') {
1921-
evalPython(code);
1922-
}
1923-
if (currentLanguage == 'js') {
1924-
evalScript(code);
1925-
}
1926-
} catch(err){
1927-
if(typeof err.message != 'undefined' ) {
1928-
console.error(err);
1929-
console.error(err.message);
1930-
webix.message({type: 'error', text: "load error:"+err.message});
1931-
} else {
1932-
console.error(err);
1933-
webix.message({type: 'error', text: "load error:"+err});
1934-
}
1935-
return false;
1936-
}
1937-
nextbet = basebet;
1938-
isloop = true;
1939-
stopOnWin = false;
1940-
stopOnLoss = false;
1941-
$$("script_bet_start_stop_button").setValue('STOP');
1942-
scriptBet(true);
1943-
});
1892+
start(true);
19441893
}
19451894
});
19461895
$$("auto_bet_start_stop_button").attachEvent("onItemClick", function(){
@@ -2577,7 +2526,7 @@ block content
25772526
bet_current_stats_seed:0,
25782527
});
25792528
$$('bet_datatable').clearAll();
2580-
$$("bet_chart").clearAll();
2529+
$$("bet_chart_graph").clearAll();
25812530
$$("script_bet_log_board").clearAll();
25822531
maxstreakamount = 0;
25832532
minstreakamount = 0;
@@ -2588,7 +2537,7 @@ block content
25882537
clear(function(userinfo){
25892538
setStats(userinfo, newId-1);
25902539
$$('bet_datatable').clearAll();
2591-
$$("bet_chart").clearAll();
2540+
$$("bet_chart_graph").clearAll();
25922541
clearSession();
25932542
});
25942543
}
@@ -2616,6 +2565,76 @@ block content
26162565
cb(ret);
26172566
});
26182567
}
2568+
async function resume(){
2569+
if(!isloop) {
2570+
console.log("call resume .....");
2571+
await new Promise(resolve => setTimeout(resolve, 5000));
2572+
$$("script_bet_start_stop_button").setValue('STOP');
2573+
isloop = true;
2574+
scriptBet(false);
2575+
}
2576+
}
2577+
function start(init){
2578+
if(init || !isloop){
2579+
if(!isloop && !init){
2580+
console.log("call start .....");
2581+
$$("script_bet_start_stop_button").setValue('STOP');
2582+
}
2583+
currencyValue = $$("bet_currency_selection").getValue() -1;
2584+
initScriptBalance(currencyValue, function(){
2585+
code = $$("script_bet_coding_board").getValue();
2586+
if (currentLanguage != 'py') {
2587+
code = $$("script_bet_coding_board").getValue().toLowerCase();
2588+
}
2589+
humps.forEach(function(element) {
2590+
code = code.replace(new RegExp(element, "gm"), element.toLowerCase());
2591+
});
2592+
try {
2593+
if(currentLanguage == 'lua') {
2594+
code = code.replace(/!=/g,"~=");
2595+
code = code.replace(/!/g,"not ");
2596+
code = code.replace(/base/g,'basebet');
2597+
code = code.replace(/basebetbet/g,'basebet');
2598+
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\+\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1+$2 ');
2599+
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\-\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1-$2 ');
2600+
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\*\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1*$2 ');
2601+
code = code.replace(/([a-zA-Z]*[0-9]*\s*)\/\=(\s*[a-zA-Z]*[0-9]*)/g, '$1=$1/$2 ');
2602+
fengari.load('lastbet = {}\n')();
2603+
fengari.load('currencies = {}\n')();
2604+
fengari.load('basebet='+basebet+'\nnextbet='+nextbet+'\nchance='+chance+'\nbethigh='+bethigh+'\n')();
2605+
fengari.load('nextbet=basebet\nbalance='+balance+'\nbets='+bets+'\nwins='+wins+'\nlosses='+ losses +'\nprofit='+profit+'\npreviousbet='+previousbet+'\ncurrentprofit='+currentprofit+'\ncurrentstreak='+currentstreak+'\ncurrentroll='+currentroll+'\nisloop=true\n')();
2606+
fengari.load('lastbet.id="'+lastbet.id+'"\nlastbet.chance='+lastbet.chance+'\nlastbet.date='+lastbet.date+'\nlastbet.roll='+lastbet.roll+'\nlastbet.amount='+ lastbet.amount +'\nlastbet.nonce="'+lastbet.nonce+'"\nlastbet.serverhash="'+lastbet.serverhash+'"\nlastbet.serverseed="'+lastbet.serverseed+'"\nlastbet.clientseed="'+lastbet.clientseed+'"\nlastbet.profit='+lastbet.profit+'\nlastbet.uid="'+lastbet.uid+'"\nlastbet.high='+lastbet.high+'\n')();
2607+
for(i=0;i<currencies.length;i++){
2608+
fengari.load('currencies[#currencies+1]="'+ currencies[i]+'"\n')();
2609+
}
2610+
fengari.load(code)();
2611+
}
2612+
if (currentLanguage == 'py') {
2613+
evalPython(code);
2614+
}
2615+
if (currentLanguage == 'js') {
2616+
evalScript(code);
2617+
}
2618+
} catch(err){
2619+
if(typeof err.message != 'undefined' ) {
2620+
console.error(err);
2621+
console.error(err.message);
2622+
webix.message({type: 'error', text: "load error:"+err.message});
2623+
} else {
2624+
console.error(err);
2625+
webix.message({type: 'error', text: "load error:"+err});
2626+
}
2627+
return false;
2628+
}
2629+
nextbet = basebet;
2630+
isloop = true;
2631+
stopOnWin = false;
2632+
stopOnLoss = false;
2633+
$$("script_bet_start_stop_button").setValue('STOP');
2634+
scriptBet(true);
2635+
});
2636+
}
2637+
}
26192638
function getInfo(cb){
26202639
$$("bet_chart").showProgress({
26212640
type:"icon",
@@ -2826,11 +2845,16 @@ block content
28262845
' window.message(text, type, expire)\n';
28272846
soundFun = '\ndef sound(file):\n'+
28282847
' window.sound(file)\n';
2848+
startFun = '\ndef start():\n'+
2849+
' window.start()\n';
2850+
resumeFun = '\ndef resume():\n'+
2851+
' window.resume()\n';
28292852
resetSeedFun = '\ndef resetseed():\n'+
28302853
' window.resetseed()\n';
28312854
resetSessionFun = '\ndef resetsession():\n'+
28322855
' window.resetsession()\n';
28332856
stopFun = '\ndef stop():\n'+
2857+
' window.isloop = False\n'+
28342858
' global isloop\n'+
28352859
' isloop = False\n';
28362860
stopBetFun = '\ndef stopbet(event):\n'+
@@ -2862,7 +2886,7 @@ block content
28622886
'\ndocument["python_before_bet_button"].bind("click", beforebet)\n'+
28632887
'\ndocument["python_after_bet_button"].bind("click", afterbet)\n'+
28642888
'\ndocument["python_stop_button"].bind("click", stopbet)\n';
2865-
strScript = strScript + messageFun + resetSeedFun + resetSessionFun + soundFun + stopFun + stopBetFun + beforeBetFun + afterBetFun + clickFun;
2889+
strScript = strScript + messageFun + resetSeedFun + resetSessionFun + soundFun + stopFun + startFun + resumeFun + stopBetFun + beforeBetFun + afterBetFun + clickFun;
28662890

28672891
//console.log("eval python:",strScript);
28682892
let dynamicStr = document.createElement ("script");

src/views/login.pug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ block content
343343
{view: "label", label: "<a target='_blank' href='http://bitfun.co/?ref=950389505790'>BitFun</a>"},
344344
{view: "label", label: "<a target='_blank' href='http://bonusbitcoin.co/?ref=0B26E1CAF795'>BonusBitcoin</a>"},
345345
{view: "label", label: "<a target='_blank' href='https://faucetcollector.com/?ref=4789455'>FaucetCollector</a>"},
346+
{view: "label", label: "<a target='_blank' href='https://autofaucet.org/r/mydicebot'>AutoFaucet</a>"},
346347
]
347348
};
348349

0 commit comments

Comments
 (0)