Documentation for Qbot stake.com : All programming is done in JavaScript. You're allowed to use all the features, which JavaScript offer you, in this editor. Variable and function names are case-sensitive! You can find example codes for all games in the sections below. Please note, that these are just examples to give you some inspiration and are not guaranteed to make profit! Variables The following variables are available in all games: game Type: string Required: true Possible values: baccarat, slots-samurai, diamonds, dice, dragon-tower, keno, limbo, mines, plinko, roulette, slots-scarab, slots-tomeoflife, wheel lastBet Type: object (read-only) fastMode Type: boolean (default: false) Use fast mode on your own risk! If turned on, bets will be made asynchronously, which means that when switching to normal mode, it can take some more bets until it completely finished all bets made in fast mode. Also we do not recommend using fast mode, when increasing bet size based on losses or wins. Only use this when you know what you're doing! lookupBetIds Type: boolean (default: false) Set this to true if you want the bot to lookup the bet IDs (casino:...). We recommend to only set this to true if it's really necessary for your strategy. currentStreak Type: integer (read-only) Positive on a win streak, negative on a loss streak. rollNumber Type: integer (read-only) balance Type: float (read-only) currency Type: string (read-only) conversionRates Type: object (read-only) USD conversion rates for all supported crypto currencies Example: (profit * conversionRates[currency]).toLocaleString("en-US", {style: "currency", currency: "USD"}) profit Type: float (read-only) highestProfit Type: float (read-only) lowestProfit Type: float (read-only) wagered Type: float (read-only) vaulted Type: float (read-only) wins Type: integer (read-only) losses Type: integer (read-only) rtp Type: float (read-only) Custom functions log(var1 [, var2, ..., varN]) Example: log(`Bet size: ${betSize}`) Example: log(lastBet) Example: log(balance, profit) Print information in the console tab. If the first argument is a HEX color code, this will be the color of the log message. Example: log('#eb4034', `Bet size: ${betSize}`) clearConsole() Clear messages in the console tab. notification(message [, type = 'info']) Example: notification('Profit target reached!', 'success') Possible values for the type variables are: error, success, warning, info (default) resetStats() Resets all statistics. Same behaviour, like when you click on the reset button in the statistics window. resetSeed() Creates a new server/client seed pair. chanceToMultiplier(chance) Example: chanceToMultiplier(49.5); // Returns 2 Converts chance from dice to multiplier. depositToVault(amount) Example: depositToVault(0.001); Deposits the given amount to the vault. Currently selected currency is used. playHitSound() Example: playHitSound(); Plays the currently configured hit sound. setSimulationBalance(amount) Example: setSimulationBalance(100); Sets the simulation balance (Q$ FUN). shuffle(array) Example: shuffledArray = shuffle([0, 1, 2, 3, 4]); // [3, 4, 1, 0, 2] Randomizes the order of the input array. Example code of the game dice : Variables betSize Type: float Required: true target Type: float Required: true betHigh Type: boolean Required: true lastBet example { "id": "XXXX-XXXX-XXXX-XXXX-XXXX", "iid": "casino:888888888", "rollNumber": 5, "nonce": 1027, "game": "dice", "win": true, "amount": 1, "payoutMultiplier": 2, "payout": 2, "currency": "eth", "dateTime": "2022-05-01T00:00:00.000Z", "deepLink": "https://stake.com/?betId=XXXX-XXXX-XXXX-XXXX-XXXX&modal=bet", "state": { "result": 87.54, "target": 50.5, "condition": "above" } } Code example Try out // Basic martingale example with stop on loss streak of 10 // resetStats(); // resetSeed(); game = 'dice'; betSize = 0.00000000; // Bet size is always specified in crypto value, not USD! initialBetSize = betSize; betHigh = true; target = chanceToMultiplier(49.5); engine.onBetPlaced((lastBet) => { if (currentStreak === -10) { log('Loss streak of 10 reached. Stopping...'); engine.stop(); } if (lastBet.win) { betSize = initialBetSize; } else { betSize *= 2; } }); engine.onBettingStopped((isManualStop) => { playHitSound(); log(`Betting stopped!`); });