Bitcoin Forum
May 06, 2024, 11:11:46 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 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 52 53 54 [55] 56 57 58 59 60 61 62 »
  Print  
Author Topic: Seuntjie' Dice bot programmers mode discussion.  (Read 125132 times)
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 01, 2018, 07:43:43 PM
 #1081

noo,not training bot,training myself Grin
safebet 21sats in this script means it goes up and up and up...
turbo means that i stop bot and chance 21sats to 1000sats and hit start...
like i use it both automatic and manually.automatic(21sat) i watch and wait when is time to attack and then chance it to turbo(1000sat).
yeah,only i wanted to know is there any program where i can train myself...you know like samurais do Wink
Right... you seem to have missed the point of the programmer mode then... you should be able to code that sort of behaviour into your script.

It should be possible to get it to check for the conditions that you are looking for... ie. X losses in a row... and then set the bet/chance to whatever value you like... and then reset on a win etc without you needing to intervene.



what is the function for reseting seed after like 1000 bets. and where should i put it before the function dobet()? or after??
Firstly, resetseed() only works on a limited number of sites... they don't all support that functionality.

If you want it to be every 1000 bets, you would need to put it inside function dobet()... if it is before, it will only ever be run once, before the bot starts betting... The dobet() function is executed after every bet is placed and the result is returned from the betting site. You can see the "flow" here: https://steemit.com/dicebot/@seuntjie/dicebot-programmer-mode-tutorial-02-process

So, you need to create a "counter", check it after every bet... once it hits 1000 (or whatever number), you call resetseed() function (assuming your site supports it) and then set the counter back to zero... like this:
Code:
-- script setup stuff goes here --
...
myCounter = 0
maxCount = 1000
...
function dobet()
...
  myCounter = myCounter + 1
  if myCounter >= maxCount then
    resetseed()
    myCounter = 0
  end
...
  --rest of your script goes here--
...
end

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
1715037106
Hero Member
*
Offline Offline

Posts: 1715037106

View Profile Personal Message (Offline)

Ignore
1715037106
Reply with quote  #2

1715037106
Report to moderator
1715037106
Hero Member
*
Offline Offline

Posts: 1715037106

View Profile Personal Message (Offline)

Ignore
1715037106
Reply with quote  #2

1715037106
Report to moderator
1715037106
Hero Member
*
Offline Offline

Posts: 1715037106

View Profile Personal Message (Offline)

Ignore
1715037106
Reply with quote  #2

1715037106
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715037106
Hero Member
*
Offline Offline

Posts: 1715037106

View Profile Personal Message (Offline)

Ignore
1715037106
Reply with quote  #2

1715037106
Report to moderator
marse123
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
December 01, 2018, 08:55:18 PM
 #1082

Hah haa,good,HCP,very good

I would like to do that,but im pretty sure that im not able to do that.Would you or someone else help me?

Also one silly question,one guy said that its better to have more scrips and bots than one.He says that if run same script over and over,its gonna get bust.What s..t its that,for me it sounds like BS,but gotta ask,never know Wink











HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 02, 2018, 01:30:41 AM
 #1083

I would like to do that,but im pretty sure that im not able to do that.Would you or someone else help me?
Why are you not able to do that? Huh You just need to type the code into the script you are using... it isn't that difficult. Just don't include the "..." which I put to show where to put the code in relation to the function dobet().

put these two lines BEFORE function dobet()
Code:
myCounter = 0
maxCount = 1000

put these lines immediately AFTER the line that says function dobet()
Code:
  myCounter = myCounter + 1
  if myCounter >= maxCount then
    resetseed()
    myCounter = 0
  end
easy! Wink


Quote
Also one silly question,one guy said that its better to have more scrips and bots than one.He says that if run same script over and over,its gonna get bust.What s..t its that,for me it sounds like BS,but gotta ask,never know Wink
If they were trying to imply that sites will figure out your script and then cheat and make you go bust... they're a conspiracy theorist idiot. There is no way that a legit, provably fair dice site can do that.

The reason you will go bust if you just play over and over... is the maths of probabilities, "expected value" and "house edge". Basically... the "house always wins".

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
marse123
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
December 02, 2018, 08:52:30 AM
 #1084

thanks

gotta think and put my thaughs to order

site where im playing is 999dice.
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
January 16, 2019, 06:45:48 AM
 #1085

I really do not understand what you want to do... also, it seems like you only posted a part of the script. And the script seems extremely long and redundant. You should be able to simplify it significantly if you use a bit of math.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 19, 2019, 02:32:38 AM
 #1086

As I was trying to explain via PM... you need to provide some sort of context to this script...

What site was it being used on? And what is the underlying logic? It isn't just an easy "copy/paste/change a couple of variable names" to convert this Javascript to a functioning LUA script for the dicebot that has the same functionality.

What I am fairly sure of is that the dicebot script that you tried to write doesn't do anything close to what that Javascript is attempting to do... the "numbers" just don't match. Huh

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 25, 2019, 04:38:45 PM
Last edit: January 25, 2019, 06:42:18 PM by sleepyeyed
 #1087

Need some help with programming what would seem to be a simple thing.

What I'd like to do is set a condition where after one win followed by one loss and if the bet is above 20 units the bet resets to base. If it loses then a multiplier is added to the next bet. So if I have LLLWLW situation it will reset to base but only if the next bet is over 20 units. It works as I like except for the problem that it will randomly to base unexpectedly in certain places. I think count2 is to blame in this script, I just can't figure it out.
Code:
nextbet=basebet
count2=0
count3=0
count4=0
function dobet()
count=0
basebet=10
chance=33
count3=count3+1
if count3>3 then
count3=1;count2=0
end
if win then
count=count+1
end
if !win then
count2=count2+1
end
if nextbet>20 then
count=count+2
end
if win then nextbet=previousbet*.75
end
if !win then nextbet=previousbet*1.15
end
if count2==1 and count==3
then count4=1
end
if count4==1 and win then
nextbet=basebet;count4=0
end
if nextbet<10 then
nextbet=basebet
end
end
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 25, 2019, 08:01:01 PM
 #1088

With the logic you have... nextbet is reset to basebet because of:
Quote
if count4==1 and win then
  nextbet=basebet;count4=0
end
or
Quote
if nextbet<10 then
  nextbet=basebet
end


For the 2nd option, nextbet will be less than basebet (10) after a couple of wins in a row... due to:
Quote
if win then nextbet=previousbet*.75
end


For the "count4==1 and win" condition, count4 is set to 1 when "count2==1 and count==3":
Quote
if count2==1 and count==3
then count4=1
end


Each bet, count is initially set to 0, then 1 if it's a win... then 2 added if nextbet is > 20... the problem you have is that the nextbet calculations are done AFTER the nextbet check!
Quote
if nextbet>20 then  <-- nextbet is checked here
count=count+2
end
if win then nextbet=previousbet*.75  <-- but nextbet isn't set until here!!
end
if !win then nextbet=previousbet*1.15 <-- or here!!
end

Because of this, the nextbet>20 resolving to "true", might be occurring a bet later than you think and thus causing you some confusion:

Bet amount: 18 -> LOSS
nextbet >20? false
if !win then nextbet = previousbet * 1.15 = 18 *1.15 = 20.7

Bot is now going to bet 20.7!

Bet: 20.7 -> WIN
nextbet >20? TRUE
if win then nextbet = previousbet * 0.75 = 20.7 * .75 = 15.525

Bot would try to bet 15.525, but the bet nextbet has already be checked, so now count==3, which means it could be possible for it to get into the "if count2==1 and count==3" section and set count4==1 and with the win could trigger the reset to base.

I suspect that this might be causing the "random" resets... 


I've taken the liberty of tidying up the code, and refactoring it slightly... see if this works... NOTE: UNTESTED!
Code:
basebet=10
nextbet=basebet
count2=0
count3=0
count4=0

function dobet()
  count=0

  chance=33
  count3=count3+1

  if count3>3 then
    count3=1;count2=0
  end

  if win then
    count=count+1
    nextbet=previousbet*.75
  else
    count2=count2+1
    nextbet=previousbet*1.15
 end

  if nextbet>20 then
    count=count+2
  end

  if count2==1 and count==3 then
    count4=1
  end
  if count4==1 and win then
    nextbet=basebet
    count4=0
  end

  if nextbet<10 then
    nextbet=basebet
  end

end

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 25, 2019, 10:44:59 PM
Last edit: January 26, 2019, 03:55:48 PM by sleepyeyed
 #1089

Thanks for the help and formatting the code. I'm obviously not a programmer. I think you're right about the count4 being triggered. It works better now, but does reset to base after a few losses and a win. Can't really mess with it too much now, but will update if I figure it out. If anyone else wants to give it a go then the more the merrier.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 26, 2019, 09:01:58 PM
 #1090

Thanks for the help and formatting the code. I'm obviously not a programmer. I think you're right about the count4 being triggered. It works better now, but does reset to base after a few losses and a win. Can't really mess with it too much now, but will update if I figure it out. If anyone else wants to give it a go then the more the merrier.
That will be because of the count3 > 3 setting count2=0 setup.

So basically, if you get 3 losses in a row, followed by a win (with nextbet > 20), I think the conditions are setup that it will reset.

Based on your previous description of your algorithm...
Quote
What I'd like to do is set a condition where after one win followed by one loss and if the bet is above 20 units the bet resets to base. If it loses then a multiplier is added to the next bet. So if I have LLLWLW situation it will reset to base but only if the next bet is over 20 units.
Did you actually mean one loss followed by one win? Huh That is to say, you have the pattern xxxxxWLW? or did you mean that it should be xxxxLWL?

I don't see how LLLWLW is one win followed by one loss and then you check the bet size... as you've already completed a 3rd bet and won.

If you can clarify exactly what you're after, I think it shouldn't be too difficult to code up something.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 26, 2019, 10:23:01 PM
Last edit: January 26, 2019, 11:16:42 PM by sleepyeyed
 #1091

Quote
xxxxxWLW

Yes, this. The LLL was just for demonstrative purposes.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 27, 2019, 12:15:56 AM
 #1092

ok... so after a "WL"... if we have a win and nextbet is > 20, we should reset... else if we have a loss we should increase as per the multiplier...

This code should do that... it will ONLY reset to basebet if you get "WLW" sequence... and the nextbet is going to be > 20:
Code:
------------------------------------------------------------------------------
-- Script for sleeyeyed
-- by HCP
------------------------------------------------------------------------------
-- NOT TESTED THOROUGHLY, use at own risk.
------------------------------------------------------------------------------
basebet=10
nextbet=basebet
chance=33
previousResult1 = false
previousResult2 = false

function dobet()

  if win then
    nextbet=previousbet*.75
    if previousResult2 == true and previousResult1 == false and nextbet > 20 then
      -- WLW sequence with nextbet > 20, so reset to basebet
      nextbet = basebet
    end
  else
    nextbet=previousbet*1.15
  end

  if nextbet < 10 then
    nextbet = basebet
  end

  -- keep track of previous 2 results
  previousResult2 = previousResult1
  previousResult1 = win

end

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 27, 2019, 01:19:57 AM
 #1093

Looks nice. I wont be able to run it until Monday, but I'll let you know how it works out when I do.
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 28, 2019, 01:53:29 PM
Last edit: January 28, 2019, 05:26:29 PM by sleepyeyed
 #1094

Works great! Thanks HCP. Ok, so for some more fun could we add a condition where it will reset to base after a WLLW and a WLLLW situation at the same time that the WLW condition is also running? My mind is having trouble deciphering the logic here. I'm guessing there needs to be a previousResult3 and previousResult4 in there, but don't know how to place it correctly.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 28, 2019, 07:11:22 PM
 #1095

If you are wanting to do that, it would probably be better to use a "table" to hold the last X results... rather than creating a bunch of similarly named variables. It'll be more flexible and provide for easier expansion.

Code:
------------------------------------------------------------------------------
-- Script v2 for sleeyeyed
-- by HCP
------------------------------------------------------------------------------
-- NOT TESTED THOROUGHLY, use at own risk.
------------------------------------------------------------------------------
basebet=10
nextbet=basebet
chance=33
streakTable = {}

function dobet()

  -- keep track of last 5 results
  for i=5,2,-1 do
      streakTable[i] = streakTable[i-1]
  end
  streakTable[1] = win

  if win then
    nextbet=previousbet*.75
    if (streakTable[2] == false and streakTable[3] == true and nextbet > 20) or
      (streakTable[2] == false and streakTable[3] == false and streakTable[4] == true and nextbet >20) or
      (streakTable[2] == false and streakTable[3] == false and streakTable[4] == false and streakTable[5] == true and nextbet >20) then
      -- WLW or
      -- WLLW or
      -- WLLLW sequence with nextbet > 20, so reset to basebet
      nextbet = basebet
    end
  else
    nextbet=previousbet*1.15
  end

  if nextbet < 10 then
    nextbet = basebet
  end

end

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 28, 2019, 08:17:15 PM
 #1096

Nice. That's super elegant and works well. It's easy to modify too. Thanks again, you rock dude.
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 29, 2019, 07:01:18 PM
 #1097

Now I've got another new idea unrelated to my previous one. Lets say I want to analyze a group of bets, 100 for instance, and I want to be able to bet a multiplier based on whether or not a certain profit has happened. So in 100 bets if there is 50 or more units of profit then nextbet=basebet otherwise nextbet=previousbet*multiplier for another 100 bets. Rinse and repeat.
seuntjie
Legendary
*
Offline Offline

Activity: 1717
Merit: 1125



View Profile WWW
January 29, 2019, 07:55:49 PM
 #1098

Now I've got another new idea unrelated to my previous one. Lets say I want to analyze a group of bets, 100 for instance, and I want to be able to bet a multiplier based on whether or not a certain profit has happened. So in 100 bets if there is 50 or more units of profit then nextbet=basebet otherwise nextbet=previousbet*multiplier for another 100 bets. Rinse and repeat.

Be sure to take a loot at the bet history functions on https://steemit.com/seuntjie/@seuntjie/dicebot-programmer-mode-tutorial-01-2-functions. For the query function, you need to specify the whole select statement.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
January 29, 2019, 08:16:17 PM
 #1099

Are you talking about a snapshot of the current "profit" after 100 bets? or are you wanting to do something a little more complex?

If it is a simple "what is current profit after 100 bets" scenario, I would personally just have a counter and a "startBalance" variable...

Code:
... stuff ...
startBalance = balance
count = 0

function dobet()
 
  ...
 
  count = count + 1
  nextbet = previousbet * multiplier
  if count >= 100 then
    count = 0 -- reset counter
    -- check profit
    if balance - startBalance >= 50 then
      nextbet=basebet
      startBalance = balance -- reset "profit" base value
    end
  end

  ... other stuff ...

end

If it is something more complex, then the bet history functions might be a better idea.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
sleepyeyed
Newbie
*
Offline Offline

Activity: 23
Merit: 1


View Profile
January 30, 2019, 12:32:05 AM
 #1100

That code will work for my purposes for now, but eventually I'd like to create something that can calculate the probabilities of wins or losses based on number of wins and also based on what numbers have come up. Then I'd adjust my multiplier and/or basebet based on the probabilities. I'm looking at the bet history functions and they're a bit over my head, but I am at least learning more as I go along.
Pages: « 1 ... 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 52 53 54 [55] 56 57 58 59 60 61 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!