Jump to content

Add stop on win this amount in script


Penthesilea
 Share

Recommended Posts

Hey guys

This script is from Provablefair.com.  Will someone be able to add a stop on winning this much into this script please?

 

var config = {
scriptTitle: {label: 'This script is from Provablefair.com', type: 'title'},
baseBet: { label: "base bet", value: 0.005, type: "number" },
payout: { label: "payout", value: 2, type: "number" },
stop: { label: "stop if next bet >", value: 100.001, type: "number" },
onLoseTitle: { label: "On Lose", type: "title" },
onLoss: {
label: "",
value: "increase",
type: "radio",
options: [
{ value: "reset", label: "Return to base bet" },
{ value: "increase", label: "Increase bet by (loss multiplier)" },
],
},
lossMultiplier: { label: "loss multiplier", value: 2, type: "number" },
onWinTitle: { label: "On Win", type: "title" },
onWin: {
label: "",
value: "increase",
type: "radio",
options: [
{ value: "reset", label: "Return to base bet" },
{ value: "increase", label: "Increase bet by (win multiplier)" },
],
},
winMultiplier: { label: "win multiplier", value: 0.5, type: "number" },
};
 
var runningbalance = currency.amount;
var ath = runningbalance;
var baseBet = config.baseBet.value;
 
function main() {
var currentBet = config.baseBet.value;
game.onBet = function () {
game.bet(currentBet, config.payout.value).then(function (payout) {
runningbalance -= currentBet;
if (payout > 1) {
var netwin = (currentBet*config.payout.value);
runningbalance += netwin;
 
if (config.onWin.value === "reset") {
currentBet = config.baseBet.value;
} else {
if (currentBet > baseBet*100) {
currentBet = baseBet;
} else {
currentBet *= config.winMultiplier.value;
}
}
log.success(
"We won, so next bet will be " +
currentBet +
" " +
currency.currencyName
);
} else {
if (config.onLoss.value === "reset") {
currentBet = config.baseBet.value;
} else {
currentBet *= config.lossMultiplier.value;
}
log.error(
"We lost, so next bet will be " +
currentBet +
" " +
currency.currencyName
);
}
if (runningbalance > ath) {
ath = runningbalance;
}
if (currentBet > config.stop.value) {
log.error(
"Was about to bet " + currentBet + " which triggers the stop"
);
game.stop();
}
if (currentBet < currency.minAmount) {
currentBet = currency.minAmount;
}
});
};

}

Link to comment
Share on other sites

You need to be a member in order to leave a comment

Sign up for a new account in our community. It's easy!

Register a new account

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...