hi everyone!
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
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
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??
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