0% found this document useful (0 votes)
187 views5 pages

Script

This JSON document defines configuration parameters for a dice betting game including base bet amount, chance percentages, profit and loss stop values. The code initializes variables, makes bets according to the chance calculation, tracks profit/loss and stops if certain threshold are met.

Uploaded by

Đức Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
187 views5 pages

Script

This JSON document defines configuration parameters for a dice betting game including base bet amount, chance percentages, profit and loss stop values. The code initializes variables, makes bets according to the chance calculation, tracks profit/loss and stops if certain threshold are met.

Uploaded by

Đức Lê
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

//Bc Game Hash Dice

var config = {
//divider: { label: "Divider", value: 230000, type: "number" },
baseBet: { label: "Base-Bet", value: 0.00000100, type: "number" },
minChance: { label: "Min-Chance", value: 49, type: "number" },
maxChance: { label: "Max-Chance", value: 49, type: "number" },
stopprof: { label: "Stop-Profit", value: 100000, type: "number" },
stoploss: { label: "Stop-Loss-%", value: 100, type: "number" }
/*
stop: { label: "stop if bet >", value: 1e8, type: "number" },
balanceRisk: { label: "balance risk %", value: 100, type: "number" },
targetProfit: {label:'Target-Profit-Stop', value: 1000, type:'number'},
targetBalance: {label:'Target-Balance-Stop', value: 1000, type:'number'},
onLoseTitle: { label: "On Lose", type: "title" }
*/
};

var run = false;


//var bet = currency.amount/config.divider.value;
//var bet = config.baseBet.value;
//var basebet = bet;
var startTime = new Date();
var timestring = '';
var roundWins = 0;
var roundLosses = 0;
var chance = Math.random() * (config.maxChance.value - config.minChance.value) +
config.minChance.value;
var currentProfitt = 0;
var currentProfittt = 0;
var curProf = 0;
var profitTotal = 0;
var balance = currency.amount;
var lastbalance = balance;
var currentBet = 0;

var
//bb = balance / config.divider.value,
bb = config.baseBet.value;
filthy = false,
old = balance,
oldy = balance,
oldbaly = balance,
oldbal = balance,
startbalance = balance,
wage = 0,
r = 0,
basebet = bb,
nextbet = bb,
rst = 0,
profreset = 0,
stavka = 0,
b = balance,
prof = (balance - b) * 100 / b;

function main() {
run = true;
//nextbet = balance / config.divider.value;
nextbet = config.baseBet.value;
game.onBet = function () {
//balance = currency.amount;
//if(balance >= lastbalance) lastbalance = balance;
chance = Math.random() * (config.maxChance.value - config.minChance.value) +
config.minChance.value;
//game.bet(currentBet, config.payout.value).then(function (payout) {
game.bet(nextbet, (99/chance).toFixed(4)).then(function (payout) {
/*
currentProfitt += curProf;
if (currentProfitt >= currentProfittt) {
currentProfittt = currentProfitt;
currentBet = config.baseBet.value;
roundWins = 0;
roundLosses = 0;
}
*/
currentBet = nextbet;
if (payout > 1) {
balance += currentBet*99/chance-currentBet;
profitTotal += currentBet*99/chance-currentBet;
profreset += currentBet*99/chance-currentBet;
}else{
balance -= currentBet;
profitTotal -= currentBet;
profreset -= currentBet;
}
if(balance >= lastbalance) lastbalance = balance;
prof = (balance - b) * 100 / b;
stavka += 1;
if (profreset >= 0) {
profreset = 0;
rst += 1;
r += 1;
/*
if r == 2 then
bethigh = !bethigh
r = 0
end
*/
//bb = balance / config.divider.value;
bb = config.baseBet.value;
if (rst == 500) {
//seed_reset();
rst = 0;
}
}
if (payout > 1) {
wage = wage-1;
}else{
wage = wage+1;
}
if (wage>=(Math.floor(Math.random() * (5 - 2 + 1) + 2))) {
nextbet = nextbet*2;
basebet = nextbet;
wage = 0;
filthy = true;
}
if (balance>=(oldy+(basebet*(Math.floor(Math.random() * (7 - 2 + 1) + 2)))))
{
nextbet = nextbet*2;
basebet = nextbet;
oldy = balance;
}
if (balance<oldy) {
oldy = balance;
}
if (balance>=oldbal && filthy==false) {
oldbal = balance;
}
if (balance>=oldbal && filthy==true) {
nextbet = bb;
basebet = bb;
oldy = balance;
oldbal = balance;
oldbaly = balance;
filthy = false;
}
if (balance>=(oldbaly+(bb*10))) {
nextbet = bb;
basebet = bb;
oldy = balance;
oldbal = balance;
filthy = false;
oldbaly = balance;
}
if (payout > 1) {
log.success(
"We won, so next bet will be " +
nextbet +
" " +
currency.currencyName
);
}else{
log.error(
"We lost, so next bet will be " +
nextbet +
" " +
currency.currencyName
);
}
if (prof >= config.stopprof.value) {

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
log.info('Сделано ставок = ' +stavka);

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
log.info('Профит составил >= ' +prof+ '%');

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
game.stop();
}
if ((startbalance - balance - nextbet) > startbalance *
(config.stoploss.value/100)) {

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
log.info('STOP LOSS ');

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
log.info('Сделано ставок = ' +stavka);

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
log.info("Финальный баланс : " +balance);

log.info(':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::');
game.stop();
}

/*
currentProfitt += curProf;
if (currentProfitt >= currentProfittt) {
currentProfittt = currentProfitt;
currentBet = config.baseBet.value;
roundWins = 0;
roundLosses = 0;
}
if (currentBet < config.baseBet.value) {
currentBet = config.baseBet.value
}

var stoplevel = (100-config.balanceRisk.value)*lastbalance/100;


if(balance - currentBet < stoplevel){
log.error(
"Balance Risk " + currentBet + " Stop"
);
game.stop();
}

if (currentBet > config.stop.value) {


log.error(
"Was about to bet " + currentBet + " which triggers the stop"
);
game.stop();
}

if (currentBet > balance) {


log.error(
"Loss " + balance + " which triggers the stop"
);
game.stop();
}

if (profitTotal >= config.targetProfit.value) {


//bet = currency.amount/config.divider.value;
log.success('Target Profit ' + (profitTotal).toFixed(8) + ' ' +
currency.currencyName);
game.stop();
}

if (balance >= config.targetBalance.value) {


//bet = currency.amount/config.divider.value;
log.success('Target Balance ' + balance + ' ' +
currency.currencyName);
game.stop();
}
*/
});
};
}

setInterval(function(){
var cur = new Date();
var t = Math.floor((cur - startTime) / 1000);
var hour = Math.floor(t / 3600);
if (hour < 10) hour = '0' + Math.floor(t / 3600);
t = t % 3600;
var minutes = Math.floor(t / 60);
if (minutes < 10) minutes = '0' + Math.floor(t / 60);
var seconds = t % 60;
if (seconds < 10) seconds = '0' + t % 60;
if(run) timestring = 'PlayTime ' + hour + ':' + minutes + ':' + seconds + '
';
else timestring = '';
},'1000');

You might also like