Welcome, Guest. Please login or register.
June 03, 2023, 09:40:32 PM
Home Help Login Register
News:

Shanky Technologies Poker Bot Support Forum  |  General Category  |  PPL Support (Moderator: sngbot)  |  Topic: ensuring the basic logic here works before I move on 0 Members and 1 Guest are viewing this topic.
Pages: [1] Print
Author Topic: ensuring the basic logic here works before I move on  (Read 1035 times)
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« on: November 17, 2022, 10:08:46 AM »

I have started to work on pre-flop logic for my first PPL bot. I have the first sequence complete I think but would like feedback on what I have so far (please note the hands indicated are not the actual ones I use in the strategy. They are placeholders).

The first block is quite tedious (thank god for copy paste!) but I am hoping the second block would work as intended.

Code:
custom
preflop
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 0 and calls = 1 raise 5 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 0 and calls = 2 raise 6 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 0 and calls = 3 raise 7 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 0 and calls = 4 raise 8 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 0 and calls = 5 raise 9 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 1 and calls = 1 raise 4 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 1 and calls = 2 raise 5 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 1 and calls = 3 raise 6 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 1 and calls = 4 raise 7 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises = 1 and calls = 5 raise 8 force
When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34) and raises >= 2 fold force

When inBigBlind and botsactionsonthisround = 0 and (hand = 22 or hand = 23 or hand = 34)
When raises = 0 and calls = 1 raise 5 force
When raises = 0 and calls = 2 raise 6 force
When raises = 0 and calls = 3 raise 7 force
When raises = 0 and calls = 4 raise 8 force
When raises = 0 and calls = 5 raise 9 force
When raises = 1 and calls = 1 raise 4 force
When raises = 1 and calls = 2 raise 5 force
When raises = 1 and calls = 3 raise 6 force
When raises = 1 and calls = 4 raise 7 force
When raises = 1 and calls = 5 raise 8 force
When raises >= 2 fold force

hopefully I can work it like the second block but if not oh well. Just looking to make my code as clean as possible.
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #1 on: November 17, 2022, 01:58:02 PM »

Second block type is fine. Both of the blocks do same thing.

I usually use “botslastaction = none” preflop instead of botsactionsonthisround. I am on my phone and don’t have the ppl guide handy, but check and make sure botsactionsonthisround does not say “post-flop only”. I forget off my head.

Also, for the lines where raises = 1, you need to define how large the raises are with “amounttocall <= 3 “ or something similar or else you will be raising ANY size raise including all ins from opponent.
Logged

My life is a "missed click restoring state"
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« Reply #2 on: November 17, 2022, 10:56:37 PM »

Second block type is fine. Both of the blocks do same thing.

Thanks mate! I wasn't 100% sure I had it correct Smiley I'll carry on from this point with the second block. More efficient and all that!

I usually use “botslastaction = none” preflop instead of botsactionsonthisround. I am on my phone and don’t have the ppl guide handy, but check and make sure botsactionsonthisround does not say “post-flop only”. I forget off my head.

From the manual:
Quote
BotsActionsOnThisRound – the number of actions taken on the current betting round which involve putting chips in the
pot (calling or raising). Checks are not counted as an action.

BotsLastAction - whatever action the bot took last, good for handling raises after you act. This variable has its own
special values which are: none, beep, raise, bet, call, or check. The only comparator allowed is ‘=’.

If I am reading this correctly, either should be fine in my situation.

Also, for the lines where raises = 1, you need to define how large the raises are with “amounttocall <= 3 “ or something similar or else you will be raising ANY size raise including all ins from opponent.

Good point! Assuming for the moment I have read the definition of that command correctly. In your example I am telling the bot to raise as long as the raise placed by my opponent is less than or equal to 3 BB??
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #3 on: November 18, 2022, 05:45:26 AM »

The answer to your question is a bit odd from your position as big blind.

Because you already have 1 bb in, the amounttocall would actually be 2 if opponent raised to 3 bb. But if you were in another position preflop it would still be amounttocall = 3.

This is why people often use “betsize” comparisons instead of amounttocall but there used to be issues with betsize from time to time, so I stick with amounttocall in my profiles.

For botsactionsonthisround , yes it appears you are correct. I wasn’t sure off my head if there was a preflop or postflop requirement. There are for many other variables.

Preflop tip, you can easily define your position by combining stilltoact comparisons with botslastaction = none.
When stilltoact >= 5 and botslastaction = none Userearly
……….
When stilltoact = 1 and botslastaction = none Usersmallblind
When stilltoact = 0 and botslastaction = none Userbigblind

Other tip ….. always keep your “one liners” of code at the top of the profile for each street before you use codeblocks. You can’t move from one to the other and back in the same street.

If u want me to clarify any of the above, let me know
Logged

My life is a "missed click restoring state"
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« Reply #4 on: November 18, 2022, 07:23:15 AM »

The answer to your question is a bit odd from your position as big blind.

Because you already have 1 bb in, the amounttocall would actually be 2 if opponent raised to 3 bb. But if you were in another position preflop it would still be amounttocall = 3.

Yes you're right. I was a little sleepy when I wrote that reply but it seems I was correct in what I meant to say.

Preflop tip, you can easily define your position by combining stilltoact comparisons with botslastaction = none.
When stilltoact >= 5 and botslastaction = none Userearly
……….
When stilltoact = 1 and botslastaction = none Usersmallblind
When stilltoact = 0 and botslastaction = none Userbigblind

So in reference to the code I posted earlier I could re-write it as:

Code:
When stilltoact = 0 and botslastaction = none and (hand = 22 or hand = 23 or hand = 34)
When raises = 0 and calls = 1 raise 5 force
When raises = 0 and calls = 2 raise 6 force
When raises = 0 and calls = 3 raise 7 force
When raises = 0 and calls = 4 raise 8 force
When raises = 0 and calls = 5 raise 9 force
When raises = 1 and calls = 1 and amounttocall <= 3 raise 4 force
When raises = 1 and calls = 2 and amounttocall <= 4 raise 5 force
When raises = 1 and calls = 3 and amounttocall <= 5 raise 6 force
When raises = 1 and calls = 4 and amounttocall <= 6 raise 7 force
When raises = 1 and calls = 5 and amounttocall <= 7 raise 8 force
When raises >= 2 fold force

Or is adding "Userbigblind" important?
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #5 on: November 18, 2022, 04:08:20 PM »

The Userbigblind portion was setting up a user defined variable. How you had it orginally is fine, and how you have it here is fine as well.

I was just showing you that you can define your position, and this can be used for acting in the next orbit if you used user defined variables.

For instance your codeblock only works on the first orbit since you are defining that the bot had no previous actions.

It’s easy when you are in the blinds because “inbigblind and insmallblind” still work as variables, but typically harder if you wanted to do this with button or cutoff.

For instance:
Custom
Preflop
When stilltoact = 2 and botslastaction = none Userbutton
When stilltoact = 3 and botslastaction = none Usercutoff

When Userbutton and botslastaction = raise and amounttocall <= 20 and hand = QQ RAISEMAX FORCE

^I just made up a random use for it (don’t actually use it), but I was trying to show you how you can define your position in later preflop orbits by first defining your position at the first orbit by using a user defined variable. The user defined variable “triggers” at the beginning so it works for the later one liner of code to still define our position even after we raise and are on the next orbit from an opponent 3 bet (we are reraised).

Please let me know if you would like further clarification.

Logged

My life is a "missed click restoring state"
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« Reply #6 on: November 19, 2022, 02:29:09 AM »

The Userbigblind portion was setting up a user defined variable. How you had it orginally is fine, and how you have it here is fine as well.

I was just showing you that you can define your position, and this can be used for acting in the next orbit if you used user defined variables.

For instance your codeblock only works on the first orbit since you are defining that the bot had no previous actions.

It’s easy when you are in the blinds because “inbigblind and insmallblind” still work as variables, but typically harder if you wanted to do this with button or cutoff.

For instance:
Custom
Preflop
When stilltoact = 2 and botslastaction = none Userbutton
When stilltoact = 3 and botslastaction = none Usercutoff

When Userbutton and botslastaction = raise and amounttocall <= 20 and hand = QQ RAISEMAX FORCE

^I just made up a random use for it (don’t actually use it), but I was trying to show you how you can define your position in later preflop orbits by first defining your position at the first orbit by using a user defined variable. The user defined variable “triggers” at the beginning so it works for the later one liner of code to still define our position even after we raise and are on the next orbit from an opponent 3 bet (we are reraised).

Please let me know if you would like further clarification.



OH YEAH ALL IN ON A PAIR OF QUEENS!  rockout rockout rockout rockout

Levity aside, thanks for that! It's something I was scratching my head over. How to keep track of things beyond the first orbit.

As much as I enjoy the bot, I don't want it interfering until after the flop Cheesy
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #7 on: November 19, 2022, 02:36:18 AM »

If u want me to look over code you make some time, let me know.

The general rule is , set up your user variables with one liners on each street first at the top, follow these up with other one liners you want, follow up with all your codeblocks, then decide if you want to close out the street or not.

When I say “close out” I mean the following

When others
 When others fold force

This is how people close out the street because it will fold everything not defined above. Otherwise the default ppl will take over and play for any hands not defined.

Good luck.
Logged

My life is a "missed click restoring state"
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« Reply #8 on: November 20, 2022, 09:47:58 AM »

If u want me to look over code you make some time, let me know.

The general rule is , set up your user variables with one liners on each street first at the top, follow these up with other one liners you want, follow up with all your codeblocks, then decide if you want to close out the street or not.

When I say “close out” I mean the following

When others
 When others fold force

This is how people close out the street because it will fold everything not defined above. Otherwise the default ppl will take over and play for any hands not defined.

Good luck.

I've realised something that would make my code a lot easier but dont know if the bot would work this way. The strategy basically depends on what hand was dealt to me and the position I am in at the time. So would this work:

Code:
custom
preflop

When stilltoact = 0 and botslastaction = none UserBBlind
When stilltoact = 1 and botslastaction = none UserSBlind

When (hand= 23 or 34 or 45)
When UserBBlind or UserSBlind
When raises = 0 and calls = 0 raise 99 force
When raises = 0 and calls = 1 raise 99 force
When raises = 0 and calls = 2 raise 99 force
When raises = 0 and calls = 3 raise 99 force
When raises = 0 and calls = 4 raise 99 force
When raises = 0 and calls = 5 raise 99 force
When raises = 1 and calls = 1 and amounttocall <= 88 raise 4 force
When raises = 1 and calls = 2 and amounttocall <= 88 raise 5 force
When raises = 1 and calls = 3 and amounttocall <= 88 raise 6 force
When raises = 1 and calls = 4 and amounttocall <= 88 raise 7 force
When raises = 1 and calls = 5 and amounttocall <= 88 raise 8 force
When raises >= 2 fold force
When botsactionsonthisround >=1
When amounttocall <=5 call force
When UserLP1 or UserLP2
When raises = 0 and calls >= 0 call force
When raises >=1 fold force
When others
 When others fold force
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #9 on: November 20, 2022, 03:07:30 PM »

The logic here is sound, but you made a few basic ppl mistakes (not meaning to be rude).

1. When (hand = 23 or 34 or 45) needs to be When (hand = 23 or hand = 34 or hand = 45)

2. EVERY OR condition needs parenthesis ... When UserBBlind or UserSBlind should be When (UserBBlind or UserSBlind) ...and When UserLP1 or UserLP2 should be When (UserLP1 or UserLP2)

3. You didn't define UserLP1 or UserLP2 ... I assume you left it out for brevity, but you would need to.

4. You attempted to nest multiple open condition inside a codeblock which will mess things up. Keep it simple and have just one "When" condition open, followed by singular "when" condition liners that close out the action. Check out my fix. Page 24 of the PPL explains this.

I'll Post a "Fixed" version in my next post, but I wanted to let you know what is changed.
« Last Edit: November 20, 2022, 03:42:43 PM by Mrphil » Logged

My life is a "missed click restoring state"
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #10 on: November 20, 2022, 03:17:59 PM »

Code:
custom
preflop

When stilltoact = 0 and botslastaction = none UserBBlind
When stilltoact = 1 and botslastaction = none UserSBlind
When stilltoact = 2 and botslastaction = none UserLP2
When stilltoact = 3 and botslastaction = none UserLP1

When (hand= 23 or hand = 34 or hand = 45)
       When (UserSBlind or UserBBlind) and raises = 0 and calls = 0 raise 99 force
When (UserSBlind or UserBBlind) and raises = 0 and calls = 1 raise 99 force
When (UserSBlind or UserBBlind) and raises = 0 and calls = 2 raise 99 force
When (UserSBlind or UserBBlind) and raises = 0 and calls = 3 raise 99 force
When (UserSBlind or UserBBlind) and raises = 0 and calls = 4 raise 99 force
When (UserSBlind or UserBBlind) and raises = 0 and calls = 5 raise 99 force
When (UserSBlind or UserBBlind) and raises = 1 and calls = 1 and amounttocall <= 88 raise 4 force
When (UserSBlind or UserBBlind) and raises = 1 and calls = 2 and amounttocall <= 88 raise 5 force
When (UserSBlind or UserBBlind) and raises = 1 and calls = 3 and amounttocall <= 88 raise 6 force
When (UserSBlind or UserBBlind) and raises = 1 and calls = 4 and amounttocall <= 88 raise 7 force
When (UserSBlind or UserBBlind) and raises = 1 and calls = 5 and amounttocall <= 88 raise 8 force
When (UserSBlind or UserBBlind) and raises >= 2 fold force
When (UserSBlind or UserBBlind) and botsactionsonthisround >=1 and amounttocall <=5 call force
       When (UserLP1 or UserLP2) and raises = 0 and calls >= 0 call force
When (UserLP1 or UserLP2) and raises >=1 fold force

When others
 When others fold force
Logged

My life is a "missed click restoring state"
DroneProbe
Wide-Eyed Newbie
*

Karma: 0
Posts: 17


« Reply #11 on: November 20, 2022, 03:27:56 PM »

The logic here is sound, but you made a few basic ppl mistakes (not meaning to be rude).

1. When (hand = 23 or 34 or 45) needs to be When (hand = 23 or hand = 34 or hand = 45)

2. EVERY OR condition needs parenthesis ... When UserBBlind or UserSBlind should be When (UserBBlind or UserSBlind) ...and When UserLP1 or UserLP2 should be When (UserLP1 or UserLP2)

3. You didn't define UserLP1 or UserLP2 ... I assume you left it out for brevity, but you would need to.

4. You attempted to nest multiple open condition inside a codeblock which will mess things up. Keep it simple and have just one "When" condition open, followed by singular "when" condition liners that close out the action. Check out my fix.

I'll Post a "Fixed" version in my next post, but I wanted to let you know what is changed.

1. Oof yes youre right I should have seen that before I posted it. Don't worry you were not rude in the slightest - or at least I am not in any way offended. You're taking time out to help a new guy out. I really appreciate it.

2. Makes sense

3. Yes it was left out for brevity sake.

4. Its a shame nested conditions won't work as I put it. It reads a lot cleaner to me my way. But if that is how it is... that's how it is and I'll just have to work with it Smiley No worries at all.

I do notice an extra space or two in the "When (UserSBlind or UserBBlind) and raises = 0 and calls = 0 raise 99 force" and the "When (UserLP1 or UserLP2) and raises = 0 and calls >= 0 call force" are they there by design or should they all be in one.... I want to say column but thats the wrong word. Hopefully you know what I mean.

Again, thanks a lot for this. At least I can start the code block off by defining hands and then going ahead by position
Logged
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #12 on: November 20, 2022, 03:53:17 PM »

For number 4, the PPL guide pages you should review and look at are Pages 24 and 25. This explains it better than I can.
Please especially note this part: "The “UNTIL another when condition without an action is found” part of the red letter rule above means that you
cannot have multiple when conditions without an action."


I'm not exactly sure what you mean by multiple spaces added. I moved the spacing to show what is all included in the codeblock now. It makes things easier to see and it was what I changed from yours where you had multiple open "when" conditions. It's now one singular code block under the open hand determination line.

Let me know if you want further clarification.

-Phil
Logged

My life is a "missed click restoring state"
Mrphil
Extreme Botter
*****

Karma: 79
Posts: 2175


full limit = rakemaker


« Reply #13 on: November 20, 2022, 03:59:55 PM »

Also, it looks like your are missing a line for "When (UserSBlind or UserBBlind) and raises = 1 and calls = 0 and amounttocall <= 88"  ... Given the rest of your code, I'm thinking you won't want to fold here.
Logged

My life is a "missed click restoring state"
Pages: [1] Print 
Shanky Technologies Poker Bot Support Forum  |  General Category  |  PPL Support (Moderator: sngbot)  |  Topic: ensuring the basic logic here works before I move on
Jump to:  


Login with username, password and session length

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