Bitcoin Forum
May 09, 2024, 08:16:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bustabit Sniper mode but with %?  (Read 332 times)
revv (OP)
Newbie
*
Offline Offline

Activity: 100
Merit: 0


View Profile
February 04, 2020, 03:45:28 PM
 #1

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.
1715285805
Hero Member
*
Offline Offline

Posts: 1715285805

View Profile Personal Message (Offline)

Ignore
1715285805
Reply with quote  #2

1715285805
Report to moderator
1715285805
Hero Member
*
Offline Offline

Posts: 1715285805

View Profile Personal Message (Offline)

Ignore
1715285805
Reply with quote  #2

1715285805
Report to moderator
1715285805
Hero Member
*
Offline Offline

Posts: 1715285805

View Profile Personal Message (Offline)

Ignore
1715285805
Reply with quote  #2

1715285805
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715285805
Hero Member
*
Offline Offline

Posts: 1715285805

View Profile Personal Message (Offline)

Ignore
1715285805
Reply with quote  #2

1715285805
Report to moderator
koldf
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
February 04, 2020, 04:12:48 PM
 #2

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.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18510


View Profile
February 05, 2020, 09:20:29 AM
 #3

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.');
revv (OP)
Newbie
*
Offline Offline

Activity: 100
Merit: 0


View Profile
February 05, 2020, 04:13:29 PM
 #4

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
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18510


View Profile
February 05, 2020, 04:30:16 PM
Last edit: February 06, 2020, 08:33:37 PM by o_e_l_e_o
 #5

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.
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18510


View Profile
February 07, 2020, 11:02:36 AM
Last edit: February 07, 2020, 11:28:11 AM by o_e_l_e_o
 #6

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();
    }
  }
})
promonder
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 21, 2020, 09:13:14 PM
 #7

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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!