Professional Documents
Culture Documents
1
1
001;
var mulBet = 2;
var mulPlaceBet = 499499;
var betMode = 0;
var maxWin = 10;
var newPlaceBet = 0.001;
var cntWin = 0;
function applyFormula(bet) {
let currentBalance = $('.Numbers.HighlightedText.UserBalance').text();
if(bet > currentBalance) {
console.log("Bạn không còn đủ tiền để cược thêm");
} else {
if(cntWin >= maxWin) {
console.log("Đã thắng đủ " + maxWin + " lần");
} else {
processBet(betMode, bet);
}
}
}
pipe = {
events: {
connected: null,
disconnected: null,
startupInfoReceived: null,
withdrawPending: null,
withdrawInsufficientFunds: null,
withdrawError: null,
},
betsAllowed: !0,
server: {
isBetOutstanding: !1,
lastReceivedBetId: 0,
overlappingBetCount: 0,
placeBet: function(n, t, i, r, u, f) {
pipe.betsAllowed && (!pipe.server.isBetOutstanding ||
config.prefs.overlappingBetsAllowed) && (pipe.server.overlappingBetCount > 5 ||
(pipe.server.isBetOutstanding = !0, ++pipe.server.overlappingBetCount,
$.connection.mainHub.server.placeBet(n, t, i, r, u, f).done(function(n) {
var f, e, o;
pipe.server.isBetOutstanding = !1;
--pipe.server.overlappingBetCount;
switch (n.status) {
case 0:
f = new BetInfo;
f.accountId = data.user.accountId;
f.betCount = 1;
f.betWins = n.secret >= t && n.secret <= i ? 1 : 0;
f.secret = n.secret;
f.clientSeed = r;
f.currencyId = u;
f.guessHigh = i;
f.guessLow = t;
f.id = n.id;
f.payIn = n.payIn;
f.payOut = n.payOut;
f.name = data.user.friendlyName;
e = data.user.currencyStats[u];
o = data.site.betStats[u];
data.user.serverSeedHash = n.next ? n.next : null;
pipe.server.lastReceivedBetId < f.id &&
(pipe.server.lastReceivedBetId = f.id, e.balance = n.startingBalance + f.payIn +
f.payOut);
++e.betStats.count;
++o.count;
e.betStats.payIn += f.payIn;
e.betStats.payOut += f.payOut;
o.payIn += f.payIn;
o.payOut += f.payOut;
f.betWins && (++e.betStats.winCount, ++o.winCount);
pipe.events.betComplete && pipe.events.betComplete(f, 10);
$('.UserBalance').text((e.balance * 1e-8).toFixed(8));
$('#LastBetInfoProfit').text(((n.payIn + n.payOut) /
1e8).toFixed(8));
$("#LastBetInfoSecret").text(n.secret);
f.betWins ? ($
("#LastBetInfoContainer").removeClass("BadNumber"), $
("#LastBetInfoContainer").addClass("GoodNumber")) : ($
("#LastBetInfoContainer").removeClass("GoodNumber"), $
("#LastBetInfoContainer").addClass("BadNumber"));
if(f.betWins) {
cntWin++;
newPlaceBet = baseBet;
} else {
newPlaceBet = (newPlaceBet * mulBet).toFixed(8);
}
applyFormula(newPlaceBet);
break;
default:
pipe.events.betError && pipe.events.betError(n.msg)
}
}).fail(function() {
--pipe.server.overlappingBetCount;
pipe.server.isBetOutstanding = !1
})))
},
twoFactorAdjust: function(n, t) {
// $.connection.mainHub.server.twoFactorAdjust(n, t)
}
},
client: {
infoUpdates: function(n) {
var t, i;
if (data.site.betStats[1].count) {
if (n.bets && pipe.events.receivedSiteBets &&
pipe.events.receivedSiteBets(pipe.betsFromSiteBroadcastFormat(n.bets)), n.betStats)
{
for (t = 0; t < n.betStats.currencies.length; ++t) i =
data.site.betStats[n.betStats.currencies[t]], i.count = n.betStats.counts[t],
i.payIn = n.betStats.payIns[t], i.payOut = n.betStats.payOuts[t], i.winCount =
n.betStats.winCounts[t];
pipe.events.betStatsUpdated && pipe.events.betStatsUpdated()
}
n.faucet !== undefined && (data.site.faucet = n.faucet,
pipe.events.faucetStatusUpdated && pipe.events.faucetStatusUpdated());
n.announcedBets && pipe.events.receivedAnnouncedBets &&
pipe.events.receivedAnnouncedBets(n.announcedBets);
n.lastRain && (data.site.lastRain = n.lastRain,
pipe.events.lastRainUpdated && pipe.events.lastRainUpdated())
}
},
disableBets: function() {
pipe.betsAllowed = !1
},
enableBets: function() {
pipe.betsAllowed = !0
}
}
};
processBet(betMode, baseBet);