Bitcoin Forum
April 26, 2024, 12:58:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 [13] 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 125126 times)
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 26, 2016, 03:32:03 AM
 #241

What's the difference between the following variables?

Profit
currentprofit
tmpprofit

  At the top of the code tab, in programmer mode, there is a list of available variables.  profit and curentprofit are listed there.  That is a list of variables already defined for your script.  RO can only be referenced RW can be changed. 

  I believe profit is your current session profit from the last resetstat call.  currentprofit is the profit from the last bet.  both could be + or -. 

tmpprofit is not used by the bot, but could be defined in your script.    a lot of time you may want to do something till you hit a set profit.  At the beginning of you script you could have tmpprofit += currentprofit. 

That would now keep a running total of you profit since tmpprofit was set.  Later you might check, if (tmpprofit > 4) then withdraw 3 and tmpprofit = 0.  Setting tmpprofit to zero starts your profit calculation over.   



So if I were to have


if currentprofit=-0.00000050 then


it would mean that once I have a negative value of 50 satoshi I would want the script to do something?

if currentprofit == -0.000000050 then       <----   This is saying check the last bets profit and if it's equal to -50 satoshi's then do something.   

(notice the double equal signs, you want to tell LUA this is a compare and not an assignment)

I normally have resetstats() above the function dobet()  Then you could have

if profit == -0.00000050 then

    To do something if my profit for this session has dropped to -50 satoshi's

so...

currentprofit  is the last bets profit and
profit is the sessions profit

1714093112
Hero Member
*
Offline Offline

Posts: 1714093112

View Profile Personal Message (Offline)

Ignore
1714093112
Reply with quote  #2

1714093112
Report to moderator
1714093112
Hero Member
*
Offline Offline

Posts: 1714093112

View Profile Personal Message (Offline)

Ignore
1714093112
Reply with quote  #2

1714093112
Report to moderator
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
August 26, 2016, 06:08:24 AM
Last edit: August 26, 2016, 06:39:49 AM by seuntjie
 #242

What's the difference between the following variables?

Profit
currentprofit
tmpprofit


I came across the following code many pages back.

------------------------------

chance=77.7
multiplier=1.5
multiplier2=0.92
base=0.0000150
nextbet = base  
bethigh = false
target = .00005
investtarget = .001
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false

function dobet()

tmpprofit += currentprofit
investprofit += currentprofit

   if win then
      if (tmpprofit > target) then
         tmpprofit = 0
         nextbet = base
         if(stopnow) then stop() end
         if(investprofit  > investtarget ) then
             investprofit = 0
             invest(investtarget)
         end      
      else
         nextbet=previousbet*multiplier2
         if(nextbet < base) then nextbet = base end
      end
   else
      nextbet=previousbet*multiplier
      if(nextbet < base) then nextbet = base end
   end
end

If only there were some kind of online resource that you could read that explained variables in DiceBot....

Oh, wait:

Edit: Sorry, I know the sarcasm isn't necessary, I just get annoyed that I create the resources and post them, but it gets ignored. A lot of your questions could have been answered if you read through the articles and referenced them when you had a problem. For example that a single = is assignment and double = (==) is a comparison, as explained in the third tutorial on steemit.

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 26, 2016, 02:29:58 PM
 #243

What's the difference between the following variables?

Profit
currentprofit
tmpprofit

  At the top of the code tab, in programmer mode, there is a list of available variables.  profit and curentprofit are listed there.  That is a list of variables already defined for your script.  RO can only be referenced RW can be changed. 

  I believe profit is your current session profit from the last resetstat call.  currentprofit is the profit from the last bet.  both could be + or -. 

tmpprofit is not used by the bot, but could be defined in your script.    a lot of time you may want to do something till you hit a set profit.  At the beginning of you script you could have tmpprofit += currentprofit. 

That would now keep a running total of you profit since tmpprofit was set.  Later you might check, if (tmpprofit > 4) then withdraw 3 and tmpprofit = 0.  Setting tmpprofit to zero starts your profit calculation over.   



So if I were to have


if currentprofit=-0.00000050 then


it would mean that once I have a negative value of 50 satoshi I would want the script to do something?

if currentprofit == -0.000000050 then       <----   This is saying check the last bets profit and if it's equal to -50 satoshi's then do something.   

(notice the double equal signs, you want to tell LUA this is a compare and not an assignment)

I normally have resetstats() above the function dobet()  Then you could have

if profit == -0.00000050 then

    To do something if my profit for this session has dropped to -50 satoshi's

so...

currentprofit  is the last bets profit and
profit is the sessions profit

Thanks to your help I think that I nearly go it.

Would you have any idea why it's throwing me that Error?

LUA ERROR!!
primary expression expected, got 'then'


chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base 
bethigh = true
resetstats()
function dobet()

if win then
   nextbet=previousbet then
   Nextbet = base
end     
 
else
      nextbet=previousbet*multiplier
      if currentstreak==2 then nextbet = base end
   
 end
    
 else
     if currentprofit=-0.00000050 then
     if currentstreak==-1 then
     if win then next bet = basebet  end
     end
    
end
end

   I think you need to rethink your script. 

There are 2 flavors of the "if" statement. 

if (xyz) then
end

and

if (xyz) then
else
end


in you script you have

if win then
   nextbet=previousbet then
   Nextbet = base
end     
 
else

      Lua and I are both confused about what the else is.  Since you have an end for the first if, the else is just dangling out there. 

If you removed that first end after the first if, Lua would handle that first else, but then the next else would fail.   But at this point I'm lost as to what your trying to do. 

You may be missing the fact you can combine checks on 1 if statement so maybe

          if currentprofit=-0.00000050 then
     if currentstreak==-1 then
     if win then next bet = basebet  end
     end
should be
         if (currentprofit = -0.00000050 and currentstreak = -1 and win = true) then
              nextbet = basebet
         end

There is also a logical error.  you can never have currentprofit and currentstreak negative, and still win. 

   
since you can't go back and see what happened before, you can create a new variable, and set it when you reach your limit. Then in the win path when that variable is set you can reset the nextbet. 

 

Cyrax89721
Sr. Member
****
Offline Offline

Activity: 321
Merit: 250



View Profile
August 27, 2016, 01:35:01 PM
 #244

Looking for some help to clean up my code since it's not working like I want it to.  What I'm trying to write is a basic martingale bot for a 1.5x method that doubles on loss, but then repeats the last bet after a win.  Example of what I'm trying to accomplish here.

Code:
chance = 65
enablesrc=true
percentage=0.01
multiplier=2
base = balance*(percentage/100)
basebet = balance*(percentage/100)
nextbet = base
bethigh = false

function dobet()

    if win then
nextbet = previousbet

if win then
nextbet = basebet
else
nextbet = previousbet*multiplier
end
else
nextbet = previousbet*multiplier
end
end

The double on loss works fine, but it keeps resetting to the base bet after the first win.  Why is the "nextbet=previousbet" part not functioning like I want it to?

Also, setting my base bet as a percentage of my balance only does so at the start of running the script.  It doesn't refresh after every cycle like I want it to.  Any ideas if there's a fix for this too?
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 27, 2016, 02:47:20 PM
 #245

Looking for some help to clean up my code since it's not working like I want it to.  What I'm trying to write is a basic martingale bot for a 1.5x method that doubles on loss, but then repeats the last bet after a win.  Example of what I'm trying to accomplish here.

Code:
chance = 65
enablesrc=true
percentage=0.01
multiplier=2
base = balance*(percentage/100)
basebet = balance*(percentage/100)
nextbet = base
bethigh = false

function dobet()

    if win then
nextbet = previousbet

if win then
nextbet = basebet
else
nextbet = previousbet*multiplier
end
else
nextbet = previousbet*multiplier
end
end

The double on loss works fine, but it keeps resetting to the base bet after the first win.  Why is the "nextbet=previousbet" part not functioning like I want it to?

Also, setting my base bet as a percentage of my balance only does so at the start of running the script.  It doesn't refresh after every cycle like I want it to.  Any ideas if there's a fix for this too?

   Your second if win statement is redundant.    So on a win your script first sets nextbet to the previousbet and then sets it to the base bet.  The else leg of that second if will never execute.  If the bet won based on the first if statement it will always be a win in the second. 

   I think you want to change the second "if win" to "if currentstreak == 2 then" and get rid of the else path.  That way on the first win currentstreak will be 1, and you will have set nextbet to the previousbet.  But when you have 2 wins in a row it will bet the basebet.   

as far as resetting the basebet based on balance.  What point do you want to do that?  after 1 win, only after 2 wins, or after more then 1 win.      You would just copy your setting from above, and either put it after nextbet = previousbet  if you want it for any win.  Or after the nextbet = basebet in the second if statement, if you want it only after 2 wins in a row.  If you want it after 2 or more wins.  you could change the second if statement to check "if currentstreak > 1"  that will cause that to execute each time you have more then 1 win in a row.

This is what I think your going for. 

Code:
chance = 65
enablesrc=true
percentage=0.01
multiplier=2
base = balance*(percentage/100)
basebet = balance*(percentage/100)
nextbet = base
bethigh = false

function dobet()

    if win then
nextbet = previousbet

if (currentstreak > 1)then
                        basebet = balance*(percentage/100)     // if you put this here it updates basebet before setting nextbet
nextbet = basebet                              //  if you move it after here, nextbet is still the old value, but the next time it will be updated
        end
else
nextbet = previousbet*multiplier
end
end

Cyrax89721
Sr. Member
****
Offline Offline

Activity: 321
Merit: 250



View Profile
August 27, 2016, 03:20:43 PM
 #246

Your second if win statement is redundant.    So on a win your script first sets nextbet to the previousbet and then sets it to the base bet.  The else leg of that second if will never execute.  If the bet won based on the first if statement it will always be a win in the second. 

   I think you want to change the second "if win" to "if currentstreak == 2 then" and get rid of the else path.  That way on the first win currentstreak will be 1, and you will have set nextbet to the previousbet.  But when you have 2 wins in a row it will bet the basebet.   

as far as resetting the basebet based on balance.  What point do you want to do that?  after 1 win, only after 2 wins, or after more then 1 win.      You would just copy your setting from above, and either put it after nextbet = previousbet  if you want it for any win.  Or after the nextbet = basebet in the second if statement, if you want it only after 2 wins in a row.  If you want it after 2 or more wins.  you could change the second if statement to check "if currentstreak > 1"  that will cause that to execute each time you have more then 1 win in a row.

Ok, I thought the redundancy was necessary to execute the bet a second time.  I kind of figured that 'currentstreak' command had to be in there somewhere but wasn't quite sure where.  Shows how much of a programmer I am...  Tongue  The percentage thing was a head-scratcher for me, and your solution is stupid easy.  Your updated script is exactly what I was looking for though, thank you!
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
August 27, 2016, 04:37:53 PM
 #247

Your second if win statement is redundant.    So on a win your script first sets nextbet to the previousbet and then sets it to the base bet.  The else leg of that second if will never execute.  If the bet won based on the first if statement it will always be a win in the second. 

   I think you want to change the second "if win" to "if currentstreak == 2 then" and get rid of the else path.  That way on the first win currentstreak will be 1, and you will have set nextbet to the previousbet.  But when you have 2 wins in a row it will bet the basebet.   

as far as resetting the basebet based on balance.  What point do you want to do that?  after 1 win, only after 2 wins, or after more then 1 win.      You would just copy your setting from above, and either put it after nextbet = previousbet  if you want it for any win.  Or after the nextbet = basebet in the second if statement, if you want it only after 2 wins in a row.  If you want it after 2 or more wins.  you could change the second if statement to check "if currentstreak > 1"  that will cause that to execute each time you have more then 1 win in a row.

Ok, I thought the redundancy was necessary to execute the bet a second time.  I kind of figured that 'currentstreak' command had to be in there somewhere but wasn't quite sure where.  Shows how much of a programmer I am...  Tongue  The percentage thing was a head-scratcher for me, and your solution is stupid easy.  Your updated script is exactly what I was looking for though, thank you!

You don't need to use the programmer mode for this. You can use the advanced mode. If you un-tick the "reset to base bet after first win" option and set the bot to "after 2 wins, change bet to xxx" you could have had the same functionality.

Cyrax89721
Sr. Member
****
Offline Offline

Activity: 321
Merit: 250



View Profile
August 27, 2016, 05:50:26 PM
 #248

Your second if win statement is redundant.    So on a win your script first sets nextbet to the previousbet and then sets it to the base bet.  The else leg of that second if will never execute.  If the bet won based on the first if statement it will always be a win in the second. 

   I think you want to change the second "if win" to "if currentstreak == 2 then" and get rid of the else path.  That way on the first win currentstreak will be 1, and you will have set nextbet to the previousbet.  But when you have 2 wins in a row it will bet the basebet.   

as far as resetting the basebet based on balance.  What point do you want to do that?  after 1 win, only after 2 wins, or after more then 1 win.      You would just copy your setting from above, and either put it after nextbet = previousbet  if you want it for any win.  Or after the nextbet = basebet in the second if statement, if you want it only after 2 wins in a row.  If you want it after 2 or more wins.  you could change the second if statement to check "if currentstreak > 1"  that will cause that to execute each time you have more then 1 win in a row.

Ok, I thought the redundancy was necessary to execute the bet a second time.  I kind of figured that 'currentstreak' command had to be in there somewhere but wasn't quite sure where.  Shows how much of a programmer I am...  Tongue  The percentage thing was a head-scratcher for me, and your solution is stupid easy.  Your updated script is exactly what I was looking for though, thank you!

You don't need to use the programmer mode for this. You can use the advanced mode. If you un-tick the "reset to base bet after first win" option and set the bot to "after 2 wins, change bet to xxx" you could have had the same functionality.

But this doesn't allow the base bet to be a percentage of my balance, unless I can put code into the "after 2 wins..." box?  Another question for programmer mode; is there a sort of "stop on win" command that stops betting after the current cycle is finished instead of a dead 'stop()' in the middle of the cycle?
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
August 27, 2016, 08:30:24 PM
 #249

Your second if win statement is redundant.    So on a win your script first sets nextbet to the previousbet and then sets it to the base bet.  The else leg of that second if will never execute.  If the bet won based on the first if statement it will always be a win in the second. 

   I think you want to change the second "if win" to "if currentstreak == 2 then" and get rid of the else path.  That way on the first win currentstreak will be 1, and you will have set nextbet to the previousbet.  But when you have 2 wins in a row it will bet the basebet.   

as far as resetting the basebet based on balance.  What point do you want to do that?  after 1 win, only after 2 wins, or after more then 1 win.      You would just copy your setting from above, and either put it after nextbet = previousbet  if you want it for any win.  Or after the nextbet = basebet in the second if statement, if you want it only after 2 wins in a row.  If you want it after 2 or more wins.  you could change the second if statement to check "if currentstreak > 1"  that will cause that to execute each time you have more then 1 win in a row.

Ok, I thought the redundancy was necessary to execute the bet a second time.  I kind of figured that 'currentstreak' command had to be in there somewhere but wasn't quite sure where.  Shows how much of a programmer I am...  Tongue  The percentage thing was a head-scratcher for me, and your solution is stupid easy.  Your updated script is exactly what I was looking for though, thank you!

You don't need to use the programmer mode for this. You can use the advanced mode. If you un-tick the "reset to base bet after first win" option and set the bot to "after 2 wins, change bet to xxx" you could have had the same functionality.

But this doesn't allow the base bet to be a percentage of my balance, unless I can put code into the "after 2 wins..." box?  Another question for programmer mode; is there a sort of "stop on win" command that stops betting after the current cycle is finished instead of a dead 'stop()' in the middle of the cycle?

Oh right, now. Sorry I didn't see the percentage base bet thing. There's only the stop command, you'll have to write your own stop on win function. You can do it the same way as the bot does it. Have a stop on win variable that's set to false. If you want to stop on win, set it to true, then if both win and stop on win is true, stop.

Lanzador
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
August 28, 2016, 01:55:01 AM
 #250

Has anyone ever made a script that is sort of a random martingale? E.g. after every win, it selects a new bet multiplier and return?

e.g. runs on a 2x return with a bet multiplier of 2.5
then after its first win, runs on a 4x return with a 1.4x bet multiplier?
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 28, 2016, 02:53:28 PM
 #251

(wincount == 2 and previousbet != basebet)

What does the "!" mean ?



chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
go = false
set = false


function dobet()


if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance

   
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = nextwinbet
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
    if (wincount == 2) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end

! is NOT.  So !=  means not equal.  That is when comparing.  You can also use it to flip a true/false value.  bethigh = !bethigh  changes bethigh from whatever it is to the other.  so low -> high or high -> low.

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 29, 2016, 08:24:09 PM
 #252

I'm trying to modify a script to debug my script that I'm basing my script off.

This is the orignal script.

chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
go = false
set = false


function dobet()


if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = nextwinbet
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and currentprofit = <-0.00000050 previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti  
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
    if (wincount == 2) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
      
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
  
end

------------------------------------

The following is my script.

I get the following error when I run it.

LUA ERROR!!
primary expression expected, got 'then'


chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base  
wincount = 0
losecount = 0
totallose = 0
resetstats = false
function dobet()

if (win) then
   wincount += 1
    totallose = 0
   nextbet=previousbet then
   Nextbet = base  
   newbalance = balance
   
else

   wincount = 0
    totallose += 1
   nextbet=previousbet*multiplier  
   
end

      if (wincount == 2 and currentprofit = <-0.00000050 and losecount = <5) then
      if win nextbet = basebet end and                                                                         <-----  No then statement
      resetstats = true
      end
      end
      
else      
      
         if (losecount == >5 and currentprofit = >-0.00000050)  then
         if win  nextbet = basebet end and                                                                              <-----  No then statement
       resetstats = true
         end

      
end   

     
end
end


--------------------------------------------------
This is my progress so far in modifying the script to debug mine.


Why do I have this error?

LUA ERROR!!
')' expected, got '='




chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti


function dobet()


if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
  if (wincount == 1) then
     nextbet = basebet

  end

   if (wincount == 2 and currentprofit = <-0.00000050 and losecount += 5) then         <-----  I don't think += is valid for a compare
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti  
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
    if (wincount == 2) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
      
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
  
end








    See above in red

seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
August 30, 2016, 07:51:47 AM
 #253

LUA ERROR!!
')' expected, got '='

Code:
chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base
wincount = 0
losecount = 0
resetstats = false
function dobet()

if (win) then
   wincount += 1
   nextbet=previousbet
else
   losecount += 1
   nextbet=previousbet*multiplier    
end
      if (wincount == 2  and currentprofit = <-0.00000050 and losecount= <5) then
      if (win nextbet = basebet)
end and then                                                                    
      resetstats = true
else    
         if (losecount == >5 and currentprofit = >-0.00000050)  then
         if (win  nextbet = basebet) end and  then                                                                          
       resetstats = true
         end            
end
end

Please start using the code box. Valid operators for ifs:
Equals ==
Not equals !=
larger than >
smaller than <
larger or equals to >=
small or equals to <=

Programming is consistent. even though it looks mostly the same = and == does not do the same thing. >= and => does not do the same thing (in fact the one works and the other doesn't). it's extremely important to be consistent with your code otherwise it won't work. Not just with the operators, if you're using variables and it has a capital letter in one place but not in the other, it's two separate variables.

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 30, 2016, 02:24:38 PM
 #254

LUA ERROR!!
')' expected, got '='

Code:
chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base
wincount = 0
losecount = 0
resetstats = false
function dobet()

if (win) then
   wincount += 1
   nextbet=previousbet
else
   losecount += 1
   nextbet=previousbet*multiplier    
end
      if (wincount == 2  and currentprofit = <-0.00000050 and losecount= <5) then
      if (win nextbet = basebet)
end and then                                                                    
      resetstats = true
else    
         if (losecount == >5 and currentprofit = >-0.00000050)  then
         if (win  nextbet = basebet) end and  then                                                                          
       resetstats = true
         end            
end
end

Please start using the code box. Valid operators for ifs:
Equals ==
Not equals !=
larger than >
smaller than <
larger or equals to >=
small or equals to <=

Programming is consistent. even though it looks mostly the same = and == does not do the same thing. >= and => does not do the same thing (in fact the one works and the other doesn't). it's extremely important to be consistent with your code otherwise it won't work. Not just with the operators, if you're using variables and it has a capital letter in one place but not in the other, it's two separate variables.

the script now fires up in a unexpected way. Yet I think I know how to fix  this error.



If your code is close to the above code, I think I know what the problem is.  I'll give you a hint.  Your checking if wincount ==2.  if you don't reset that, it will only equal 2 once.  

cypher21
Hero Member
*****
Offline Offline

Activity: 854
Merit: 503


View Profile
August 30, 2016, 03:45:28 PM
 #255

anybody program the labouchere?
want to optimize it.
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 30, 2016, 07:43:21 PM
 #256

LUA ERROR!!
')' expected, got '='

Code:
chance=49.5
multiplier=2.0
base=0.00000001
nextbet = base
wincount = 0
losecount = 0
resetstats = false
function dobet()

if (win) then
   wincount += 1
   nextbet=previousbet
else
   losecount += 1
   nextbet=previousbet*multiplier    
end
      if (wincount == 2  and currentprofit = <-0.00000050 and losecount= <5) then
      if (win nextbet = basebet)
end and then                                                                    
      resetstats = true
else    
         if (losecount == >5 and currentprofit = >-0.00000050)  then
         if (win  nextbet = basebet) end and  then                                                                          
       resetstats = true
         end            
end
end

Please start using the code box. Valid operators for ifs:
Equals ==
Not equals !=
larger than >
smaller than <
larger or equals to >=
small or equals to <=

Programming is consistent. even though it looks mostly the same = and == does not do the same thing. >= and => does not do the same thing (in fact the one works and the other doesn't). it's extremely important to be consistent with your code otherwise it won't work. Not just with the operators, if you're using variables and it has a capital letter in one place but not in the other, it's two separate variables.

the script now fires up in a unexpected way. Yet I think I know how to fix  this error.



If your code is close to the above code, I think I know what the problem is.  I'll give you a hint.  Your checking if wincount ==2.  if you don't reset that, it will only equal 2 once.  

You're talking about resetcount ?

    Not sure what resetcount is.  It's not mentioned in your script.  I'm talking about setting wincount equal to 0 at some point.  IE, reset the counter, otherwise it will increment forever.  Maybe you want to reset the wincount in the loss path.  so
Code:

if win then             // IF winner
   wincount += 1
else                     // Else Loser   
   wincount = 0
end




Also you have resetstats = true.  I don't know if that does anything or not.  But, you just put a line with resetstats() and that will actually reset your stats.  

resetstats is listed under the methods/calls list.  Those are actual calls to other functions.  You code (type) the function name followed by any parms in parens.  () just means there are no parms.  It can be confusing, but your almost there.  

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
August 30, 2016, 09:38:05 PM
 #257

I'm trying to set up my script so that

I keep on betting 0.00000001 until I lose.
After that it doubles my bet until I win two times in a row under 0.00000050.

If I win twice in a row under =0.00000050 I would go back to 0.00000001 .


If I don't win twice in a row  under 0.00000050 then I want to win exactly ONCE over 0.00000050 .

My major issue with my scripts is that the only way I'm able to return to 0.00000001 after rolling over 0.00000050, is that I end up having to win Twice in a row,instead of winning a single time in a row.



   If you think about it logically.  If you win then,  if the previousbet is greater then .00000050 then set the nextbet equal to the base bet.  Else (if the previousbet is less then .00000050) you make nextbet equal to previousbet. 

This is how I would code it.

Code:

if (win) then
   wincount += 1
   if (previousbet < 0.00000050 and wincount != 2) then   -- only  try again if the last bet is under 50 and this is not the second win in a row
      nextbet=previousbet
   else
      nextbet = basebet
   end
else
   wincount = 0
   losecount += 1
   nextbet=previousbet*multiplier     
end


     if you wanted to stop a loosing streak, I would add something on the  loss side of that if statement. 

 

BigMat
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
August 31, 2016, 10:36:59 PM
 #258

I want to set automatic my strategy, but i have one problem, the base bet is 0.00000001 and chance 42%. When hit 6 lose streak the base bet change to 0.00000100, and if i lose again, and hit 7 lose streak, the base bet reset to 0.00000001 and the next 6 lose streak the base bet will change to 0.00000200 (double). The problem is, everything is automatic, less the double part, so how i double the "increased" bet if i lose the 7 time?

Strategy Example:

win - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000100
win - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000200
lose - 0.00000001
win -  0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
win - 0.00000400
lose - 0.00000001
win -  0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
lose - 0.00000001
win - 0.00000100

Configured in "Advanced Mode":
http://image.prntscr.com/image/d205c40823b649f59696eac09bb49a8e.png
http://image.prntscr.com/image/7185b151672948a2a1797f8f63a95836.png

I tried these codes:
Code:
function dobet()

baseBet=0.00000001
streakBet1=0.0000001

if win then

 nextbet=0.00000001

else

 nextbet=baseBet

end
if currentstreak==-6 then

 nextbet=streakBet1

if win then

streakBet1=0.0000001

else

setvalueint(streakBet1,double)

end

end

end

end

and

Code:
function dobet()

baseBet=0.00000001
streakBet1=0.0000001

if win then

 nextbet=0.00000001

else

 nextbet=baseBet

end
if currentstreak==-6 then

 nextbet=streakBet1

if win then

streakBet1=0.0000001

else

streakBet1=streakBet1*2

end

end

end

end
B4RF
Hero Member
*****
Offline Offline

Activity: 813
Merit: 507


View Profile
September 01, 2016, 12:05:03 AM
 #259

-snip-

Try this one

Code:

baseBet = 0.00000001
streakBet = 0.000001
streak = 0

function dobet()

if previousbet>baseBet then
  nextBet = baseBet

  if win then
    streakBet = 0.000001
  else
    streakBet = streakBet*2
  end

else
  if win then
    streak = 0

    nextbet=baseBet
  else
    streak = streak+1

    if streak==6 then
      nextbet=streakBet
  end
end

But betting after a losing streak doesn't change your odds at all... Roll Eyes


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
BigMat
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 01, 2016, 01:22:13 AM
 #260

-snip-

Try this one

Code:

baseBet = 0.00000001
streakBet = 0.000001
streak = 0

function dobet()

if previousbet>baseBet then
  nextBet = baseBet

  if win then
    streakBet = 0.000001
  else
    streakBet = streakBet*2
  end

else
  if win then
    streak = 0

    nextbet=baseBet
  else
    streak = streak+1

    if streak==6 then
      nextbet=streakBet
  end
end

But betting after a losing streak doesn't change your odds at all... Roll Eyes

Error in the code, something about "end problem".

Image: http://image.prntscr.com/image/d8153fb72df64a56882251e1c7bbe62f.png
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 [13] 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 »
  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!