seuntjie
Legendary
Offline
Activity: 1717
Merit: 1125
|
|
June 12, 2017, 08:44:35 PM |
|
How do i code if i want to multiply after every 3 turn loss/win
Can anyone help me with this, thanks
Examples make everyones life easier if you can't speak english properly
|
|
|
|
Phyzyprogrammer
Member
Offline
Activity: 90
Merit: 10
Visit www.btcscriptbot.wordpress.com to get latest
|
|
June 12, 2017, 10:43:25 PM |
|
helo guys its me again, i just saw this script i downloaded but i wanted to add stop on loss in it but its not stoping even after i added the code , can anyone pls let me know what am doing wrong thankx alo -- The Russian Roulette by McGuyver -- If you like my scrypt, your donations are much welcome ;) -- My BTC Wallet: 33kx7iqfjSLuEAoW7EasLs83vontLmCvAE
chance1=8.9189 -->11.10X payout chance2=10.1020 --> 9.8X payout chance3=13.0263 --> 7.6X Payout chance4=18.3333 --> 5.4X Payout chance5=30.9375 --> 3.2X Payout
m1=1.119 --> Multipliers
(Increase on Lose 1.119=11.9% Inc on lose) m2=1.137 m3=1.182 m4=1.274 m5=1.546
target=0.00100000 --> Set your Target Profit
here
prebet=0.00000001 betfactor=0.00002 --> very conservative to absorb max
losses with profit on win (Bankroll*0.00002 = basebet) basebet=balance*betfactor --> 2 sats basebet at .0005 BTC,
basebet increases as balance increases; basebet=0.00000002
(fixed basebet) nextbet=prebet chance=chance1 bethigh=false
startBalance = balance -- this is the where i put the stop on win button runprofit = 0
lostchance=1 losecount=0 wincount=0 trigger=0 betcount=0 preroll=9 counter=0 high=0 low=0
resetseed() --resetstats() --> To reset your statistics, remove
the double dash (--)
function dobet()
loadgun() betroll() rstseed() viewstats() betcount+=1
if basebet<0.00000002 then --> Change this for a higher basebet
(Both Values) basebet=0.00000002 end
e=currentstreak+preroll
if win then goal() loadgun() basebet=balance*betfactor
if basebet<0.00000002 then --> Change this for a higher
basebet (Both Values) basebet=0.00000002 end
nextbet=prebet wincount+=1 losecount=0
hilo()
if trigger==1 then chance=chance1 lostchance=1 preroll=9 end
if trigger==2 then chance=chance2 lostchance=2 preroll=8 end
if trigger==3 then chance=chance3 lostchance=3 preroll=5 end
if trigger==4 then chance=chance4 lostchance=4 preroll=4 end
if trigger==5 then chance=chance5 lostchance=5 preroll=1 end
else losecount+=1 nexbet=prebet
if lostchance==1 then if e == 0 then chance=chance1 nextbet=basebet end
if e <0 then chance=chance1 nextbet=previousbet*m1 end end
if lostchance==2 then if e == 0 then chance=chance2 nextbet=basebet end
if e <0 then chance=chance2 nextbet=previousbet*m2 end end
if lostchance==3 then if e == 0 then chance=chance3 nextbet=basebet end
if e <0 then chance=chance3 nextbet=previousbet*m3 end end
if lostchance==4 then if e == 0 then chance=chance4 nextbet=basebet end
if e <0 then chance=chance4 nextbet=previousbet*m4 end
end
if lostchance==5 then -- randomizer() if e == 0 then chance=chance5 nextbet=basebet end
if e <0 then chance=chance5 nextbet=previousbet*m5 end
end
end
end
function hilo()
if high > low then bethigh=true else bethigh=false end
if (high-low) > 5 then bethigh=false end
if (low-high)> 5 then bethigh=true end end
function betroll()
if (lastBet.roll < chance) then low += 1 end
if (lastBet.roll > (99.99 - chance)) then high += 1 end
end
function rstseed()
if counter==500 then
resetseed() counter=0 low=0 high=0 else
counter+=1
end end
function viewstats() print(" ") print("Total Bet : "..betcount) print("Current Streak Loss : "..losecount) print("Wins : "..wincount) print("Losses : "..(betcount-wincount)) print("Current Profit : "..string.format("%.8f",profit)) print("Target Profit : "..string.format("%.8f",target)) print("Current Balance : "..string.format("%.8f",balance)) print("High :"..high.." / ".."Low :"..low) print(" ") end
function randomizer()
r=math.random(2)
if r==2 then bethigh=true else bethigh=false end
end
function loadgun()
t=math.random(5)
trigger=t
end
function goal() if profit>target then stop() print(" ") print("TARGET REACHED!!!") print(" ") print("Total Wins : "..wincount) print("Total Losses : "..(betcount-wincount)) print("Total Bet : "..betcount) print("Current Profit : "..string.format("%.8f",profit)) print("Target Profit : "..string.format("%.8f",target)) print("Final Balance : "..string.format("%.8f",balance)) print(" ")
runprofit = balance - startBalance if runprofit <= -0.001 then -- 0.001 BTC loss -- this is whwer i put the stop on win nextbet = 0 stop() end
end
|
visit ( www.btcscriptbot.wordpress.com) we offer latest scripts and bots to earn bitcoins and other altcoins for free and paid! Earn Bitcoins with bots
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4363
<insert witty quote here>
|
|
June 12, 2017, 11:07:28 PM |
|
You need to put the runprofit calculation OUTSIDE of the "if profit>target then" block... You have put it inside that block... so it will only do that calculation if profit>target... Basically, you are missing an "end" statement: function goal() if profit>target then stop() print(" ") print("TARGET REACHED!!!") print(" ") print("Total Wins : "..wincount) print("Total Losses : "..(betcount-wincount)) print("Total Bet : "..betcount) print("Current Profit : "..string.format("%.8f",profit)) print("Target Profit : "..string.format("%.8f",target)) print("Final Balance : "..string.format("%.8f",balance)) print(" ") end
runprofit = balance - startBalance if runprofit <= -0.001 then -- 0.001 BTC loss -- this is whwer i put the stop on win nextbet = 0 stop() end
end
|
|
|
|
Phyzyprogrammer
Member
Offline
Activity: 90
Merit: 10
Visit www.btcscriptbot.wordpress.com to get latest
|
|
June 12, 2017, 11:43:24 PM |
|
You need to put the runprofit calculation OUTSIDE of the "if profit>target then" block... You have put it inside that block... so it will only do that calculation if profit>target... Basically, you are missing an "end" statement: function goal() if profit>target then stop() print(" ") print("TARGET REACHED!!!") print(" ") print("Total Wins : "..wincount) print("Total Losses : "..(betcount-wincount)) print("Total Bet : "..betcount) print("Current Profit : "..string.format("%.8f",profit)) print("Target Profit : "..string.format("%.8f",target)) print("Final Balance : "..string.format("%.8f",balance)) print(" ") end
runprofit = balance - startBalance if runprofit <= -0.001 then -- 0.001 BTC loss -- this is whwer i put the stop on win nextbet = 0 stop() end
end tankx fop ur reply bro , i hv put the (end) tatement in it,,,, but its just running and it didint stop when it reached the loss terget,, plus i dont understand what u mean by You need to put the runprofit calculation OUTSIDE of the "if profit>target then" block... You have put it inside that block... so it will only do that calculation if profit>target... pls explain more sir thankx alot and bless u
|
visit ( www.btcscriptbot.wordpress.com) we offer latest scripts and bots to earn bitcoins and other altcoins for free and paid! Earn Bitcoins with bots
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4363
<insert witty quote here>
|
|
June 13, 2017, 02:23:12 AM |
|
well... as has been explained several times... 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 "end" (or "else" if there is an "else") will only execute if the condition evaluates to "True". In your instance... you had put the runprofit calculation inside the "if profit>target then" section. So unless profit was greater than target, the runprofit calculation would not happen. Anyway, the main reason for your stoploss not working, is that the goal() function where you are doing the runprofit calculation, is ONLY called if a bet wins... so it will never do the runprofit calculation on a loss, so it will never detect that you've lost any amount and stop if win then goal() loadgun() basebet=balance*betfactor .... else losecount+=1 nexbet=prebet .... end To fix this, you can either put the call to goal() in the dobet() function, but outside of the "if win then-else" section, so it is called for every roll... or you can add a call to goal() inside the "else" section of the "if win then-else" part of the code.
|
|
|
|
Phyzyprogrammer
Member
Offline
Activity: 90
Merit: 10
Visit www.btcscriptbot.wordpress.com to get latest
|
|
June 13, 2017, 08:44:47 AM |
|
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 well... as has been explained several times... 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 "end" (or "else" if there is an "else") will only execute if the condition evaluates to "True". In your instance... you had put the runprofit calculation inside the "if profit>target then" section. So unless profit was greater than target, the runprofit calculation would not happen. Anyway, the main reason for your stoploss not working, is that the goal() function where you are doing the runprofit calculation, is ONLY called if a bet wins... so it will never do the runprofit calculation on a loss, so it will never detect that you've lost any amount and stop if win then goal() loadgun() basebet=balance*betfactor .... else losecount+=1 nexbet=prebet .... end To fix this, you can either put the call to goal() in the dobet() function, but outside of the "if win then-else" section, so it is called for every roll... or you can add a call to goal() inside the "else" section of the "if win then-else" part of the code.
|
visit ( www.btcscriptbot.wordpress.com) we offer latest scripts and bots to earn bitcoins and other altcoins for free and paid! Earn Bitcoins with bots
|
|
|
kwong1983
Newbie
Offline
Activity: 54
Merit: 0
|
|
June 13, 2017, 10:36:12 AM |
|
How do i code if i want to multiply after every 3 turn loss/win
Can anyone help me with this, thanks
So you have a basebet and want to multipy that bet after every 3rd bet? Or only when you lost 3 bets in a row? I think that kind of stuff is already possible in the advanced mode, right? You wont need any code for that. Multiply after lost 3 bets in a row
|
|
|
|
B4RF
|
|
June 13, 2017, 05:21:40 PM |
|
How do i code if i want to multiply after every 3 turn loss/win
Can anyone help me with this, thanks
So you have a basebet and want to multipy that bet after every 3rd bet? Or only when you lost 3 bets in a row? I think that kind of stuff is already possible in the advanced mode, right? You wont need any code for that. Multiply after lost 3 bets in a row Use the settings mode 'Advanced' and under strategies you use maritngale and insert 3 in the textbox of 'Multiply after every [ ] loss'. There is no need for the programmersmode if you wanne use only a small variation of martingale.
|
▄▄▄████████▄▄▄ ▄██████████████████▄ ▄██████████████████████▄ ██████████████████████████ ████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ██████████████████████████████ ████████████████████████████ ██████████████████████████ ▀██████████████████████▀ ▀██████████████████▀ ▀▀▀████████▀▀▀
| | | | ███████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ██████████ ███████ | | | | ▄▄██████████████▄▄ ▄██████████████████████▄ █████ ▄██████████████████████████▄ █████ ████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████ ▄██▀ ████ █████ ██████ █████ ████ ▄██▀ ████ █████ ██████ █████ ████ ██▀ ████ █████ ██████ █████ ████ ██ ████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄ ████████████████████████████ ████████ ███████▀ ▀███████ ▀██████▀ █████▀ ▀█████ ▀██████████████████████████▀ ▀▀████████████████████▀▀ | | |
|
|
|
Phyzyprogrammer
Member
Offline
Activity: 90
Merit: 10
Visit www.btcscriptbot.wordpress.com to get latest
|
|
June 13, 2017, 09:14:12 PM |
|
still here guys 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 well... as has been explained several times... 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 "end" (or "else" if there is an "else") will only execute if the condition evaluates to "True". In your instance... you had put the runprofit calculation inside the "if profit>target then" section. So unless profit was greater than target, the runprofit calculation would not happen. Anyway, the main reason for your stoploss not working, is that the goal() function where you are doing the runprofit calculation, is ONLY called if a bet wins... so it will never do the runprofit calculation on a loss, so it will never detect that you've lost any amount and stop if win then goal() loadgun() basebet=balance*betfactor .... else losecount+=1 nexbet=prebet .... end To fix this, you can either put the call to goal() in the dobet() function, but outside of the "if win then-else" section, so it is called for every roll... or you can add a call to goal() inside the "else" section of the "if win then-else" part of the code.
|
visit ( www.btcscriptbot.wordpress.com) we offer latest scripts and bots to earn bitcoins and other altcoins for free and paid! Earn Bitcoins with bots
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4363
<insert witty quote here>
|
|
June 14, 2017, 02:19:45 AM |
|
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.
|
|
|
|
kwong1983
Newbie
Offline
Activity: 54
Merit: 0
|
|
June 14, 2017, 08:07:14 AM |
|
How do i code if i want to multiply after every 3 turn loss/win
Can anyone help me with this, thanks
So you have a basebet and want to multipy that bet after every 3rd bet? Or only when you lost 3 bets in a row? I think that kind of stuff is already possible in the advanced mode, right? You wont need any code for that. Multiply after lost 3 bets in a row Use the settings mode 'Advanced' and under strategies you use maritngale and insert 3 in the textbox of 'Multiply after every [ ] loss'. There is no need for the programmersmode if you wanne use only a small variation of martingale. I know this can be done in advance mode but there is some limitation that i need to put that is not avaliable in advance. Can you help me out?
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4363
<insert witty quote here>
|
|
June 14, 2017, 10:02:20 AM |
|
Just put in a counter to count your losses... reset it when you win (or hit 3 losses)... check it on a loss and if it equals 3 then multiply ... losscount = 0 ... function dobet() ... if win then losscount = 0 ... else losscount = losscount + 1 if losscount == 3 then nextbet = previousbet * multiplier losscount = 0 end ... end
end
|
|
|
|
seuntjie
Legendary
Offline
Activity: 1717
Merit: 1125
|
|
June 14, 2017, 10:51:14 AM |
|
Just put in a counter to count your losses... reset it when you win (or hit 3 losses)... check it on a loss and if it equals 3 then multiply ... losscount = 0 ... function dobet() ... if win then losscount = 0 ... else losscount = losscount + 1 if losscount == 3 then nextbet = previousbet * multiplier losscount = 0 end ... end
end
You could also use currentstreak and modulus. ... function dobet() ... if win then ... else if currentstreak%3==0 then nextbet = previousbet * multiplier end ... end
end
|
|
|
|
Phyzyprogrammer
Member
Offline
Activity: 90
Merit: 10
Visit www.btcscriptbot.wordpress.com to get latest
|
|
June 14, 2017, 12:52:56 PM |
|
Not cool bro, but i really dont blame you really not cool but thankx anyways it worked now 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.
|
visit ( www.btcscriptbot.wordpress.com) we offer latest scripts and bots to earn bitcoins and other altcoins for free and paid! Earn Bitcoins with bots
|
|
|
BossMacko
|
|
June 18, 2017, 12:55:40 AM |
|
Hello guys, i just want to ask if it is possible to implement 2 scripts in advanced mode? for example if script 1 lose a bet it will call and run script 2 until the function dobet of script 2 is completed then it will call script 1 again. I am thinking of a case switch but i can't implement it in lua language. thanks in advanced.
|
|
|
|
HCP
Legendary
Offline
Activity: 2086
Merit: 4363
<insert witty quote here>
|
|
June 18, 2017, 02:28:12 AM |
|
Firstly, you can't run scripts in Advanced mode, only programmer mode. And, No you can't get it to load extra scripts. You can only run what is inside the script window. As a solution to your problem, you could just create two functions outside of the dobet() function... call one scriptOneStuff() and scriptTwoStuff() and then just call whichever one you want based on the outcome of your rolls or whatever other conditions you are wanting to base the script changing conditions on... something like ... function dobet()
if (win) then scriptOneStuff() else scriptTwoStuff() end
...
end
function scriptOneStuff() ... put your stuff here... end
function scriptTwoStuff() nextbet = something else bethigh = low other stuff that you want to do...
end
Using global vars declared before the dobet() should enable you to manipulate common values in both functions...
|
|
|
|
eddd
Newbie
Offline
Activity: 6
Merit: 0
|
|
June 19, 2017, 06:56:27 PM |
|
Hi guys,
Seems there's a difference between simulation and the real sites.
I've got a script that is consistently profitable in simulation, but it's not within the actual site (Primedice in this case).
Is the simulation actually a perfect game? i.e. it doesn't take in the 1% house edge?
If so, is there a way to set it to take into account the house edge?
|
|
|
|
1982dre
|
|
June 21, 2017, 12:32:12 PM |
|
Hi guys,
Seems there's a difference between simulation and the real sites.
I've got a script that is consistently profitable in simulation, but it's not within the actual site (Primedice in this case).
Is the simulation actually a perfect game? i.e. it doesn't take in the 1% house edge?
If so, is there a way to set it to take into account the house edge?
I think the HE is also calculated in the simulation. Think you just got bad luck on PD.
|
|
|
|
momo1180
Newbie
Offline
Activity: 2
Merit: 0
|
|
June 21, 2017, 02:15:18 PM |
|
I want to add a function when x is lost, add a bet. basebet=0.1 bchance=93 chance=bchance nextbet=basebet maxbet=100 minbet=100 maxchance=93 minchance=93 randomc=100
function dobet() bethigh= math.random(0,1000)%2==0 x=math.random(0,10000) if x < randomc then nextbet = math.random(minbet,maxbet) chance=math.random(minchance*100,maxchance*100)/100 else nextbet = basebet chance=bchance end end
|
|
|
|
haybee191
Newbie
Offline
Activity: 9
Merit: 0
|
|
June 21, 2017, 03:31:15 PM |
|
hello, i would like to simply know how to add a time delay to my script, for example, to delay for say 1minute after an action , before commencing another one
|
|
|
|
|