Hello Guest

Target reached.. now restart again

  • 3 Replies
  • 391 Views
*

Davillen

  • *
  • 3
  • +0/-0
    • View Profile
Target reached.. now restart again
« on: May 14, 2021, 09:47:33 pm »
Hi Everyone,

So I created a script that I combined together using other scripts.  It's running exactly how I want it to.  The only issue is I want it to restart the script on it's own once it reaches the target instead of having it stop. 

Below is my script.  If anyone can help me it would be greatly appreciated.

Thank You

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

chance        = 33
martimulti    = 1.011
basebet       = .025
startbalance  = balance
nextbet       = basebet
savefactor    = 1.031
target        = 2.30
targetbalance = 2.30
bethigh       = true
low           = 0
high          = 0
losecount     = 0
stopnow       = false
totallose     = 0
wincount      = 0
nextwinbet    = basebet * martimulti
go            = false
set           = false
maxbet        = 0.030

-- set profit target here (Final Balance after Winning)
profittarget = balance + 0.1
function dobet()

--Randomizer
r=math.random(2)

if r == 1 then
     bethigh=true
else
     bethigh=false
end

if betcount == 1 then
    betcount = 9
resetseed();
else
betcount=betcount+1
end

if (balance) >= profittarget then
stop();
print(balance)
print("TARGET ACHIEVED!!!")
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 == 1 and previousbet != basebet) then
      if (stopnow) then stop() end
      martimulti = 1.031
        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 == 1) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 1.2
      if (martimulti < 1.031) then martimulti = 1.031 end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 1.031) then go = true end
   nextbet = basebet
 end
 
end

*

Davillen

  • *
  • 3
  • +0/-0
    • View Profile
Re: Target reached.. now restart again
« Reply #1 on: June 01, 2021, 10:16:40 pm »
Can anyone help me out?

*

Bullseye

  • **
  • 36
  • +0/-0
    • View Profile
Re: Target reached.. now restart again
« Reply #2 on: June 09, 2021, 07:56:52 pm »
change the following part:


if (balance) >= profittarget then
--stop();
print(balance)
print("TARGET ACHIEVED!!!")
startbalance=balance
profittarget = balance + 0.1
nextbet=basebet

end

That should work.  You may have to also add any other variables from above your dobet() if they get changed after the start.

it won't stop in the console, but you could add some variables to keep track of how many times you reached your profittarget and the total.

*

Davillen

  • *
  • 3
  • +0/-0
    • View Profile
Re: Target reached.. now restart again
« Reply #3 on: June 15, 2021, 11:10:14 pm »
Thank You, I tried it but it doesn't work as instructed, i just resets whenever it wants to.

change the following part:


if (balance) >= profittarget then
--stop();
print(balance)
print("TARGET ACHIEVED!!!")
startbalance=balance
profittarget = balance + 0.1


nextbet=basebet

end

That should work.  You may have to also add any other variables from above your dobet() if they get changed after the start.

it won't stop in the console, but you could add some variables to keep track of how many times you reached your profittarget and the total.