UNPKG

mubot-bustabit

Version:
71 lines (53 loc) 2.08 kB
# Setup 0.) Change the line `if (engine.getEngine().playerInfo.leathan) ` to include `playerInfo.YOUR_BUSTABIT_USER` 1.) When you log in to bustabit.com select the "AUTO" tab, then at the 2.) bottom right click the "autobet" button and select "custom" 3.) select everything inside the text area and delete it 4.) copy paste the entire contents of this github code text into that text field and click run 5.) If your mubot is running on your local machine all should be working 6.) If you are running the scripts on a server (not localhost) Edit this line `SERVER = 'http://localhost:8080/'` 7.) Since bustabit uses https if your localhost does not have https enabled you need to allow insecure scripts while on bustabit.com. # INIT ```var bet = {};``` # CHECK MUBOT SERVER FOR BET ```javascript var SERVER = 'http://localhost:8080/' function CheckBet () { xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", SERVER + 'bustabit/getbet', true); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { bet = JSON.parse(this.responseText); if (bet.size) { engine.placeBet(bet.size*100, parseInt(bet.ratio*100), false); } } }; xmlhttp.send(); } ``` # UPDATE THE MUBOT SERVER WITH INFORMATION ```javascript var SERVER = 'http://localhost:8080/' const USER = 'leathan' function updateServer(params) { var http = new XMLHttpRequest(); http.open("POST", SERVER + 'bustabit/finished', true); http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http.send(params); } engine.on('game_crash', function(data) { // Change this line to your Bustabit user. if (engine.getEngine().playerInfo.USER) { var win = false; if (engine.getEngine().playerInfo.leathan.stopped_at) { win = true } updateServer('game_crash='+data.game_crash+'&balance='+engine.getBalance()+'&win='+win) } CheckBet(); }); engine.on('cashed_out', function(resp) { if (resp.username == engine.getUsername()) { updateServer('win=true&balance='+engine.getBalance()) } }); ```