const baseBet = 1 const increaseOnLoss = 1.11327 const increaseOnRetart = 1.15 const startCashout = 20 const decreaseOnLoss = 1 const lowestCashout = 5 //------------------------------------------ let currentBet = baseBet let cashOut = startCashout let lc = 0 //------------------------------------------ const main = async () => { await this.log("starting script"); // script logic here, e.g.: while (true) { const { multiplier } = await this.bet(Math.round(currentBet)*100, Math.round(cashOut*100)/100) if (multiplier < cashOut){ if (cashOut > lowestCashout){ cashOut -= decreaseOnLoss currentBet *= increaseOnLoss }else{ cashOut = startCashout currentBet *= increaseOnRetart } }else{ cashOut = startCashout currentBet = baseBet } this.clearLog() this.log(`Current bet = ${Math.round(currentBet)}`) this.log(`Current cashOut = ${Math.round(cashOut*100)/100}`) } } while (true) { try { await main(); } catch (error) { if (error.message === "connection closed") { await this.log("connection closed. restarting script"); continue; } else { throw error; } } }