Bitcoin Forum
November 20, 2017, 09:31:32 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 [38] 39 40 41 42 43 44 45 46 47 48 49 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 50546 times)
B4RF
Hero Member
*****
Offline Offline

Activity: 730


View Profile
June 13, 2017, 05:21:40 PM
 #741

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.

1511170292
Hero Member
*
Offline Offline

Posts: 1511170292

View Profile Personal Message (Offline)

Ignore
1511170292
Reply with quote  #2

1511170292
Report to moderator
Join ICO Now Coinlancer is Disrupting the Freelance marketplace!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Phyzyprogrammer
Member
**
Offline Offline

Activity: 83

Visit www.btcscriptbot.wordpress.com to get latest


View Profile WWW
June 13, 2017, 09:14:12 PM
 #742

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  Cry spinning

well... as has been explained several times... an "if-then-else" statement is in the form:

Quote
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. Tongue

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 Roll Eyes

Quote
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
Sr. Member
****
Online Online

Activity: 420

<insert witty quote here>


View Profile
June 14, 2017, 02:19:45 AM
 #743

still here guys
Cool story bro... Roll Eyes

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 google

While 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...  Angry

#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  Cry spinning
Once again... an "if-then-else" statement is in the form:

Quote
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!

Quote
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 Offline

Activity: 24


View Profile
June 14, 2017, 08:07:14 AM
 #744

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
Sr. Member
****
Online Online

Activity: 420

<insert witty quote here>


View Profile
June 14, 2017, 10:02:20 AM
 #745

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 Wink

Code:
...
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 Offline

Activity: 1433



View Profile WWW
June 14, 2017, 10:51:14 AM
 #746

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 Wink

Code:
...
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.

Code:
...
function dobet()
  ...
  if win then
    ...
  else
    if currentstreak%3==0 then
      nextbet = previousbet * multiplier
    end
    ...
  end

end


Phyzyprogrammer
Member
**
Offline Offline

Activity: 83

Visit www.btcscriptbot.wordpress.com to get latest


View Profile WWW
June 14, 2017, 12:52:56 PM
 #747

Not cool bro, Huh but i really dont blame you  Roll Eyes
really not cool but thankx anyways it worked now

still here guys
Cool story bro... Roll Eyes

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 google

While 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...  Angry

#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  Cry spinning
Once again... an "if-then-else" statement is in the form:

Quote
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!

Quote
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
Hero Member
*****
Offline Offline

Activity: 658


MatrixCoin - Creating Bright Future Together


View Profile
June 18, 2017, 12:55:40 AM
 #748

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.


██████████.......█████......
████████████.....███████.....
███....█████.....███████.....
███....█████.....███████.....
████....██████...█████████....
██████......██████████...█████████....
█████......██████......████....██...█████████....
█████......██████......████....███.███████████...
█████......██████......████....███.███████████...
███...................█████████████████.███████████...
███..███..█████.......██████████.████████████.█████████..
███..█████.......██████████.████████████.█████████..
█████.......██████████.████████████.█████████..
██████......███...███████████...██████████.
██████......███...███████████...██████████.
██████......███...███████████...██████████.
██████......██.....█████████.....██████████
██████████.....█████████.....██████████
██████████.....█████████.....██████████
   
██
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █

█  ██  █

█  ██  █

█  ██  █

█  ██  █

██
   
██
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █
█  ██  █

█  ██  █

█  ██  █

█  ██  █

█  ██  █

██
   
➤  TWITTER
➤  FACEBOOK
➤  INSTAGRAM
HCP
Sr. Member
****
Online Online

Activity: 420

<insert witty quote here>


View Profile
June 18, 2017, 02:28:12 AM
 #749

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

Code:
...
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 Offline

Activity: 6


View Profile
June 19, 2017, 06:56:27 PM
 #750

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
Hero Member
*****
Offline Offline

Activity: 574


Mod @ DuckDice


View Profile WWW
June 21, 2017, 12:32:12 PM
 #751

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.

    ████████
    ████████
  ████████
  ████████
████████
████████
████████
  ████████
  ████████
    ████████
    ████████
DUCK
▄▄█████████▄▄
▄██████████████████▄
▄█████████████████████████▄
▄█████████████████████████████▄
█████████████████████████████████
███████████████████████████████████
█████████████████████████████████████
█████████████████████████████████████
█████████████████████████████████████
█████████████████████████████████████
█████████████████████████████████████
█████████████████████████████████
█████████████████████████████████
▀█████████████████████████████▀
▀█████████████████████████▀
▀███████████████████▀
▀▀█████████▀▀
DICE████████
████████
  ████████
  ████████
    ████████
    ████████
    ████████
  ████████
  ████████
████████
████████
momo1180
Newbie
*
Offline Offline

Activity: 2


View Profile
June 21, 2017, 02:15:18 PM
 #752

I want to add a function when x is lost, add a bet.

Code:
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 Offline

Activity: 9


View Profile
June 21, 2017, 03:31:15 PM
 #753

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
HCP
Sr. Member
****
Online Online

Activity: 420

<insert witty quote here>


View Profile
June 22, 2017, 01:35:21 AM
 #754

I want to add a function when x is lost, add a bet.
I assume you mean that when x < 100, and the "random" bet is made and loses... that you want to be able to do something specific?

In that case, add a boolean flag that indicates whether or not the last bet was an "x" bet...

Code:
basebet=0.1
bchance=93
chance=bchance
nextbet=basebet
maxbet=100
minbet=100
maxchance=93
minchance=93
randomc=100

bettingX = false

function dobet()
  if not bettingX then
    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
      bettingX = true
    else
      nextbet = basebet
      chance=bchance
      bettingX = false
    end
  else
    if not win then
      --Your X bet just lost, so "add your bet" here
      .. add a bet ..
      bettingX = true ?? I don't know if you want to continue adding bets or not, you didn't say
    else
      -- guessing you want it to reset on a win?
      nextbet = basebet
      chance=bchance
      bettingX = false
    end
  end
end

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

you should be able to put in a simple blocking delay using something like:

Code:
delay = 60 -- measured in seconds

local start = os.clock()
while os.clock() - start < delay do end

B4RF
Hero Member
*****
Offline Offline

Activity: 730


View Profile
June 22, 2017, 06:09:03 AM
 #755


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

you should be able to put in a simple blocking delay using something like:

Code:
delay = 60 -- measured in seconds

local start = os.clock()
while os.clock() - start < delay do end

The only problem with sleep functions like this is that they consume processor time.

But without external libraries I dont really know any better solution.

Is it possible to import lua libraries in the seuntje bot?

HCP
Sr. Member
****
Online Online

Activity: 420

<insert witty quote here>


View Profile
June 23, 2017, 03:49:47 AM
 #756

Yeah... it's a kludge... but it works... Tongue

If it is just the betting speed you're trying to slow down, you can always set the bet speed in advanced settings to slow the bot down... that will effectively put a delay in to every call to dobet() function.

That solution doesn't let you specify the exact "location" in your script of the delay... but if you're wanting a 1 minute delay to give you time to react and/or stop the bot, it should probably achieve that goal.

sree6020
Jr. Member
*
Offline Offline

Activity: 33


View Profile
June 27, 2017, 07:17:28 PM
 #757

When I select reset seed after 1 win check box ,it just delays the seed change if the win happens earlier.I want the betting to stop if the win happens earlier and only continue betting after a seed change.In short I just want to take only one win from a seed .
Is there any program or code that can do this job.
chilly2k
Legendary
*
Offline Offline

Activity: 948


View Profile
June 27, 2017, 08:50:17 PM
 #758

When I select reset seed after 1 win check box ,it just delays the seed change if the win happens earlier.I want the betting to stop if the win happens earlier and only continue betting after a seed change.In short I just want to take only one win from a seed .
Is there any program or code that can do this job.

    There is a resetseed() function.  But you do not know if it worked or not.  At least I don't.  That being the case, you have to know if the site your using allows the reset seed after an amount of time, or number of bets.  If it's number of bets you could use a counter to keep track of the number of bets, and if you win before the counter reaches your goal, you can stop().  Else do the resetseed() and continue. 

  If anyone know if the resetseed() provides a return code you can check, it would make this a little more fool proof.... 

maverick528
Full Member
***
Offline Offline

Activity: 121


View Profile
July 01, 2017, 01:31:08 PM
 #759

chilly2k, wanted to thank you very much for this topic.
While I programmed in several languages long time ago, Im slowly reading all your topic now to learn about LUA, and the interaction with dicebot.
What I want to do is a script for my personal variation of martingale, but the most important thing other than the amount of the bets is that on certain conditions to switch bets from HIGH to LOW and viceversa, and also maybe change multiplier settings on the fly.
I am going to use it only on PrimeDice.
Thanks again.




thrilled
Newbie
*
Offline Offline

Activity: 14


View Profile
July 01, 2017, 02:51:07 PM
 #760

Quick and most likely an easy question for you...

The scripts I have been testing by copy and pasting in and running start() only executes one time.... can I in some way make it execute repeatingly?

/T
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 [38] 39 40 41 42 43 44 45 46 47 48 49 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!