Post
Topic
Board Gambling discussion
Re: Seuntjie' Dice bot programmers mode discussion.
by
seuntjie
on 29/04/2017, 22:33:55 UTC
You can't restart the bot once you call stop(), the only way for it to start up again is to enter start() in the console window like you do to initially start the script running...

So, instead of issuing the stop() command, just track your profit amount, when it reaches the target you're happy with, use the invest() command and then reset back to initial script settings and continue Wink

NOTE: I'm not sure if this will work with any site... I've never used the invest() command, but there seems to be invest() code for just-dice in the dicebot code, so I'm assuming it works

Code:
...
startBalance = balance
runProfit = 0
profitTarget = 1.0 -- Set this to how much PROFIT you want to make before you invest, not the balance!
....

function dobet()

  runProfit = balance - startBalance

  if (win) then
    --do win stuff
  else
    -- do loss stuff
  end

  if runProfit >= profitTarget then
    ching()
    alarm()  
    print("Your Balance is " .. balance)
    print()
    print("TARGET ACHIEVED!!!")
    print()
    print("You Won " .. runProfit .. " for this Session")
    print()

    print("Investing: " .. runProfit)
    invest(runProfit) -- invest winnings
    
    -- reset back to beginning and continue
    startBalance = balance
    runProfit = 0
    chance = 90
    bethigh = true
    nextbet = basebet

    print(" ")
 end

end

Ok that probably why i got a lot of luna errors when i tried putting in the invest() and start() commando after stop(). I'll give yours a try to see if it works Wink thanks for the help so far Wink

Take a look at the tutorials linked on https://bot.seuntjie.com/programmermode.aspx, specifically https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process
It will give you an overview of the process the bot follows every time a bet is placed.

Calling stop, then invest/withdraw/tip, the invest/withdraw/tip commands will still be executed/processed, as the whole dobet function is completed. But you cannot start the bot again after stopping it from within the script. It should never be necessary to do so as all of the functions that can be called from the programmer mode as synchronous and serial.

Edit: Also, see https://bot.seuntjie.com/features.aspx for a list of features that is enabled for the supported sites.