This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| simMode: { type: 'checkbox', label: 'Use Sim Mode', value: true }, | |
| skipRatio: { type: 'number', label: 'Skip Perc (%)', value: 75 }, | |
| payout: { type: 'multiplier', label: 'Target Payout', value: 2 }, | |
| }; | |
| Object.entries(config).forEach(c => window[c[0]] = eval(c[1].value)); | |
| let results = [], wins = 0, loses = 0, games = 0, hits = 0, misses = 0, plays = 0; | |
| if (simMode === true) { | |
| var simBalance = 1000000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| duration: { type: 'number', label: 'Duration (ms)', value: (1000 * 60 * 60)} // default = 1 hour | |
| }; | |
| // https://dsetzer.github.io/bustabit-script-simulator/ | |
| let games = 0, counts = config.duration.value, avgCounts = []; | |
| engine.on('GAME_ENDED', ()=>{ | |
| games++; | |
| if(userInfo.duration > counts){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| span: { label: 'Previous Games', type: 'number', value: '100' }, | |
| outh: { label: 'Include Hashes', type: 'checkbox', value: false }, | |
| ocsv: { label: 'Download CSV', type: 'checkbox', value: true} | |
| }; | |
| Object.entries(config).forEach((c) => window[c[0]] = c[1].value); | |
| let hashes = new Map(), lastGame = engine.history.first(); | |
| let currentId = lastGame.id, currentHash = lastGame.hash; | |
| let games = new Array(); | |
| function downloadString(text, fileName) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function npm(command){ | |
| child_process.exec(`npm ${command}`, (error, stdout, stderr) => { | |
| console.log(stdout); | |
| console.log(stderr); | |
| if (error !== null) console.log(`exec error: ${error}`); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| baseBet: { label: 'Base Bet', type: 'balance', value: 1000 }, | |
| minPayout: { label: 'Target Min', type: 'multiplier', value: 1.08 }, | |
| maxPayout: { label: 'Target Max', type: 'multiplier', value: 50.00 }, | |
| divPayout: { label: 'Target Div', type: 'multiplier', value: 0.80 }, | |
| compRate: { label: 'Compound %', type: 'multiplier', value: 0.02 }, | |
| compStep: { label: 'Compound At', type: 'multiplier', value: 1.10 }, | |
| betSpeed: { label: 'Bet Speed', type: 'multiplier', value: 100 }, | |
| simMode: { label: 'Sim Mode', type: 'checkbox', value: true }, | |
| simBal: { label: 'Sim Balance', type: 'balance', value: 1000000 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function cartesian(...args) { | |
| let r = [], max = args.length - 1; | |
| let step = (arr, i) => { | |
| for (let j = 0, l = args[i].length; j < l; j++) { | |
| let a = arr.slice(0); | |
| a.push(args[i][j]); | |
| if (i === max) r.push(a); else step(a, i + 1); | |
| } | |
| } | |
| step([], 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| span: { label: 'Previous Games', type: 'number', value: '100' }, | |
| outh: { label: 'Print Hashes', type: 'checkbox', value: false } | |
| }; | |
| Object.entries(config).forEach((c) => window[c[0]] = c[1].value); | |
| let hashes = new Map(), lastGame = engine.history.first(); | |
| let currentId = lastGame.id, currentHash = lastGame.hash; | |
| for(let i = currentId, result, len = currentId - span; i >= len; i--){ | |
| hashes.set(i, String(currentHash)); | |
| currentHash = SHA256((currentHash)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // borrowed from jQuery 1.7.2 | |
| var isNumeric = function(val){ | |
| return !isNaN(parseFloat(val)) && isFinite(val); | |
| }; | |
| /** | |
| * @author Larry Battle <http://bateru.com/news/contact-me> | |
| * @date May 16, 2012 | |
| * @license MIT and GPLv3 | |
| */ | |
| //decimalExpansion returns a string representation of a divided by b to a fixed length. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /************* INSTRUCTIONS ************* | |
| Place it into a script right below the config section at the top and it will replace | |
| the bet/skip function with mock functions which don't interact with the server. | |
| A few points to note: | |
| 1. Latency won't exist with these, and results are returned almost instantly, this | |
| could cause the browser to freeze up or make the script unobservable unless the | |
| script includes a sleep or bet delay function. For convenience there's one included | |
| but disabled by default, just enable the SIM_MODE_SLEEP setting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python3 | |
| ## NAME: duration.py | |
| ## USAGE: From shell prompt: python3 duration.py | |
| ## or within interactive python3 environment, import filename | |
| ## REQUIRED ARGUMENTS: none | |
| ## OPTIONS: none | |
| ## DESCRIPTION: Experiment to measure duration | |
| ## of random walk of n steps done k times each, | |
| ## starting from each value from ruin to victory, | |
| ## continuing until reaching either ruin or victory |