Hello Guest

Help with resetting after 3 wins (in a row?)

  • 6 Replies
  • 2102 Views
*

bayar

  • *
  • 1
  • +0/-0
    • View Profile
Help with resetting after 3 wins (in a row?)
« on: April 21, 2018, 08:13:11 pm »
HELLO
I had tried to add in this script
Winnumb = 0
if win number >3 then next bet=basebet but it does not work correctly pls help me
Code: [Select]
math.randomseed(os.time()) -- sets random seed using system time

-- set basebet and chance according to your requirements
basebet = 0.00000001
chance = 43.130 -- 2.3x payout on Crypto-Games.net
balancetarget = 0.0001 -- Script will stop if balance greater than this value

if (math.random(100) >= 50) then
  bethigh = true
else
  bethigh = false
end

nextbet = basebet

function dobet()

  if (win) then
    -- reverse martingale
    nextbet = previousbet * 1.9
  else
    -- revert to base
    nextbet = basebet
  end 

  if (math.random(100) >= 50) then
    bethigh = true
  else
    bethigh = false
  end

  if balance > balancetarget then
    nextbet = 0
    stop()
  end

end
« Last Edit: April 21, 2018, 09:18:27 pm by bayar »

*

Krypton

  • **
  • 19
  • +0/-0
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #1 on: April 23, 2018, 07:31:56 am »
Check this ... I have not tested it   ... it  will just give you an idea ... hope it helps

if (win) then
   Winnumb =Winnumb +1
   if Winnumb > 3 then
      nextbet=basebet
   else
           nextbet = previousbet * 1.9      
   end
  else
    nextbet = basebet
    Winnumb =0
  end 

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #2 on: May 09, 2018, 12:59:17 pm »
The currentstreak variable is your current winning (+) or losing (-) streak. For example, when currentstreak is 3, you have won 3 bets in a row, if it is -4, you have lost 4 bets in a row.
Alternatively, there's the wins variable, which is the total number of wins you've had since starting the bot or since you last reset your stats.

You can use the modulus operator to determine when something is a factor of something else, for example

Code: [Select]
if currentstreak%3==0 and win then
--this will execute after EVERY 3 winning bets in a row, so after 3 in a row, 6 in a row, 9 in a row etc
end
if currentstreak==3 then
--this will execute after exactly 3 wins in a row
end
if wins%3==0 and win then
--after every 3 wins, regardless of whether they are in a streak or not
end
if wins == 3 then
--after you've won exactly 3 bets and then never again
end

*

ak47

  • **
  • 26
  • +0/-0
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #3 on: June 21, 2018, 06:33:46 pm »
Please write all these for LOSE also, like if after 3 losses, regardless of whether they are in a streak or not

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #4 on: June 21, 2018, 11:45:03 pm »
Literally just replace the word wins with losses. Or check that the bet is not a win instead of checking that it is a win. Coding is just like talking with more structure. Just think about it.

*

ak47

  • **
  • 26
  • +0/-0
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #5 on: June 24, 2018, 10:07:06 am »
!win means loss?

*

Seuntjie

  • *****
  • 138
  • +0/-1
    • View Profile
Re: Help with resetting after 3 wins (in a row?)
« Reply #6 on: June 24, 2018, 02:00:36 pm »
! means not, or opposite.
win is a boolean. When it is true, it's a win, when it's false, it's a loss.

!win means not win, or opposite of win. so yes, when !win is used to check if a bet is a loss.