Created
March 21, 2021 22:36
-
-
Save dsetzer/0189a78ad72e9b5a0f632cfe5233c7c7 to your computer and use it in GitHub Desktop.
Script wrapper for running bustabit scripts on ether-dice. This expects the bustabit script to be standard format where bets are placed at GAME_STARTING event. Scripts with everything in GAME_ENDED will skip endlessly. Also don't expect any Ruzli scripts to work, it's a miracle those run to begin with.
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
engine.bet=function(e,n){this.nextBet={value:e,target:n}},engine.getState=(()=>{}),engine.cashOut=(()=>{});const gameResultFromHash=()=>{},SHA256=()=>{};engine.history={first(){let e=engine.nextResult;if(e||(e=engine.getLastGamePlayed),e){let n={id:e.id,hash:e.hash,bust:e.crash};return["NOT_PLAYED","SKIPPED"].includes(engine.getLastGamePlay)||(n.wager=e.wager,e.cashout<=e.crash&&(n.cashedAt=e.cashout)),n}return{id:0,hash:"none",bust:0,wager:0,cashedAt:0}}};const log=console.log,stop=engine.stop,userInfo={get uname(){},get balance(){return engine.getBalance}};engine.on("script_started",()=>{setTimeout(async()=>{for(;;)engine.nextBet=null,engine.nextResult=null,await engine.emit("GAME_STARTING"),null!==engine.nextBet?(engine.emit("BET_PLACED",{uname:"temp",wager:engine.nextBet.value,payout:engine.nextBet.target}),engine.nextResult=await engine.placeBet(engine.nextBet.value,engine.nextBet.target)):engine.nextResult=await engine.skip(),engine.emit("GAME_STARTED"),"WON"===engine.getLastGamePlay&&engine.emit("CASHED_OUT",{uname:"temp",wager:engine.nextResult.wager,cashedAt:engine.nextResult.cashout}),engine.emit("GAME_ENDED"),await new Promise(e=>setTimeout(e,100))},1)}); | |
/* ------------------------- BEGIN BUSTABIT SCRIPT ----------------------- */ | |
// Place bustabit script here | |
/* ------------------------- END BUSTABIT SCRIPT ----------------------- */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment