Need help with the bot or want someone to talk to?
FORUM.SEUNTJIE.COM

The forum is a good platform for asking or offering help with programmer mode scripts

LUA Scripts

Download a script for your bot, or upload your own to share with other users. Login or Register to upload

How do I use this?


Name:BetMultiplier_v2
Uploaded by: GlenArven
Discription:
The script will calculate your bet multiplier based on your balance. The range is between 2.25 and 3. Increments by 0.01. Always goes for the most rolls and increases multiplier until the next roll can be made.





CommentsLogin or Register
seuntjie23:01:2017 19:49
A cleaner more flexible version of your stack of if-else statements: 

m = bmulti
b = base
carry = 0
counter = 0
found =0
while (counter<=30 and found==0) do
	car1 = (b + (b * m^counter))
    car2 = car1 + (b * m^(counter+1))
	if ((balance > car1) and (balance > car2)) then
		maxroll=counter+1
		found=1
	end
	counter+=1	
end
    Login or Register
GlenArven23:01:2017 22:49
Thx, It looks pretty. I will add it to my arsenal of future endeavors.
    Login or Register
GlenArven24:01:2017 12:51
else
car1 = car2
car2 = car2 + (b * m^6)

There is an error here
 it should be :

else
car1 = car2
car2 = car1 + (b * m^6)

That's why seuntjie's way is better. 
    Login or Register
GlenArven26:01:2017 16:34
I have no idea why but, this way of finding maxroll is not working out. I've tried variations of this while statement and a for loop and in each case the output betmultiplier is off. So, for now this way works the best. Except for that small correction posted below. 
    Login or Register
Hjorten27:01:2017 07:12
are you uploade a new working script whit the seuntjie corections posted below dont get were in your script to change it ... but i will like to try it 
    Login or Register
GlenArven27:01:2017 16:14
As I vaguely stated before Seuntjie's idea of using a while statement has not worked. I have messed with it for several hours and I tried using a for loop instead. But, and I cannot figure out why, the out put is off. The script posted here works perfectly except for the small edit I posted above. Fix that and it will never fail. GL!!
    Login or Register
seuntjie28:01:2017 07:11
This comment has been removed.
    Login or Register
seuntjie28:01:2017 07:14
I found two problems in my loop. 1 was the if statement was wrong, and 2, car2 never gets reset to 0 (so it works the first time, but not the second). try this:

m = bmulti
b = base
carry = 0
counter = 0
found =0
car1=0
car2=0
while (counter<=30 and found==0) do
	car1 = (b + (b * m^counter))
    car2 = car1 + (b * m^(counter+1))
	if ((balance > car1) and (balance < car2)) then
		maxroll=counter+1
		found=1
	end
	counter+=1	
end
    Login or Register
seuntjie28:01:2017 07:17
This comment has been removed.
    Login or Register
seuntjie28:01:2017 07:18
an even more compact version with less calculations that should do the same (I haven't tested it yet though):

m = bmulti
b = base
carry = 0
counter = 0
found =0
car1=0
while (counter<=30 and found==0) do
	car1 = car1+ (b + (b * m^counter))
	if balance < car1 then
		maxroll=counter
		found=1
	end
	counter+=1	
end
    Login or Register
GlenArven28:01:2017 11:14
This comment has been removed.
    Login or Register
GlenArven28:01:2017 11:15
This comment has been removed.
    Login or Register
GlenArven28:01:2017 13:02
I think I fixed it. What you have proposed thus far does not work correctly. But I think I figured out why finally.


-- Funtion to set maxroll
-- Based on balance and multiplier. 
m = bmulti
b = base
car1 = 0
car2 = 0
car1 = b 
counter = 0
found = false
while (counter<=30 and (not found)) do
	--car1 = (b * m^counter)
    car2 = car1 + (b * m^(counter+1))
	if ((balance > car1) and (balance < car2)) then
		maxroll=counter+1
		found = true
	end
    car1 = car2
	counter+=1	
end
    Login or Register