Pages:
Author

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

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. 
newbie
Activity: 42
Merit: 0
This might help explain how the bot and the programmer mode works:
https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process

Seuntjie, this ain't helpin me, I gotta know how to loop on your bot
legendary
Activity: 1717
Merit: 1125
This might help explain how the bot and the programmer mode works:
https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
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?
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.   
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
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?   
newbie
Activity: 42
Merit: 0
I'm really amazed with new features of SDB!! I've found my perfect setting and starting with 0,02 BTC i was able now to reach my frist BTC after around 15 days of slow-action Cheesy
Now looking to see if winnings flow on stable basis, then i will share my preset with you Wink
Thanks Seuntjie boss!  Grin

Can you share your script  Grin Grin

Yes, please do share. What kind of tactics allow you to beat the house edge?

I had try many strategies , but always lose in the long time . Someone have good strategy, please share Grin Grin

I got one but I need help with loops
full member
Activity: 140
Merit: 100
I'm really amazed with new features of SDB!! I've found my perfect setting and starting with 0,02 BTC i was able now to reach my frist BTC after around 15 days of slow-action Cheesy
Now looking to see if winnings flow on stable basis, then i will share my preset with you Wink
Thanks Seuntjie boss!  Grin

Can you share your script  Grin Grin

Yes, please do share. What kind of tactics allow you to beat the house edge?
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
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. 
newbie
Activity: 42
Merit: 0
Guys, why when I code a loop and run the code, the bot crashes?
sr. member
Activity: 980
Merit: 257
i am not sure if this right place to say it but i think there is a little problem with dice bot

when playing with bot if you dont hit green and dont click stop then went to site and hit green dicebot will close itself
ili
newbie
Activity: 3
Merit: 0
ty!!! Wink
legendary
Activity: 1007
Merit: 1000

hi everyone!  Cheesy
i m new and i try to learn something but without your is impossible for me

i want to do this but i dont understand how   IT S HORRIBLE  Grin

function dobet()

if win then
nextbet = previousbet * 2
AND
nextbet=base
end
else
nextbet = previousbet*multi
end
end


i want to do this

1°bet- for example(loose) so
2°bet= previous*multi (if i loose)
3°bet= previous*multi (if i loose) 
4°bet= previous*multi (if i WIN)
5°bet= previous *2 ( if i loose or win is not important for me
                    but i would that the next bet return to base
)
6- basebet (and if i loose next bet is * multi)
ecc..

please help me!! i m going crazy   Huh

i wrote this

if not win then
nextbet = previousbet * multi
else
nextbet = previousbet * 2
resetbuiltin()
nextbet=basebet
end
end

 but when i win it don't double the bet but restart to basebet why?? Undecided

   First you need to understand the LUA syntax.  Google LUA and there are a lot of reference sites. 

Your first example is easiest to understand.  First the syntax is...

if (xyz) then

    do a bunch of stuff    this is not real code.....

else
 
    it's not XYZ so do what you want to do in that case

end


you have

if win then                          <----   This line is good
nextbet = previousbet * 2     <-----  This is good too, your setting next bet
AND                                   <-----  if you really have this in your script  I have no idea what LUA will do. 
nextbet=base                      <-----  Another good statement
end                                    <------ This ends your if statement, you have no else coded before this. 
else                                    <------  Lua will choke on this because there are no open if statements to process. 
nextbet = previousbet*multi    <-----  This is OK, but LUA doesn't know when to do this. 
end                                     <------ This is the end of the dobet function...   
end                                     <-----   This is just extra stuff after the script. 

You wanted this
if win then                          <----   This line is good
nextbet = previousbet * 2     <-----  This is good too, your setting next bet
nextbet=base                      <-----  Another good statement
else                                    <------  Now the above if is still open (no end yet)  so this else goes to that if.
nextbet = previousbet*multi    <-----  This is OK, but LUA doesn't know when to do this. 
end                                     <------ This is the end of the if/then/else. 
end                                     < ----  This is the end of the dobet function. 

Before the dobet function line you need to define/initialize multi. 

Your second example is better except the first line "if not win then"  I know "if !win then" works.  I think if you looked up the syntax, "if not win then" means if the variable not is true and the variable win is true then do the following code.  Since you probably do not have a variable not defined Lua does some weird stuff and doesn't complain.  ! means the opposite, so !win means win == false. 

another gotcha.  == means compare the 2 values.  = means assign the value of the right variable to the left variable. 

I'm not really understanding your requirements, but if you want to run this sequence 5 times, then reset to base. Here is how to do it. 

betcount = 0
base =
chance =
bethigh = true

dobet function

betcount += 1

if betcount == 5 then
   nextbet = base   
   betcount  = 0
else
   if win then                   
      nextbet = previousbet * 2     
   else         
      nextbet = previousbet*multi   
   end                                   
end
end                             



newbie
Activity: 17
Merit: 0
Hi there,

I am running a script for a while now and it seems like that somethings going crappy, and things happening that is not written in the script. Maybe it has something to do with the computer it is running on. Okay, it does not matter because with a little help i can prevent this error if the following question is possible, maybe it is also useful for others:

Is there a way to track like last 4 bets, and if they all have the High = true or high = false then stop the script.
What i'm looking for when the script is going to live by itself due errors, then this tracking function is going to stop the script when condition is met what is written in the function.

See screenshot for the high/low i mean.
http://i64.tinypic.com/s3ekit.jpg

Hope somebody can help me out how to do this.
Thanks!

   This is pretty easy.  Setup 2 counters bethighcount and betlowcount.  set both to 0 in the init section (Before the dobet function)  Then at the begining of your dobet function add,

Code:

if (bethigh) then         // if bethigh is true
   bethighcount += 1
   betlowcount = 0
else                         // bethigh is false
   betlowcount += 1
   bethighcount = 0
end

if (bethighcount == 4 or betlowcount == 4) then
   stop()
end


    That just keeps a count of how many high or low bets you've made in a row and stops on 4 in a row.  


Wow haha that is easy, yes  Shocked. And this is exactly what i am looking for, but i did not get it by myself, my head was thinking to difficult Smiley
Thanks man.
legendary
Activity: 1007
Merit: 1000
Hi there,

I am running a script for a while now and it seems like that somethings going crappy, and things happening that is not written in the script. Maybe it has something to do with the computer it is running on. Okay, it does not matter because with a little help i can prevent this error if the following question is possible, maybe it is also useful for others:

Is there a way to track like last 4 bets, and if they all have the High = true or high = false then stop the script.
What i'm looking for when the script is going to live by itself due errors, then this tracking function is going to stop the script when condition is met what is written in the function.

See screenshot for the high/low i mean.


Hope somebody can help me out how to do this.
Thanks!

   This is pretty easy.  Setup 2 counters bethighcount and betlowcount.  set both to 0 in the init section (Before the dobet function)  Then at the begining of your dobet function add,

Code:

if (bethigh) then         // if bethigh is true
   bethighcount += 1
   betlowcount = 0
else                         // bethigh is false
   betlowcount += 1
   bethighcount = 0
end

if (bethighcount == 4 or betlowcount == 4) then
   stop()
end


    That just keeps a count of how many high or low bets you've made in a row and stops on 4 in a row. 
hero member
Activity: 952
Merit: 500
I'm really amazed with new features of SDB!! I've found my perfect setting and starting with 0,02 BTC i was able now to reach my frist BTC after around 15 days of slow-action Cheesy
Now looking to see if winnings flow on stable basis, then i will share my preset with you Wink
Thanks Seuntjie boss!  Grin
newbie
Activity: 9
Merit: 0
Would someone be able to help me with a script; I have an idea but whenever i code it, it seems to go miles of path sometimes,

it would go along as such
0.00057564 etc
0.0006781 etc
then it would lose  and be fine
0.00075851 etc < -- loss
0.00164845 etc win
0.0018421 etc win
0.0020323 < -- loss
44.412312 is then bet
yet I have no multiplier to get it that high that quick

Post the script.  With a little explanation of what your trying to do. 

@chilly2k you seem to be the one with the most script know how;

anychance you chould help me with this this one ?

Code:
chance=90
multiplier=.25
multiplier2=2
base=0.00125
nextbet = base 
target = .00000125
investtarget = 1
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false
startbalance = balance
tipamount = 0.5
rollcount = 0

function dobet()

rollcount += 1
tmpprofit += currentprofit
investprofit += currentprofit

   if win then
   --We Won, Now to see if tmp profit is equal to target profit
        if (tmpprofit > target) then
         tmpprofit = 0
         nextbet = base
--Also checking if we have made a 1000+ rolls on the same seed; if we have and in positive, we resetseed
         if(rollcount >= 1000) then resetseed();
end
--Investing if invest profit is bigger than investtarget if it is we invest
         if(investprofit  > investtarget ) then
             investprofit = 0
             invest(balance - startbalance - tipamount)
-- this is a tip amount to my other account
tip("1562881", tipamount)
         end     
      else
  --this is for when we win and we havent reached the target profit
         nextbet=previousbet*multiplier2
      end
   else
      nextbet=previousbet*multiplier
      if(nextbet > base) then nextbet = base
  end
  if(nextbet > (balance/1.5)) then
nextbet = base
resetstats();
end
  end


end
[code]


When its already made it to its tmp profit and its still winning, I would like it to slowly climb via another multiplier thats alot smaller eg instead of 2 maybe 1.5 till its reached tmpprofit again and starts over, as i seem to waste around 10 - 15 wins
[/code]
newbie
Activity: 9
Merit: 0
how come when i run this script

Code:
chance=90
multiplier=1.92
multiplier2=1.25
base=0.00125
nextbet = base 
target = .0000125
investtarget = .1
tmpprofit = 0
investprofit = 0
wincount = 10
stopnow = false
startbalance = balance
tipamount = 0.001

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(balance - startbalance - tipamount)
tip("1562881", tipamount)
         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


I want to make it after it reaches its tmp goal that it goes to base and then starts the multiply again; could someone help i cannot figure it out

as it wastes a hell of a lot of wins, so if it kept multiplying to tmpproffit amount  you would make more faster but it runs like 15 wins in a row at basebet

Pages:
Jump to: