Question about new code lines

Coding-related discussion: OpenPPL (Poker Programming Language) and internal OpenHoldem-script
Post Reply
Posts: 96
Joined: Sun Aug 12, 2018 3:12 pm

Question about new code lines

Post by Amurabi » Sun Apr 14, 2019 2:19 pm

For example, during hand review i found Line 450 in f$flop in profile. But i dont want to change this line. I need to add new line after that. So:
Existed line: 450
New line: 451

After that i going to review more hand, found another one interesting line in f$flop (for example, 634). But because I added a new line to the function, i need to account this shift on +1 line below (this line is Line 635 now because i add 1 new Line earlier).

The more new lines of code are added between existing lines of code, the harder it is to track which line of code was called in the log. Yes, i can write all new line in Word and then paste it in profile (like on screenshot). But what if after that i start bot, play some hands and then i want to watch some old hands that were played before changes? Imagine you need to find Line 504 (old hand) in f$preflop taking into account all new added lines...


So my question is: how easy to add new lines of code without manually counting changes in the number of lines of code? Is there any solution?

First blood
First blood
Posts: 19
Joined: Thu Apr 04, 2019 11:09 am

Re: Question about new code lines

Post by rudeone » Sun Apr 14, 2019 2:28 pm

i think we need to keep a copy of the exact version of the profile that was being used to generate the log files on a given day.

i make a folder for each day, put associated log files and profile version in there.

so i can garantee the logfiles point me to the correct line in the code while i can work on the profile under a different filename/version number

Botter for life
Botter for life
Posts: 555
Joined: Fri Apr 27, 2018 5:19 am

Re: Question about new code lines

Post by rem54 » Sun Apr 14, 2019 2:50 pm

If you're an out of control on the fly programmer like I am it can at times be a challenge to keep the log files and code in sync.

1) while the Bot is playing changes should be a) critical b) avoid adding any newlines if possible. If newlines cannot be avoided remove white lines immediately above or below to correct the line # for the rest of the profile as close to the newline as possible. Comment the code so it can be formatted properly at the next not in play update. new comments in existing white space / blank lines

2) Before modifying the BOT code from the current version create a new "profile.1.1.x" subfolder in the LOG file and copy the current profile into it

3) When implementing an updated version follow these steps, assuming you did step 2 above.
a) stop the bot
b) copy all the log files in the log folder to the "profile.1.1.x" sub folder. (this gets more complicated if you run different profiles :mrgreen: )
c) Delete all the log files in log folder
d)Create a new version subfolder and put a copy of the new profile in there and implement it in the Botlogic folder. We would never edit the current "live" version in the Botlogic folder except on-the-fly emergencies, right? :oops:

In reality I create subfolders of the log files occasionally and copy the profile ctrl+c then ctrl+v before major changes. Many times you can use the line number relative to the symbol and a little logical analysis to identify where the offending line moved too.

Site Admin
Site Admin
Posts: 1845
Joined: Sun Mar 26, 2017 5:58 pm

Re: Question about new code lines

Post by Alex » Sun Apr 14, 2019 4:48 pm

i do something similar to what rudeone suggests: in notepad i keep one tab with unchanged version of profile (which generated logs), then i find my line and search for it in 2nd tab, where there is new profile version.
If code line is unique - this approach works easy. But if there are many instances of it - you just need to compare code line numbers also, to find closest one

Flush Royal
Flush Royal
Posts: 254
Joined: Fri Dec 21, 2018 5:01 pm

Re: Question about new code lines

Post by RandomName » Sun Apr 14, 2019 8:16 pm

I never make a change to the bot without saving it with a new version number. Problem solved. Easy peasy.

When reviewing my logs, I look to see what version of the profile I used (it's at the start of each hand). Done. QED. And all that.

First blood
First blood
Posts: 22
Joined: Tue Sep 11, 2018 7:42 am

Re: Question about new code lines

Post by raisefold » Sun Apr 14, 2019 9:59 pm

open the file with notepad
find all the lines to edit by clicking in front of their number it will have a blue dot
this point will always remain before the same line, even if the line number changes

First blood
First blood
Posts: 26
Joined: Thu Feb 28, 2019 10:39 am

Re: Question about new code lines

Post by rafaelmacedo » Tue Apr 16, 2019 1:15 pm

Good Morning. Can someone give me an efficient line to play with two pairs formed on the flop.

User avatar
Out of this world
Out of this world
Posts: 391
Joined: Thu Jan 31, 2019 12:56 am

Re: Question about new code lines

Post by frogmd » Tue Apr 16, 2019 2:18 pm

rafaelmacedo wrote:
Tue Apr 16, 2019 1:15 pm
Good Morning. Can someone give me an efficient line to play with two pairs formed on the flop.
This is why profiling is difficult. It's not just hitting two pairs that's important. There are many factors to consider when considering the next move. The way I would go about this process is to create a template of circumstantial situations that would make the play different with each situation.

How many players are at the table?
How many players are left to act?
Is there a bet to call?
Your StackSize
Is it just twopair or is it toptwopair?
Is there a possible flush or possible straight on the board?

These are all things to consider when coming up with a proper code block. There is no one size fits all type of approach to a decision. Not all hands are AA where you can get away with a simple RaiseMax. :D
“Life is not always a matter of holding good cards, but sometimes, playing a poor hand well.” ― Jack London

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests