Skip to content

Instantly share code, notes, and snippets.

@dsetzer
Last active November 16, 2021 01:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save dsetzer/6d58e964c41dbdcb294f684a49dd1a23 to your computer and use it in GitHub Desktop.
Save dsetzer/6d58e964c41dbdcb294f684a49dd1a23 to your computer and use it in GitHub Desktop.
Run any bustabit v1 as-is script on the current bustabit v2, no modification necessary. (or any other script made for the old autobet API)
var config = {};
///////////////////// PLACE V1 SCRIPT INSIDE HERE /////////////////////
// RIGHT HERE
///////////////////// PLACE V1 SCRIPT INSIDE HERE /////////////////////
(e=>{e.placeBet=((a,t,s)=>{e.bet(a,parseFloat(t/100))}),
e.getMaxBet=(()=>userInfo.balance), e.getBalance=(()=>userInfo.balance),
e.getCurrentPayout=(()=>"IN_PROGRESS"!=e.gameState?null:100*e.bust),
e.lastGamePlayed=(()=>"NOT_PLAYED"!==e.lastGamePlay()),e.lastGamePlay=(()=>{
let a=e.history.first();return a.wager?a.cashedAt?"WON":"LOST":"NOT_PLAYED"
}),e.getEngine=e.getState,e.stop=stop,e.on("GAME_STARTING",()=>{
e._events.game_starting&&e.emit("game_starting",{game_id:e.gameId,time_till_start:5e3
})}),e.getUsername=(()=>userInfo.uname),e.on("GAME_STARTED",()=>{
e._events.game_started&&e.emit("game_started",e.playing)}),e.on("GAME_ENDED",()=>{
if(e._events.game_crash){let t=e.history.first(),s=parseInt(t.lastGameTick-t.startTime);
e.emit("game_crash",{elapsed:s,game_crash:100*t.bust,bonuses:0,hash:t.hash})}
}),e.on("CASHED_OUT",t=>{e._events.cashed_out&&e.emit("cashed_out",{username:t.uname,
amount:t.wager,stopped_at:100*t.cashedAt})}),e.on("BET_PLACED",a=>{
e._events.player_bet&&e.emit("player_bet",{username:a.uname,bet:a.wager})})})(engine);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment