Skip to content

Instantly share code, notes, and snippets.

@thaolt
Created April 16, 2022 22:19
Show Gist options
  • Save thaolt/4a4d7f721c93a5214e966fb68c500f63 to your computer and use it in GitHub Desktop.
Save thaolt/4a4d7f721c93a5214e966fb68c500f63 to your computer and use it in GitHub Desktop.
var config = {
baseBet: { label: "base bet", value: 0.00000006, type: "number" },
payout: { label: "payout", value: 3, type: "number" },
stop: { label: "stop if next bet >", value: 34, type: "number" },
wagerBet: { label: "wager bet", value: '0.00000006', type: "number" },
};
function main() {
var currentBet = config.baseBet.value;
var bet = currentBet + config.wagerBet.value;
var losses = 0;
var streak = 0;
var we = config.baseBet.value * (config.payout.value - 1);
game.onBet = function () {
game.bet(bet, config.payout.value).then(function (payout) {
if (payout > 1) {
currentBet = config.baseBet.value;
losses = 0;
streak = 1;
} else {
losses += currentBet;
streak += 1;
currentBet = (losses + (streak*we))/(config.payout.value - 1);
if (currentBet > config.stop.value) {
//stop loss
log.error(
"Was about to bet with payout " +
currentPayout +
" which triggers the stop"
);
game.stop();
}
}
bet = currentBet + config.wagerBet.value;
});
};
}
@dicer1505
Copy link

var config = {

settingTitle: { label: "Setting", type: "title" },
bet: { label: 'Bet', value: currency.minAmount, type: 'number' },
payout: { label: 'Payout', value: 1.4, type: 'number' },
stopLost: { label: 'Stop Lost', value: 999, type: 'number' },
takeProfit: { label: 'Take Profit', value: 100, type: 'number' }

}

function main() {
log.info("Start");
var bet = config.bet.value;
var mainPayout = config.payout.value;
var payout = config.payout.value;
var stopLost = config.stopLost.value;
var takeProfit = config.takeProfit.value;
var mainB = bet;
var loseS = 0;
var winS = 0;
var hb=0;
var ttw= 0;
var ttl = 0;
var k =0;
var Bbet = 0;
var profit = 0;
var profit2 = 0;
var winP = 0;
var randomNum = 0

game.onBet = function () {
	
	function multi1(min, max){
        return Math.floor(Math.random() * (max - min)) + min;
    };

	function rdn(min, max){
        return Math.floor(Math.random() * (max - min)) + min;
    };
	if(winS>=1){
		 var stchance = rdn(75, 95);
	}else{
		
	if(loseS<=20 && loseS>=4){
		var stchance=rdn(7,12)+ k;
	}else{
		if(loseS>=25){
			k+=2;
	  var stchance = rdn(75, 95);
		}else{
			stchance = rdn(55, 65)+k;
		};
	};
	};
	chance=99/stchance;	
	
    var multi2 = multi1(270, 320);
	multi=multi2/100;
	multi3=multi1(110, 117)/100;
// log.info("Bet: " + bet.toFixed(6) + " - PO: "+  payout.toFixed(2) + "x! " + " C-Profit: " + profit.toFixed(5)+ " T-Profit: " + profit2.toFixed(4)  );
    game.bet(bet, chance).then(function (payout) {
		
        if (payout > 0.1) {
			 loseS = 0;
            winS += 1;
			//payout=(Math.random() * 1)+1;
            winP = ((bet * payout) -bet);
            profit += winP;
			profit2 += winP;
				if (profit>=(0)){
					profit=0;
				k=0;

					bet=config.bet.value;
				}else{
                               
					bet=bet*1.1 + config.bet.value;
				};
				
			
				
			log.info("Bet: " + bet.toFixed(6) + " - PO: "+  payout.toFixed(2) + "x! " + " C-Profit: " + profit.toFixed(5)+ " T-Profit: " + profit2.toFixed(4)  );
            //log.success("We won " + winP.toFixed(6) + ", payout " + payout.toFixed(2) + "X! " + "Profit: " + profit.toFixed(6) );
           
    if (profit <= stopLost*(-1) || profit2 >= takeProfit ) {
		log.success("Targeted : " + profit2.toFixed(6) );
        game.stop();
    }
         
         //   log.info("Win streak: " + winS + " time!");

        } else {
			
            lostP = (bet)*-1;
			profit += lostP;
            profit2 += lostP;
            winS = 0;
            loseS += 1;
             if (ttl>=loseS){
			   ttl=ttl;
		   }else{
			   ttl=loseS;
		   };
					if (loseS<=20 && loseS>=4){
							
							bet=bet*multi3;
					}else{

							bet=bet*multi;		
					};
           
               
            //log.error("We lost " + lostP.toFixed(6) + ", payout " + payout.toFixed(2) + "X! " + "Profit: " + profit.toFixed(6) );
           log.info("Lose streak: " + loseS + " Max Streak : " + ttl);
           
        };
		   if (hb>=bet){
			   hb=hb;
		   }else{
			   hb=bet;
			   
		   };
		   log.info("Win streak: " + winS );
	log.info("Lose Streak: " + loseS);
	log.info("Chance: " + stchance);
	log.info("High Bet: " + hb.toFixed(8));
    });

}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment