Last active
May 7, 2020 17:30
-
-
Save dsetzer/644cf28ef1f214f1a07fd46a2ca2970d to your computer and use it in GitHub Desktop.
Proof of concept Oscar's Grind script fully functional universal compatibility playable on both bustabit & bustadice as well as simulators no modification needed.
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 = { | |
| i: { type: 'noop', label: 'Oscar\'s Grind V2 Universal'}, | |
| a: { type: 'balance', label: 'Unit Size', value: 1000 }, | |
| c: { type: 'number', label: 'Bet Speed', value: 100 } | |
| }; | |
| Object.entries(config).forEach(c=>window[c[0]]=c[1].value); | |
| var dice = (()=>{try{engine==true;return !1;}catch(e){return !0;}})(); | |
| var sleep = t => new Promise(r => setTimeout(r, t)), b=1.98, d=a, e=0; | |
| var round = b => Math.max(100, Math.round(b / 100) * 100); | |
| var next = r => {r<b?e-=d:(e+=d,e<a&&(d=e+d+a>a?a-e:d+a),e>=a&&(e=0,d=a))}; | |
| if (dice) { | |
| this.stop = () => {}; | |
| (async () => { for(;;){ | |
| await this.bet(round(d), b).then(r=>next(r.multiplier)); | |
| await sleep(c); | |
| }})(); | |
| } else { | |
| engine.on('GAME_STARTING', ()=>{ | |
| engine.bet(round(d), b); | |
| }); | |
| engine.on('GAME_ENDED', ()=>{ | |
| let r = engine.history.first(); next(r.bust); | |
| }); | |
| } | |
| /* Copyright (c) 2019 Daniel Setzer. All rights reserved. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment