Bitcoin Forum

Economy => Gambling discussion => Topic started by: revv on February 04, 2020, 03:45:28 PM



Title: Bustabit Sniper mode but with %?
Post by: revv on February 04, 2020, 03:45:28 PM
Is there a way to use Sniper mode script to follow someone but using a % of for the bets? Example the follower is betting 20000 I would like it to bet only 2% (400)...

If you can help me successfully do this I would greatly be appreciated might give you a reward.


Title: Re: Bustabit Sniper mode but with %?
Post by: koldf on February 04, 2020, 04:12:48 PM
Hey Rev, I might be able to write the script that does that for you.
Hit me up with a your telegram if you got one.


Title: Re: Bustabit Sniper mode but with %?
Post by: o_e_l_e_o on February 05, 2020, 09:20:29 AM
Is there a way to use Sniper mode script to follow someone but using a % of for the bets? Example the follower is betting 20000 I would like it to bet only 2% (400)...

If you can help me successfully do this I would greatly be appreciated might give you a reward.
This is easily done.

Open the default sniper mode script for editing on Bustabit.
Line 13 should look like this:
Code:
log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.');
"bet.wager / 100" is telling the script to take the target's bet in satoshis, divide it by 100, and use that as your bet in bits (which is the same value). If you change the 100, you will bet different proportions of the target's bet. You can think of the "100" as "100%" of the target's bet. If you want to only bet 2% of their bet, simply change the "100" to "2", save the script, and run it. Your code would now look like this:

Code:
log('Spotted', bet.uname, 'betting', bet.wager / 2, 'bit(s) with a', bet.payout + 'x payout.');


Title: Re: Bustabit Sniper mode but with %?
Post by: revv on February 05, 2020, 04:13:29 PM
I messed around with the value and seems to work only in simulation and only when I increase the value does it reduce the bet... when I try to run it live it just bets the same thing as the sniper


Title: Re: Bustabit Sniper mode but with %?
Post by: o_e_l_e_o on February 05, 2020, 04:30:16 PM
Oh, my bad. I was reading it all too quickly to even realize the line I had you change only changes the logs and not the actual bet. That's why it worked on simulation mode (which is what I tested it on), and not with real money. Instead of the above change, reset your script back to default and then make the following change below. This should then work with real money.

Line 16 should look like this:
Code:
const wager = Math.min(bettableBalance, bet.wager, config.maxBet.value);
Change "bet.wager" to "bet.wager / x", where x is the fraction of the target's bet you want to make. So for a 2% bet, your line would look like:
Code:
const wager = Math.min(bettableBalance, bet.wager / 50, config.maxBet.value);

Line 23 should look like this:
Code:
engine.bet(wager, bet.payout); // aim at target's payout
Change it to the following:
Code:
engine.bet(Math.floor(wager / 100) * 100, bet.payout); // aim at target's payout
This will round your number down to the nearest whole number of bits to stop you getting the "Bet is not a valid integer" error if your percentage chosen above results in a fraction of a bit.


Title: Re: Bustabit Sniper mode but with %?
Post by: o_e_l_e_o on February 07, 2020, 11:02:36 AM
I've edited the script a bit more. There are a few more changes, so I'll just post the entire code below for you to use if you want. It essentially does the exact same thing as above (pick a target, and bet a percentage of their bet rounded down to the nearest whole bit), but it gives you an input box under the "User to follow" and "Max Bet" input boxes where you input the percentage you want to use. Stops you having to go in to the script and edit it every time you want to adjust your percentage. Note that you are now picking the percentage you want, not the fraction. So if you want 2%, just type 2, rather than typing 50 as you had to do above. Should also work with decimal points if you want to go <1%. I've also updated the log so it tells you exactly how much you are betting each time. Enjoy.


Code:
var config = {
  target: { value: '', type: 'text', label: 'User to follow' },
  maxBet: { value: 1e8, type: 'balance', label: 'Max Bet' },
  percent: { value: 10, type: 'text', label: 'Percentage' }
};


engine.on('BET_PLACED', bet => {
  if (bet.uname.toLowerCase() === config.target.value.toLowerCase()) {
    if (userInfo.balance < 100) {
      stop('Your balance is too low to bet.');
    }

    const bettableBalance = Math.floor(userInfo.balance / 100) * 100;
    const wager = Math.min(bettableBalance, (bet.wager / 100) * config.percent.value, config.maxBet.value);

    log('Spotted', bet.uname, 'betting', bet.wager / 100, 'bit(s) with a', bet.payout + 'x payout.', config.percent.value + '% of', bet.wager / 100, 'bit(s) is', Math.floor(wager / 100), 'bit(s).');

        if (engine.gameState != 'GAME_STARTING') {
      // do not queue the bet if the current game is no longer accepting bets
      return;
    }

    engine.bet(Math.floor(wager / 100) * 100, bet.payout); // aim at target's payout
  }
});

engine.on('CASHED_OUT', cashOut => {
  if (cashOut.uname.toLowerCase() === config.target.value.toLowerCase()) {
    log('Spotted', cashOut.uname, 'cashing out at', cashOut.cashedAt + 'x.');

    if (engine.currentlyPlaying()) {
      engine.cashOut();
    }
  }
})


Title: Re: Bustabit Sniper mode but with %?
Post by: promonder on June 21, 2020, 09:13:14 PM
Oh, my bad. I was reading it all too quickly to even realize the line I had you change only changes the logs and not the actual bet. That's why it worked on simulation mode (which is what I tested it on), and not with real money. Instead of the above change, reset your script back to default and then make the following change below. This should then work with real money.

Line 16 should look like this:
Code:
const wager = Math.min(bettableBalance, bet.wager, config.maxBet.value);
Change "bet.wager" to "bet.wager / x", where x is the fraction of the target's bet you want to make. So for a 2% bet, your line would look like:
Code:
const wager = Math.min(bettableBalance, bet.wager / 50, config.maxBet.value);

Line 23 should look like this:
Code:
engine.bet(wager, bet.payout); // aim at target's payout
Change it to the following:
Code:
engine.bet(Math.floor(wager / 100) * 100, bet.payout); // aim at target's payout
This will round your number down to the nearest whole number of bits to stop you getting the "Bet is not a valid integer" error if your percentage chosen above results in a fraction of a bit.



I have an important question about my code and I only need the part that you mention because the error I am getting is:

08:04: Script stopped. Reason: "Bet is not a valid integer"

But I can't send you a direct message because my account is new but I can't copy here publicly either the code is Premium and it cost me money, I would like to know if you can send me a message, I am sure you can tell me where I should put that field when you see your code, or when you see the code you will know what is the error that has in that aspect

I thank you very much, sorry for my English I speak Spanish
I did not find where else to contact you