still here guys
Cool story bro...
Maybe you should be using the time you wait for someone to reply to you to go and read
https://www.tutorialspoint.com/lua/ or one of the other
thousands of "learn to program" tutorials that you can find using googleWhile you're at it, you might like to learn how to edit your messages when you press the "quote" button... re-quoting massive messages and adding 3 words (of impatient whining that no-one is helping you) is both annoying and poor etiquette.
The folks here have been INSANELY patient with you... perhaps you should return the favour by asking your question and then waiting patiently for someone to help you out... Remember, we don't get paid to sit on bitcointalk 24/7, we're not employees... and I'm sure most people here have jobs, families and lives outside of bitcointalk...
I can't speak for the others, but I personally do this because I genuinely enjoy helping people... until they act like entitled, spoiled brats...
#sorryNotSorry
thankx for repling bro, lols if i tell u , u wouldnt belive me but still i hv to tell u (i dont understand a thing of what u hv just told me....
pls could u break it down? mnore cus my head is like
spinning
Once again... an "if-then-else" statement is in the form:
if (some condition is true) then
.. do some stuff ..
else
.. do something else ..
end
All the code between the "if-then" and "else" (ie. .. do some stuff ..) will only execute if the condition evaluates to "True". If the condition is "False", then the code between the "else" and "end" (ie. .. do something else ..) will be executed instead. So each time this "if-then-else" section is executed, only ONE part of it will actually be run.
You put your "stoploss" code inside the "if profit>target then" section. So unless profit was greater than target, your stoploss code would not be executed.
Additionally, you put your "stoploss" code inside the "goal()" function. According to your script, "goal()" is ONLY called if a bet wins as it is inside the "if win then" section... This means that your stoploss code will not run if your bet is a loss. It would only be run if your bet was a "win" AND Profit > target. Obviously, this means that it will never detect that you've lost too much money... so it will never make your program stop!
if win then
-- THIS CODE GETS EXECUTED ON WIN
goal()
loadgun()
basebet=balance*betfactor
....
else
-- THIS CODE GETS EXECUTED ON LOSS
losecount+=1
nexbet=prebet
....
end
To fix this, you can either put the call to goal() BEFORE the "if win then-else" section, so it is called for every single roll... or you can add a call to goal() inside the "else" section of the "if win then-else" part of the code right before losecount+=1 so that it is also called when your roll is a loss.