Bitcoin Forum
April 19, 2024, 11:47:32 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
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 50 51 ... 62 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 125121 times)
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 08, 2015, 09:27:30 PM
Last edit: July 09, 2015, 08:41:51 PM by chilly2k
 #1

    This is a follow on to https://bitcointalk.org/index.php?topic=307425.0  

This is the place to discuss the programmer mode of Seuntjie's dice bot.  Also discuss the Lua language as it applies there.  

resources : http://bot.seuntjie.com/ProgrammerMode.aspx

Anything I explain here is related to the V3 B12 version of the bot.  You can get the latest version of Seuntjies Dicebot  here http://bot.seuntjie.com/botpage.aspx

To get into programmer mode click on the Settings Mode and then click on programmer



  You will see 2 panels open on the right side.  The upper panel is a reference panel of available variables, and functions.  These are only the things specific to
the bot, and not everything available.   Also you will find the open and save buttons.  A nice addition that allows you to save your programs and reload them.



  The lower panel is where your code is going to go.  It starts out prefilled with

function dobet()

end

   This is really nice since it's a major part of any program.    This is defining the function dobet.  When you start() the program this function will be called after placing each bet.  

  As time permits I will be cleaning up this post, and adding additional posts to it to explain some of the neat features that you can use with this bot.  

1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
1713570452
Hero Member
*
Offline Offline

Posts: 1713570452

View Profile Personal Message (Offline)

Ignore
1713570452
Reply with quote  #2

1713570452
Report to moderator
grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 09, 2015, 02:05:13 AM
 #2

How do you make it pause after a certain level of profit and then make it start backup automatically after the pause and restart the profit counter?

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 09, 2015, 02:46:07 AM
 #3

How do you make it pause after a certain level of profit and then make it start backup automatically after the pause and restart the profit counter?

    That's way more involved then it should be.  Ie. there is no built in way to pause a Lua script.  There is a somewhat involved solution here. http://mushclient.com/forum/?id=4956

   But I have not tried it. 

Is there a reason you NEED to pause the script.
   No wrong answer because I've had a few times where it would have come in handy.  But for the most part I haven't needed it. 

I've only tested things on JD and PRC.  And A quirk of this, once you run out of coin to bet, the bot automatically pauses. 

Now that I'm thinking a little, Do you want to pause to invest, tip or withdraw profit? 

I've tried them all on JD, and tip /withdraw on PRC.  They all work well. 

I was planning on covering this at a later time.  I use invest on JD to take profit from the bot, and setup a second user on PRC and send them tips to take profit. 

One thing to note..   Invest/ tip/ withdraw do not update your balance.  So if your using the balance to calculate your bets, you need to remember what you took out, and adjust accordingly.   

grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 09, 2015, 03:00:51 AM
Last edit: July 09, 2015, 04:23:13 AM by grendel25
 #4

How do you make it pause after a certain level of profit and then make it start backup automatically after the pause and restart the profit counter?

    That's way more involved then it should be.  Ie. there is no built in way to pause a Lua script.  There is a somewhat involved solution here. http://mushclient.com/forum/?id=4956

   But I have not tried it.  

Is there a reason you NEED to pause the script.
   No wrong answer because I've had a few times where it would have come in handy.  But for the most part I haven't needed it.  

I've only tested things on JD and PRC.  And A quirk of this, once you run out of coin to bet, the bot automatically pauses.  

Now that I'm thinking a little, Do you want to pause to invest, tip or withdraw profit?  

I've tried them all on JD, and tip /withdraw on PRC.  They all work well.  

I was planning on covering this at a later time.  I use invest on JD to take profit from the bot, and setup a second user on PRC and send them tips to take profit.  

One thing to note..   Invest/ tip/ withdraw do not update your balance.  So if your using the balance to calculate your bets, you need to remember what you took out, and adjust accordingly.  

Well, thanks.  I've ran other LUA and XML scripts and script combinations before that could use rest or pause functions.  I just don't know how to incorporate it here.  Also, the current script examples at the referenced website doesn't even do martingale correctly as far as I can tell it just makes the same bet over and over.

edit: nevermind, did some Google searches and figured it out. 

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 09, 2015, 09:06:28 PM
 #5


     We can start by using the basic Martingale script from the reference site.

chance=49.5
multiplier=2
base=0.00000010
Quote
function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end
   The 3 statements before the function statement will be executed BEFORE the first bet is made.  

chance is a variable that will be used by the bot.  
multiplier and base are internal variables just used by the script.  

    After each bet is placed function dobet is called.  

   In this case, if the bet won, the variable win will be true and the script will reset the nextbet variable to the base bet.  nextbet is a variable used by the bot when placing a bet.
   If the win variable is false, then we lost the bet.  The script will execute the else path.  This will set nextbet equal to the previous bet (previousbet) times multipler.  In this case X 2.  

   The structure LUA uses for if/then/else requires an end statement.  And the function requires an end statement.

A few things I would add to the initialization section.  I would set nextbet = base so the first bet is base on my script not what is filled in the bot's panels.
Also set bethigh  Make it true if you want to go high, false if you want to bet low.  It's as easy as bethigh = false    

So my really basic script would be.
Quote
chance=49.5
multiplier=2
base=0.00000010
nextbet = base  
bethigh = false

function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end

To execute this script, in the programmer mode section click on the console tab at the top.  This opens the LUA console.  The upper section is the output and the lower section is for input.  In the lower section you would type start() to start your script.  And stop() to stop it.  

   You can also use the built in simulator to see how your script will run.  Either from the built in simulator panel (click view, then simulate) ir by typing runsim (X,Y) into the console.  
X is your pretend starting balance
Y is the number of bets to place.  

Note:  Don't start your bot with a large balance.  A small error could cause you to lose everything.  Always start with a small amount just to test out all of your functions.  Of course use the simulator to flush out as much as you can.    

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 10, 2015, 01:07:15 AM
 #6


     We can start by using the basic Martingale script from the reference site.

chance=49.5
multiplier=2
base=0.00000010
Quote
function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end
   The 3 statements before the function statement will be executed BEFORE the first bet is made.  

chance is a variable that will be used by the bot.  
multiplier and base are internal variables just used by the script.  

    After each bet is placed function dobet is called.  

   In this case, if the bet won, the variable win will be true and the script will reset the nextbet variable to the base bet.  nextbet is a variable used by the bot when placing a bet.
   If the win variable is false, then we lost the bet.  The script will execute the else path.  This will set nextbet equal to the previous bet (previousbet) times multipler.  In this case X 2.  

   The structure LUA uses for if/then/else requires an end statement.  And the function requires an end statement.

A few things I would add to the initialization section.  I would set nextbet = base so the first bet is base on my script not what is filled in the bot's panels.
Also set bethigh  Make it true if you want to go high, false if you want to bet low.  It's as easy as bethigh = false    

So my really basic script would be.
Quote
chance=49.5
multiplier=2
base=0.00000010
nextbet = base  
bethigh = false

function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end

To execute this script, in the programmer mode section click on the console tab at the top.  This opens the LUA console.  The upper section is the output and the lower section is for input.  In the lower section you would type start() to start your script.  And stop() to stop it.  

   You can also use the built in simulator to see how your script will run.  Either from the built in simulator panel (click view, then simulate) ir by typing runsim (X,Y) into the console.  
X is your pretend starting balance
Y is the number of bets to place.  

Note:  Don't start your bot with a large balance.  A small error could cause you to lose everything.  Always start with a small amount just to test out all of your functions.  Of course use the simulator to flush out as much as you can.    

Isn't this info already in the bot.seuntjie.com website?  I thought discussion might be more productive.  Do you actually know how to make a good pause/rest/wait function into this bot or were you just teasing me?

   I'm going to continue to try and explain this for some of the folks that have limited programming experience.     Discussion is always welcome. 

No, I don't know how to do that.   http://mushclient.com/forum/?id=4956  This might help.   

Can you explain what your trying to accomplish by pausing the script?  Maybe there is another way to do what your trying to do. 

seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
July 10, 2015, 01:07:33 AM
 #7


Isn't this info already in the bot.seuntjie.com website?  I thought discussion might be more productive.  Do you actually know how to make a good pause/rest/wait function into this bot or were you just teasing me?

Why would you want to pause/rest/wait at all? The time of the bet has no influence on the result of a roll? I really don't see a point to using something like this

but since you're asking for it, you can just use sleep(milliseconds:int)

grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 10, 2015, 02:12:54 AM
 #8


Isn't this info already in the bot.seuntjie.com website?  I thought discussion might be more productive.  Do you actually know how to make a good pause/rest/wait function into this bot or were you just teasing me?

Why would you want to pause/rest/wait at all? The time of the bet has no influence on the result of a roll? I really don't see a point to using something like this

but since you're asking for it, you can just use sleep(milliseconds:int)

Awesome, thank you.  Well, the rationale is that I think the timing of the bets actually is important so I'd like to test my ideas and I'd like as much flexibility as possible to test every idea I might have until one of them actually works.  I'm a little dismayed at such doubt and would just like the freedom to explore different ideas even if they are known failures it could generate a better idea later.  I hope folks can understand this.

So this "sleep(milliseconds:int)"  Since I suck at syntax and tried/failed as soon as I saw it posted... can you elaborate on how this would actually work in a script?  For example, my intent was to stop every 10K satoshi profit for "sleep(300000)" or 'five minutes' but my code looked like this and when I ran the simulator I didn't notice any pause.  Will I notice a set 5 minute pause in the simulator?

also, I want to send a resetseed every 5 bets (I know... I know... it won't reset every 5 seeds... please enough with the Questions...)

Can you tell me how to fix this code below?  Actually, can anyone answer my original question, "How do you make it pause after a certain level of profit and then make it start backup automatically after the pause and restart the profit counter?"

Here is the code I tried:

Code:
chance=49.5
multiplier=2
base=0.00001000
resetseed=5
function dobet()
 if win & profitsincelastcycle == 0.00004000 then
  sleep(300000)
  else
  nextbet=base
  end
 if not win then
  nextbet=previousbet*multiplier
  end
 end

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 10, 2015, 03:22:27 AM
 #9


Isn't this info already in the bot.seuntjie.com website?  I thought discussion might be more productive.  Do you actually know how to make a good pause/rest/wait function into this bot or were you just teasing me?

Why would you want to pause/rest/wait at all? The time of the bet has no influence on the result of a roll? I really don't see a point to using something like this

but since you're asking for it, you can just use sleep(milliseconds:int)

Awesome, thank you.  Well, the rationale is that I think the timing of the bets actually is important so I'd like to test my ideas and I'd like as much flexibility as possible to test every idea I might have until one of them actually works.  I'm a little dismayed at such doubt and would just like the freedom to explore different ideas even if they are known failures it could generate a better idea later.  I hope folks can understand this.

So this "sleep(milliseconds:int)"  Since I suck at syntax and tried/failed as soon as I saw it posted... can you elaborate on how this would actually work in a script?  For example, my intent was to stop every 10K satoshi profit for "sleep(300000)" or 'five minutes' but my code looked like this and when I ran the simulator I didn't notice any pause.  Will I notice a set 5 minute pause in the simulator?

also, I want to send a resetseed every 5 bets (I know... I know... it won't reset every 5 seeds... please enough with the Questions...)

Can you tell me how to fix this code below?  Actually, can anyone answer my original question, "How do you make it pause after a certain level of profit and then make it start backup automatically after the pause and restart the profit counter?"

Here is the code I tried:

Code:
chance=49.5
multiplier=2
base=0.00001000
resetseed=5
function dobet()
 if win & profitsincelastcycle == 0.00004000 then
  sleep(300000)
  else
  nextbet=base
  end
 if not win then
  nextbet=previousbet*multiplier
  end
 end

Lua is a fickle language.  Your problem is not with the sleep.  resetseed is a function.  Your treating it as a variable.  If you really want to reset the seed just code resetseed()  It doesn't take a parm.   I think there was a discussion about passing in the client seed at some point but not yet. 

also profitsincelastcycle is an undefined variable.  Lua throws up on those too.

Try this
Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   if (!win) then
      nextbet=previousbet*multiplier
   end

end

 
   The only thing missing in the above code is what to set nextbet to when you hit your profit cycle.  Currently it will just end up being whatever it's set to. 

And I made the mistake of doing the sleep(30000) and running the simulator.  It hung for 30 seconds each time it hit that.  Basically hung up the bot.  So thats not a true sleep.  More a loop for that many seconds.   

grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 10, 2015, 04:42:57 AM
Last edit: July 10, 2015, 05:48:29 AM by grendel25
 #10


Lua is a fickle language.  Your problem is not with the sleep.  resetseed is a function.  Your treating it as a variable.  If you really want to reset the seed just code resetseed()  It doesn't take a parm.   I think there was a discussion about passing in the client seed at some point but not yet.  

also profitsincelastcycle is an undefined variable.  Lua throws up on those too.

Try this
Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   if (!win) then
      nextbet=previousbet*multiplier
   end

end

 
   The only thing missing in the above code is what to set nextbet to when you hit your profit cycle.  Currently it will just end up being whatever it's set to.  

And I made the mistake of doing the sleep(30000) and running the simulator.  It hung for 30 seconds each time it hit that.  Basically hung up the bot.  So thats not a true sleep.  More a loop for that many seconds.    

It's close.  Any idea what would give this error "input:18: unexpected symbol near '!'" ?  So it looks like "(!win)" is the opposite of (win).  But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo)  it doesn't like it.  

I thought in order to do the opposite we just do "not"  so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.  

EDIT::::  This solved it I think, http://www.dev-hq.net/lua/6--logical-operators  Just have to set the boolean variable to true and then you can use the "not" operator.

holy sh!t if it works lol.  I'm testing

EDIT2::  My test failed.  idk... here's what I ran.  It runs the bot but it doesn't do martingale... just bets the same thing over and over:

Code:
chance=49.5
multiplier=2
base=0.00001000
function resetseed()
profitsincelastcycle = 0
win=true

function dobet()

profitsincelastcycle = lastBet.Profit

   if win then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   if not win then
      nextbet=previousbet*multiplier
   end

end
end
end

Edit Again:  What about this below... But again, it doesn't do martingale correctly.  what am I doing wrong?

this uses "elseif" statements which seemed to work for me in some other applications in the past... of course, I really can't claim to fully understand it.

Code:
chance=49.5
multiplier=2
base=0.00001000
function resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle = lastBet.Profit

   if lastBet == win then
      nextbet=base
      elseif
      not win then nextbet=previousbet*multiplier
      elseif
      profitsincelastcycle == 0.00004000 then
        sleep(300000)
        profitsincelastcycle = 0
      end
end
end

This does martingale but I don't think the sleep part is doing anything:

Code:
chance=49.5
multiplier=2
base=0.00001000
function resetseed()
profitsincelastcycle = 0

function dobet()
if win then
nextbet=base
else
nextbet=previousbet*multiplier
end
local profitsincelastcycle = lastBet.Profit
if     profitsincelastcycle == 0.00001000 then
        sleep(300000)
        profitsincelastcycle = 0
end
end
end

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 10, 2015, 12:16:24 PM
 #11


It's close.  Any idea what would give this error "input:18: unexpected symbol near '!'" ?  So it looks like "(!win)" is the opposite of (win).  But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo)  it doesn't like it.  

I thought in order to do the opposite we just do "not"  so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.  

    The problem wasn't the !win.  Lua was expecting an end for the "if win" Statement.  I was trying to leave your logic the same but missed that end statement.  So the code is

Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   end   --  Missing end statement
   if (!win) then
      nextbet=previousbet*multiplier
   end

end


   Personally I would have handled the !win part in an else path.  But to each there own, and it's better that you understand what it's doing then I. 
 
 

grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 10, 2015, 02:34:43 PM
 #12


It's close.  Any idea what would give this error "input:18: unexpected symbol near '!'" ?  So it looks like "(!win)" is the opposite of (win).  But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo)  it doesn't like it.  

I thought in order to do the opposite we just do "not"  so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.  

    The problem wasn't the !win.  Lua was expecting an end for the "if win" Statement.  I was trying to leave your logic the same but missed that end statement.  So the code is

Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   end   --  Missing end statement
   if (!win) then
      nextbet=previousbet*multiplier
   end

end


   Personally I would have handled the !win part in an else path.  But to each there own, and it's better that you understand what it's doing then I. 
 
 

Should I be able to see the simulator pause or stop with the "sleep(300000)" command in there?  Or does that only work when it's running real bets?   When I run the sim, martingale works correctly but I don't see any sleep.

..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 10, 2015, 03:14:56 PM
 #13


It's close.  Any idea what would give this error "input:18: unexpected symbol near '!'" ?  So it looks like "(!win)" is the opposite of (win).  But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo)  it doesn't like it.  

I thought in order to do the opposite we just do "not"  so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.  

    The problem wasn't the !win.  Lua was expecting an end for the "if win" Statement.  I was trying to leave your logic the same but missed that end statement.  So the code is

Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   end   --  Missing end statement
   if (!win) then
      nextbet=previousbet*multiplier
   end

end


   Personally I would have handled the !win part in an else path.  But to each there own, and it's better that you understand what it's doing then I. 
 
 

Should I be able to see the simulator pause or stop with the "sleep(300000)" command in there?  Or does that only work when it's running real bets?   When I run the sim, martingale works correctly but I don't see any sleep.

  Did you cut/paste the above script?  Simulator will wait/loop.  It actually hangs the bot with the spinning circle thingy....

Are you incrementing profitsincelastcycle?  Are you checking the same variable?  You can check things out on the console.  type "print(profitsincelastcycle)"  no quotes, to see what that variable contains. 

grendel25
Legendary
*
Offline Offline

Activity: 2268
Merit: 1031



View Profile
July 11, 2015, 06:51:07 AM
 #14


It's close.  Any idea what would give this error "input:18: unexpected symbol near '!'" ?  So it looks like "(!win)" is the opposite of (win).  But when I run it in the Lua demo (http://www.lua.org/cgi-bin/demo)  it doesn't like it.  

I thought in order to do the opposite we just do "not"  so instead of "!win" it would be "not win" but if I do that it just bets the same bet over and over instead of doing martingale.  

    The problem wasn't the !win.  Lua was expecting an end for the "if win" Statement.  I was trying to leave your logic the same but missed that end statement.  So the code is

Code:

chance=49.5
multiplier=2
base=0.00001000
resetseed()
profitsincelastcycle = 0

function dobet()

profitsincelastcycle += lastBet.Profit

   if (win) then
      if (profitsincelastcycle == 0.00004000) then
        sleep(300000)
        profitsincelastcycle = 0
      else
        nextbet=base
      end
   end   --  Missing end statement
   if (!win) then
      nextbet=previousbet*multiplier
   end

end


   Personally I would have handled the !win part in an else path.  But to each there own, and it's better that you understand what it's doing then I. 
 
 

Should I be able to see the simulator pause or stop with the "sleep(300000)" command in there?  Or does that only work when it's running real bets?   When I run the sim, martingale works correctly but I don't see any sleep.

  Did you cut/paste the above script?  Simulator will wait/loop.  It actually hangs the bot with the spinning circle thingy....

Are you incrementing profitsincelastcycle?  Are you checking the same variable?  You can check things out on the console.  type "print(profitsincelastcycle)"  no quotes, to see what that variable contains. 

I changed profitsincelastcycle to a higher value and it seems to have froze up like you described.  Maybe .00004000 was too small a variable to reliably track  or maybe I just need to play with that value some more.  Thanks again.  When I get some bits together I'll send you a tip for your help.


..EPICENTRAL .....
..EPIC: Epic Private Internet Cash..
.
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████████████▀▀█████▄
▄████████████▀▀▀    ██████▄
████████▀▀▀   ▄▀   ████████
█████▄     ▄█▀     ████████
████████▄ █▀      █████████
▀████████▌▐       ████████▀
▀████████ ▄██▄  ████████▀
▀█████████████▄███████▀
▀█████████████████▀
▀▀█████████▀▀
.
▄▄█████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄████████▀█████▀████████▄
▄██████▀  ▀     ▀  ▀██████▄
██████▌             ▐██████
██████    ██   ██    ██████
█████▌    ▀▀   ▀▀    ▐█████
▀█████▄  ▄▄     ▄▄  ▄█████▀
▀██████▄▄███████▄▄██████▀
▀█████████████████████▀
▀█████████████████▀
▀▀█████████▀▀
.
.
[/center]
chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 12, 2015, 12:52:03 PM
 #15


     We can start by using the basic Martingale script from the reference site.

chance=49.5
multiplier=2
base=0.00000010
Quote
function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end
   The 3 statements before the function statement will be executed BEFORE the first bet is made.  

chance is a variable that will be used by the bot.  
multiplier and base are internal variables just used by the script.  

    After each bet is placed function dobet is called.  

   In this case, if the bet won, the variable win will be true and the script will reset the nextbet variable to the base bet.  nextbet is a variable used by the bot when placing a bet.
   If the win variable is false, then we lost the bet.  The script will execute the else path.  This will set nextbet equal to the previous bet (previousbet) times multipler.  In this case X 2.  

   The structure LUA uses for if/then/else requires an end statement.  And the function requires an end statement.

A few things I would add to the initialization section.  I would set nextbet = base so the first bet is base on my script not what is filled in the bot's panels.
Also set bethigh  Make it true if you want to go high, false if you want to bet low.  It's as easy as bethigh = false    

So my really basic script would be.
Code:
chance=49.5
multiplier=2
base=0.00000010
nextbet = base  
bethigh = false

function dobet()
   if win then
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end

To execute this script, in the programmer mode section click on the console tab at the top.  This opens the LUA console.  The upper section is the output and the lower section is for input.  In the lower section you would type start() to start your script.  And stop() to stop it.  

   You can also use the built in simulator to see how your script will run.  Either from the built in simulator panel (click view, then simulate) ir by typing runsim (X,Y) into the console.  
X is your pretend starting balance
Y is the number of bets to place.  

Note:  Don't start your bot with a large balance.  A small error could cause you to lose everything.  Always start with a small amount just to test out all of your functions.  Of course use the simulator to flush out as much as you can.    


So we left off with the basic martingale bot setting the correct first bet.   

But there is no way to stop this other then issuing the stop() command.   

This is where we can use one of the neat things about LUA.  You can set variables from the console. 

So were going to initialize a variable called stoponwin to false.  Then check this in our win path.  The variable will always be false till we change it on the console.  So our new code will not be.

Code:
chance=49.5
multiplier=2
base=0.00000010
nextbet = base   
bethigh = false
stoponwin -- new variable

function dobet()
   if win then
      if (stoponwin) then stop() end -- check new variable.   
      nextbet=base
   else
      nextbet=previousbet*multiplier
   end
end

so now if we wanted to stop the bot once a series is finished we can issue "stoponwin = true" at the console, and the bot will stop the next time it wins. 

 

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 22, 2015, 09:16:30 PM
 #16



   New bot program I wanted to share. 
This does a lot of advanced stuff, but the gist of it is.

Start betting with .00000001 at 39.6% (2.5X)
once you win increase the bet using the multiplier.

if you lose cut the multiplier in half and wait for 2 loses in a row.
Once you hit at least 2 in a row, on the next win try the big bet using the new multiplier.
Keep doing this till you either win a big bet or run out of funds.
Since we're always dividing the multiplier in half eventually is gets small enough that you large bets start getting smaller and will not cover your loses. 
once it gets below 1.85, it will always use that.  That will cover your loses. 

There is also a Target value
and a savefactor value.

Once the balance increase to more then the target value, the difference gets invested.  And the new target gets set.  The balance will continue to build but you will be saving some of your funds. 

  The savefactor is the same idea on a larger level.  The bot saves your starting balance and once your balance reaches the startbalance * savefactor, it invests everything over your starting balance.  It's currently set to 1.25  If I start with 10 coins, once I reach 12.5, it will invest 2.5, and I'll be back to gambling with 10.

There is a variable called stopnow.  If you issue stopnow = true on the console, the bot will stop once you've won a big bet.  This keeps you from stopping in the middle of a series. 



Code:
chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
go = false
set = false


function dobet()

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = nextwinbet
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 23, 2015, 02:43:11 AM
 #17



   New bot program I wanted to share. 
This does a lot of advanced stuff, but the gist of it is.

Start betting with .00000001 at 39.6% (2.5X)
once you win increase the bet using the multiplier.

if you lose cut the multiplier in half and wait for 2 loses in a row.
Once you hit at least 2 in a row, on the next win try the big bet using the new multiplier.
Keep doing this till you either win a big bet or run out of funds.
Since we're always dividing the multiplier in half eventually is gets small enough that you large bets start getting smaller and will not cover your loses. 
once it gets below 1.85, it will always use that.  That will cover your loses. 

There is also a Target value
and a savefactor value.

Once the balance increase to more then the target value, the difference gets invested.  And the new target gets set.  The balance will continue to build but you will be saving some of your funds. 

  The savefactor is the same idea on a larger level.  The bot saves your starting balance and once your balance reaches the startbalance * savefactor, it invests everything over your starting balance.  It's currently set to 1.25  If I start with 10 coins, once I reach 12.5, it will invest 2.5, and I'll be back to gambling with 10.

There is a variable called stopnow.  If you issue stopnow = true on the console, the bot will stop once you've won a big bet.  This keeps you from stopping in the middle of a series. 



Code:
chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
go = false
set = false


function dobet()

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = nextwinbet
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end

New updated version to use a table to place the bets.  Bot will stop once the table has been run.  IE all bets in the table have lost. 

Also changed so now 2 wins or 2 loses will enable the next bet from the table on a win.   Values in the table are just for my own amusement and don't mean anything.
Also your mileage may vary....

Code:
chance = 39.6
winbets = {.00000040,
                     .00000400,
                     .00000800,
                     .00001600,
                     .00032000,
                      .00064000,
                      .0020,
                      .0040,
                       .01,
                       .04,
                        .1,
                        .2}
maxbets = #winbets                 
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = 1
go = false
set = false


function dobet()

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = winbets[nextwinbet]
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        nextwinbet = 1   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
    if (wincount == 2) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet += 1
      if (nextwinbet > maxbets) then stop() end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end

plost24
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


View Profile
July 23, 2015, 08:35:57 AM
 #18

can i know what is the difference  between this one and in other site

For rent 1.4 Bitcoin for 11 months starting Feb 1 2017
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
July 23, 2015, 08:41:24 AM
 #19



   New bot program I wanted to share. 
This does a lot of advanced stuff, but the gist of it is.

Start betting with .00000001 at 39.6% (2.5X)
once you win increase the bet using the multiplier.

if you lose cut the multiplier in half and wait for 2 loses in a row.
Once you hit at least 2 in a row, on the next win try the big bet using the new multiplier.
Keep doing this till you either win a big bet or run out of funds.
Since we're always dividing the multiplier in half eventually is gets small enough that you large bets start getting smaller and will not cover your loses. 
once it gets below 1.85, it will always use that.  That will cover your loses. 

There is also a Target value
and a savefactor value.

Once the balance increase to more then the target value, the difference gets invested.  And the new target gets set.  The balance will continue to build but you will be saving some of your funds. 

  The savefactor is the same idea on a larger level.  The bot saves your starting balance and once your balance reaches the startbalance * savefactor, it invests everything over your starting balance.  It's currently set to 1.25  If I start with 10 coins, once I reach 12.5, it will invest 2.5, and I'll be back to gambling with 10.

There is a variable called stopnow.  If you issue stopnow = true on the console, the bot will stop once you've won a big bet.  This keeps you from stopping in the middle of a series. 



Code:
chance = 39.6
martimulti = 40
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = basebet * martimulti
go = false
set = false


function dobet()

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = nextwinbet
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        martimulti = 40
        nextwinbet = basebet * martimulti   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet = previousbet * martimulti
      martimulti = martimulti / 2
      if (martimulti < 1.85) then martimulti = 1.85 end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end

New updated version to use a table to place the bets.  Bot will stop once the table has been run.  IE all bets in the table have lost. 

Also changed so now 2 wins or 2 loses will enable the next bet from the table on a win.   Values in the table are just for my own amusement and don't mean anything.
Also your mileage may vary....

Code:
chance = 39.6
winbets = {.00000040,
                     .00000400,
                     .00000800,
                     .00001600,
                     .00032000,
                      .00064000,
                      .0020,
                      .0040,
                       .01,
                       .04,
                        .1,
                        .2}
maxbets = #winbets                 
basebet = .00000001
startbalance = balance
nextbet = basebet
savefactor = 1.25
target = .01
targetbalance = balance + target
bethigh = true
low = 0
high = 0
losecount = 0
stopnow = false
totallose = 0
wincount = 0
nextwinbet = 1
go = false
set = false


function dobet()

if (lastBet.roll < chance) then
  low += 1
end
if (lastBet.roll > (100 - chance)) then
  high += 1
end

if (win) then
   wincount += 1
   totallose = 0
   newbalance = balance
   if (high > low) then
     bethigh = true
    else
      bethigh = false
    end
  if (wincount == 1 and go) then
     nextbet = winbets[nextwinbet]
     go = false
      set = false
  else
      nextbet = basebet
  end
   if (wincount == 2 and previousbet != basebet) then
      if (stopnow) then stop() end
        nextwinbet = 1   
        set = true
       losecount = 0
      if (balance > targetbalance) then
         invest((balance - targetbalance)+target)
         targetbalance = targetbalance + target
         newbalance = targetbalance
      end
      if (newbalance > startbalance * savefactor) then
          invest(balance-startbalance)
          targetbalance = startbalance + target
          startbalance = startbalance * savefactor
      end
   end
    if (wincount == 2) then go = true end
 else
   if (wincount == 1 and previousbet != basebet ) then
      nextwinbet += 1
      if (nextwinbet > maxbets) then stop() end
      losecount += 1
      print(losecount)
   else
     
   end
   wincount = 0
   totallose = totallose + 1
   if (totallose == 2) then go = true end
   nextbet = basebet
 end
 
end


Mind uploading these to bot.seuntjie.com/scripts.aspx?mode=new   ? You'll need to register an account, but it only needs a username and password.

chilly2k (OP)
Legendary
*
Offline Offline

Activity: 1007
Merit: 1000


View Profile
July 24, 2015, 02:52:28 AM
 #20


Mind uploading these to bot.seuntjie.com/scripts.aspx?mode=new   ? You'll need to register an account, but it only needs a username and password.

   I added them,  I forgot to title the first.  And when I submitted the second I'm not sure if it took or not.  If you don't see it let me know.  I saved the update just in case. 

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 50 51 ... 62 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!