Pages:
Author

Topic: Seuntjie' Dice bot programmers mode discussion. - page 46. (Read 125420 times)

legendary
Activity: 1007
Merit: 1000
right now im having a problem with X += 1, i put

Code:
  if (previousbet = basebet * 3 * 12 and win) then
   X += 1
   end

bit it won't add the value to the variable, why?


 Are you sure the variable is X and not x. 

 Add print(X) after that line to see what the value is. 
newbie
Activity: 42
Merit: 0
right now im having a problem with X += 1, i put

Code:
  if (previousbet = basebet * 3 * 12 and win) then
   X += 1
   end

bit it won't add the value to the variable, why?
legendary
Activity: 1717
Merit: 1125
Your code crashes without the sleeps because you have a bunch of infinite loops in your code. If you run it, I'll be surprised if the bot places more than about 3 bets before getting stuck in one of your loops and never placing a bet again until you restart it. You don't seem to understand how the bot works at all.

Look as these articles, especially the diagram. And actually read through it, don't just glance at the diagram and dismiss it because it has nothing to do with loops. It explains how the programmer mode works and how to program for it.

DiceBot Programmer mode tutorial 01 - Overview: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-01-overview
DiceBot Programmer mode tutorial 02 - Process: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
Dicebot Programmer mode tutorial 03 - Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale
Dicebot Programmer mode tutorial 04 - Martingale (and mini If tutorial): Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale

Man, dont just read this fricking script, TEST IT, it runs fine till it get the 4th recovery bet lost, OK? Can u help?

Read the damn links I posted. I do know and understand how my program works and that's why I can say that your loops are infinite and the bot is getting stuck in them. You don't understand how the program works. READ THE ARTICLES!
legendary
Activity: 1007
Merit: 1000
Your code crashes without the sleeps because you have a bunch of infinite loops in your code. If you run it, I'll be surprised if the bot places more than about 3 bets before getting stuck in one of your loops and never placing a bet again until you restart it. You don't seem to understand how the bot works at all.

Look as these articles, especially the diagram. And actually read through it, don't just glance at the diagram and dismiss it because it has nothing to do with loops. It explains how the programmer mode works and how to program for it.

DiceBot Programmer mode tutorial 01 - Overview: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-01-overview
DiceBot Programmer mode tutorial 02 - Process: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
Dicebot Programmer mode tutorial 03 - Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale
Dicebot Programmer mode tutorial 04 - Martingale (and mini If tutorial): Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale

Man, dont just read this fricking script, TEST IT, it runs fine till it get the 4th recovery bet lost, OK? Can u help?

   I won't test it either, I have no idea what it's supposed to do.  Don't try to loop unless you know what your trying to do.  Your code fails on the forth attempt because of this.

 if (losecount > 3) then   If you change the 3 to a 5 it will fail after 6 attempts.  

It doesn't do your loop, until it hits 4 loses.  

Now your loops make absolutely no sense.  

The dobet function, which is where your loops are, has to end before the next bet is places.   Just because you put a loop in there doesn't mean a bet is going to be places.  You don't have anything in the loop to cause it, and there is nothing available to allow you to do it.  

 seuntjie is suggesting you get a better understanding about when your script is actually running in the big picture.  

  
 
newbie
Activity: 42
Merit: 0
Your code crashes without the sleeps because you have a bunch of infinite loops in your code. If you run it, I'll be surprised if the bot places more than about 3 bets before getting stuck in one of your loops and never placing a bet again until you restart it. You don't seem to understand how the bot works at all.

Look as these articles, especially the diagram. And actually read through it, don't just glance at the diagram and dismiss it because it has nothing to do with loops. It explains how the programmer mode works and how to program for it.

DiceBot Programmer mode tutorial 01 - Overview: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-01-overview
DiceBot Programmer mode tutorial 02 - Process: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
Dicebot Programmer mode tutorial 03 - Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale
Dicebot Programmer mode tutorial 04 - Martingale (and mini If tutorial): Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale

Man, dont just read this fricking script, TEST IT, it runs fine till it get the 4th recovery bet lost, OK? Can u help?
legendary
Activity: 1717
Merit: 1125
Your code crashes without the sleeps because you have a bunch of infinite loops in your code. If you run it, I'll be surprised if the bot places more than about 3 bets before getting stuck in one of your loops and never placing a bet again until you restart it. You don't seem to understand how the bot works at all.

Look as these articles, especially the diagram. And actually read through it, don't just glance at the diagram and dismiss it because it has nothing to do with loops. It explains how the programmer mode works and how to program for it.

DiceBot Programmer mode tutorial 01 - Overview: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-01-overview
DiceBot Programmer mode tutorial 02 - Process: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
Dicebot Programmer mode tutorial 03 - Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale
Dicebot Programmer mode tutorial 04 - Martingale (and mini If tutorial): Martingale: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-03-martingale
newbie
Activity: 42
Merit: 0
I just wanna know why the bot doesn't support repeat-until loops, it crashes when it gets on the loop

   I don't think it's the repeat until.  This works
Code:
-- saldo minimo equivalente a 25000 doges

-- saldo em que você quer sacar seus ganhos, eles serão sacados automaticamente, leia todas as linhas até achar a que configura o resto do saque
finaltarget = 35000

chance = 66
martimulti = 3
basebet = 0.001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .005
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
nextwinbetlost = 0
nextwinbetwon = 0
go = false
set = false


function dobet()
   
if nextbet > balance then
   stop()
end

if balance > finaltarget then
        withdraw(10001, 'DRv1sH3Ni9qSM2AYhYs9wdriSUyNsrPQxW')
    end

r=math.random(10)

  if r >= 5 then
     bethigh=true
  else
     bethigh=false
  end

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 previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 3
        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
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
   else
     
   end

 if (losecount > 3) then
 if (basebet < 0) then
  repeat
   if (!win) then
    sleep(2000)
    nextwinbetlost = 1
    nextwinbetlost = nextwinbetlost + 1
    nextwinbet = losecount * (losecount / 2) * (basebet * 10)
    sleep(2000)
   else
    sleep(2000)
    nextwinbetwon = nextwinbetwon + 1
    nextwinbet = losecount * (losecount / 2) * (basebet * 10)
    sleep(2000)
    end
  until
   (nextwinbetwon > nextwinbetlost)
  else
 repeat
   if (!win) then
    sleep(2000)
    nextwinbetlost = 1
    nextwinbetlost = nextwinbetlost + 1
    nextwinbet = losecount * (losecount / 2)
    sleep(2000)
   else
    sleep(2000)
    nextwinbetwon = nextwinbetwon + 1
    nextwinbet = losecount * (losecount / 2)
    sleep(2000)
    end
  until
   (nextwinbetwon > nextwinbetlost)
   end
   end

   if (nextwinbetwon > nextwinbetlost) then
    go = true
    losecount = 0
   end

   wincount = 0
   totallose = totallose + 1
   if (totallose >= 6) then go = true end
   nextbet = basebet
 end
   
    if nextbet > balance then
   stop()
end
 
end

it crashes after the 4th time it tries to recover and loses
legendary
Activity: 1717
Merit: 1125
I just wanna know why the bot doesn't support repeat-until loops, it crashes when it gets on the loop

   I don't think it's the repeat until.  This works
Code:
chance = 50
bethigh = true
nextbet = .00000001


function dobet()

x = 10

repeat
   x-=1
   print(x)
until x == 0

end

   I think it was the fact you had a never ending loop that was causing the crash.  You never mentioned if by crashed you mean the bot failed and issued an error message, or did the bot just hang and you had to cancel it? 




the bot just freezed, but i figured it out, it's cuz u gotta puta some 'sleep()' strings, so it wont crash


Please post the code you're currently using, because it sounds to me like you're just in an infinite loop with the bot sleeping so the OS can't detect it's in an infinite loop. Meaning you're never actually going to bet anything.
newbie
Activity: 42
Merit: 0
I just wanna know why the bot doesn't support repeat-until loops, it crashes when it gets on the loop

   I don't think it's the repeat until.  This works
Code:
chance = 50
bethigh = true
nextbet = .00000001


function dobet()

x = 10

repeat
   x-=1
   print(x)
until x == 0

end

   I think it was the fact you had a never ending loop that was causing the crash.  You never mentioned if by crashed you mean the bot failed and issued an error message, or did the bot just hang and you had to cancel it? 




the bot just freezed, but i figured it out, it's cuz u gotta puta some 'sleep()' strings, so it wont crash
legendary
Activity: 1007
Merit: 1000
I just wanna know why the bot doesn't support repeat-until loops, it crashes when it gets on the loop

   I don't think it's the repeat until.  This works
Code:
chance = 50
bethigh = true
nextbet = .00000001


function dobet()

x = 10

repeat
   x-=1
   print(x)
until x == 0

end

   I think it was the fact you had a never ending loop that was causing the crash.  You never mentioned if by crashed you mean the bot failed and issued an error message, or did the bot just hang and you had to cancel it? 


newbie
Activity: 42
Merit: 0
I just wanna know why the bot doesn't support repeat-until loops, it crashes when it gets on the loop
legendary
Activity: 1007
Merit: 1000
Is there a statement that I can use to tell if previousbet = win or not?
yeah. the variable win.
or in code
Code:
if win then
--do something
else
--do something else
end


Is there a statement that I can use to tell if previousbet = win or not?

   Do you mean the one before the one your currently processing?  

if win then the current bet won.  

if currentstreak == 2 then                           last 2 bets won

if currentstreak == -1 then              current bet lost but previous bet won.  

currentstreak tells you how many bets in a row you won or lost.  +1 or greater for a win streak.  -1 or less for a loss streak.  
Improved on your statements a bit Smiley
having win and currentstreak==2 is redundant. the currentstreak cant be >0 if win is not true. same for the other one, currentstreak cannot be <0 if win is true. Also, win a Boolean, no need to compare it with something to get a boolean result.

   I showed the boolean compare more for clarity, I don't normally code it that way.

  But your other statement is correct, and I hadn't thought about it.  I guess I like to make my CPU work for it's dinner....  Smiley  Anyway good catch.... 
newbie
Activity: 42
Merit: 0
Is there a statement that I can use to tell if previousbet = win or not?

   Do you mean the one before the one your currently processing?  

If win == true    then the current bet won.  

if win == true  and currentstreak == 2 then                           last 2 bets won

if win == false and currentstreak == -1 then              current bet lost but previous bet won.  

currentstreak tells you how many bets in a row you won or lost.  +1 or greater for a win streak.  -1 or less for a loss streak.  

already got it: win and !win
legendary
Activity: 1717
Merit: 1125
Is there a statement that I can use to tell if previousbet = win or not?
yeah. the variable win.
or in code
Code:
if win then
--do something
else
--do something else
end


Is there a statement that I can use to tell if previousbet = win or not?

   Do you mean the one before the one your currently processing?  

if win then the current bet won.  

if currentstreak == 2 then                           last 2 bets won

if currentstreak == -1 then              current bet lost but previous bet won.  

currentstreak tells you how many bets in a row you won or lost.  +1 or greater for a win streak.  -1 or less for a loss streak.  
Improved on your statements a bit Smiley
having win and currentstreak==2 is redundant. the currentstreak cant be >0 if win is not true. same for the other one, currentstreak cannot be <0 if win is true. Also, win a Boolean, no need to compare it with something to get a boolean result.
legendary
Activity: 1007
Merit: 1000
Is there a statement that I can use to tell if previousbet = win or not?

   Do you mean the one before the one your currently processing?  

If win == true    then the current bet won.  

if win == true  and currentstreak == 2 then                           last 2 bets won

if win == false and currentstreak == -1 then              current bet lost but previous bet won.  

currentstreak tells you how many bets in a row you won or lost.  +1 or greater for a win streak.  -1 or less for a loss streak.  
newbie
Activity: 42
Merit: 0

no, i need the bet to be a X value, and it gotta stay the same


so,

   if (losecount >= 3) then
      nextbet = x
  end  

   That will bet X, once you have 3 losses until you hit a win.  

it's not that but dont worry, i already got a way and im testing it right now
legendary
Activity: 1007
Merit: 1000

no, i need the bet to be a X value, and it gotta stay the same


so,

   if (losecount >= 3) then
      nextbet = x
  end  

   That will bet X, once you have 3 losses until you hit a win.  
newbie
Activity: 42
Merit: 0
Guys, why when I code a loop and run the code, the bot crashes?

  Are you logged onto the site your trying to bet on?  That will crash you every time.  

No, just on the bot, and it doesn't crash right after I start, it crashes when it hits a loop

Post the script, or at least the loop that's crashing.  Does it crash the whole bot, or just stop the script with an error?    

The whole bot

Code:
finaltarget = 35000

chance = 66
martimulti = 3
basebet = 0.1
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .005
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
betlost = (currentprofit < 0) -- if the consoles prints an chunk 18 error delete this line, start the script, stop it, and then rewrite and start the bot again
nextwinbetlost = 0
go = false
set = false


function dobet()
    
if nextbet > balance then
   stop()
end

if balance > finaltarget then
        withdraw(10001, 'DRv1sH3Ni9qSM2AYhYs9wdriSUyNsrPQxW')
    end

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

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 previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 3
        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
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
   else
      
   end


-- this is the loop that makes the bot crashes
   if (losecount >= 3) then
     repeat
       netwinbet = (-curentprofit * losecount)
     until
       currentprofit > previousbet  
  end    

   wincount = 0
   totallose = totallose + 1
   if (totallose >= 6) then go = true end
   nextbet = basebet
 end
    
    if nextbet > balance then
   stop()
end
  
end

Ah ok.  Let me try to explain how the bot and script work.  

When you enter start() on the console, the bot runs through the script.  It sets up any variables before it hits the dobet function.  When it hits the function it saves that part to run later.  It then places the first bet based on your initialization variables.  IE bethigh, chance, nextbet...

Once that bet has been placed and the results come back from the site, the bot will execute the dobet function.  The dobet function has to complete before the bot can place the next bet.

I think the problem is your expecting betting to continue.  Your loop will never complete  if the currentprofit is < previousbet.  I'm not sure why the bot crashes, and doesn't just hang, but it could be running out of storage. or somehow detecting this and crashing.  

   I wouldn't use a loop that is expecting something externally to get updated.  If you were updating something in the loop it should work.    With that said, I've never used the repeat statement in a script so I'm not 100% sure.    

And what can I write to replace that?

   I have no idea what you are trying to do with that loop.  You do realize this is actually one big loop right?  The dobet function gets called after each bet, and when it ends the next bet is placed.  

I want to repeat the same bet. And I tested several loops, and discovered that the bot doesn't support any kind of loops, it crashes 'cause it can't process that much information, so now I need to know how to code a loop without while, repeat-until or for-do statements

nextbet = previousbet    

That would repeat the previous bet.  

The code you have is

   if (losecount >= 3) then
     repeat
       netwinbet = (-curentprofit * losecount)
     until
       currentprofit > previousbet  
  end  

That's a never ending loop unless currentprofit is already greater then previousbet.  The body of your loop is not updating currentprofit or previousbet.  

The code looks like your trying to update nextwinbet (spelled wrong in your code) with the inverse of the currentprofit * the losecount.  That is only done for 3 or more losses in a row.  I'm not sure what the check currentprofit > previousbet is trying to do.  currentprofit will always be negative in the loss path.  and previousbet has to be positive, so that will never be true.  

no, i need the bet to be a X value, and it gotta stay the same
legendary
Activity: 1007
Merit: 1000
Guys, why when I code a loop and run the code, the bot crashes?

  Are you logged onto the site your trying to bet on?  That will crash you every time.  

No, just on the bot, and it doesn't crash right after I start, it crashes when it hits a loop

Post the script, or at least the loop that's crashing.  Does it crash the whole bot, or just stop the script with an error?    

The whole bot

Code:
finaltarget = 35000

chance = 66
martimulti = 3
basebet = 0.1
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .005
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
betlost = (currentprofit < 0) -- if the consoles prints an chunk 18 error delete this line, start the script, stop it, and then rewrite and start the bot again
nextwinbetlost = 0
go = false
set = false


function dobet()
    
if nextbet > balance then
   stop()
end

if balance > finaltarget then
        withdraw(10001, 'DRv1sH3Ni9qSM2AYhYs9wdriSUyNsrPQxW')
    end

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

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 previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 3
        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
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
   else
      
   end


-- this is the loop that makes the bot crashes
   if (losecount >= 3) then
     repeat
       netwinbet = (-curentprofit * losecount)
     until
       currentprofit > previousbet  
  end    

   wincount = 0
   totallose = totallose + 1
   if (totallose >= 6) then go = true end
   nextbet = basebet
 end
    
    if nextbet > balance then
   stop()
end
  
end

Ah ok.  Let me try to explain how the bot and script work.  

When you enter start() on the console, the bot runs through the script.  It sets up any variables before it hits the dobet function.  When it hits the function it saves that part to run later.  It then places the first bet based on your initialization variables.  IE bethigh, chance, nextbet...

Once that bet has been placed and the results come back from the site, the bot will execute the dobet function.  The dobet function has to complete before the bot can place the next bet.

I think the problem is your expecting betting to continue.  Your loop will never complete  if the currentprofit is < previousbet.  I'm not sure why the bot crashes, and doesn't just hang, but it could be running out of storage. or somehow detecting this and crashing.  

   I wouldn't use a loop that is expecting something externally to get updated.  If you were updating something in the loop it should work.    With that said, I've never used the repeat statement in a script so I'm not 100% sure.    

And what can I write to replace that?

   I have no idea what you are trying to do with that loop.  You do realize this is actually one big loop right?  The dobet function gets called after each bet, and when it ends the next bet is placed.  

I want to repeat the same bet. And I tested several loops, and discovered that the bot doesn't support any kind of loops, it crashes 'cause it can't process that much information, so now I need to know how to code a loop without while, repeat-until or for-do statements

nextbet = previousbet   

That would repeat the previous bet. 

The code you have is

   if (losecount >= 3) then
     repeat
       netwinbet = (-curentprofit * losecount)
     until
       currentprofit > previousbet 
  end   

That's a never ending loop unless currentprofit is already greater then previousbet.  The body of your loop is not updating currentprofit or previousbet. 

The code looks like your trying to update nextwinbet (spelled wrong in your code) with the inverse of the currentprofit * the losecount.  That is only done for 3 or more losses in a row.  I'm not sure what the check currentprofit > previousbet is trying to do.  currentprofit will always be negative in the loss path.  and previousbet has to be positive, so that will never be true. 
newbie
Activity: 42
Merit: 0
Guys, why when I code a loop and run the code, the bot crashes?

  Are you logged onto the site your trying to bet on?  That will crash you every time.  

No, just on the bot, and it doesn't crash right after I start, it crashes when it hits a loop

Post the script, or at least the loop that's crashing.  Does it crash the whole bot, or just stop the script with an error?    

The whole bot

Code:
finaltarget = 35000

chance = 66
martimulti = 3
basebet = 0.1
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .005
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
betlost = (currentprofit < 0) -- if the consoles prints an chunk 18 error delete this line, start the script, stop it, and then rewrite and start the bot again
nextwinbetlost = 0
go = false
set = false


function dobet()
    
if nextbet > balance then
   stop()
end

if balance > finaltarget then
        withdraw(10001, 'DRv1sH3Ni9qSM2AYhYs9wdriSUyNsrPQxW')
    end

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

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 previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 3
        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
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
   else
      
   end


-- this is the loop that makes the bot crashes
   if (losecount >= 3) then
     repeat
       netwinbet = (-curentprofit * losecount)
     until
       currentprofit > previousbet  
  end    

   wincount = 0
   totallose = totallose + 1
   if (totallose >= 6) then go = true end
   nextbet = basebet
 end
    
    if nextbet > balance then
   stop()
end
  
end

Ah ok.  Let me try to explain how the bot and script work.  

When you enter start() on the console, the bot runs through the script.  It sets up any variables before it hits the dobet function.  When it hits the function it saves that part to run later.  It then places the first bet based on your initialization variables.  IE bethigh, chance, nextbet...

Once that bet has been placed and the results come back from the site, the bot will execute the dobet function.  The dobet function has to complete before the bot can place the next bet.

I think the problem is your expecting betting to continue.  Your loop will never complete  if the currentprofit is < previousbet.  I'm not sure why the bot crashes, and doesn't just hang, but it could be running out of storage. or somehow detecting this and crashing.  

   I wouldn't use a loop that is expecting something externally to get updated.  If you were updating something in the loop it should work.    With that said, I've never used the repeat statement in a script so I'm not 100% sure.    

And what can I write to replace that?

   I have no idea what you are trying to do with that loop.  You do realize this is actually one big loop right?  The dobet function gets called after each bet, and when it ends the next bet is placed.  

I want to repeat the same bet. And I tested several loops, and discovered that the bot doesn't support any kind of loops, it crashes 'cause it can't process that much information, so now I need to know how to code a loop without while, repeat-until or for-do statements
Pages:
Jump to: