From 8acf36846ebee227c4635b2c07810272613ef5da Mon Sep 17 00:00:00 2001 From: strikles Date: Tue, 17 Dec 2019 13:16:38 +0000 Subject: [PATCH 1/2] fix ohf --- bot.py | 3 ++- python.ohf | 21 ++++----------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/bot.py b/bot.py index a2678a0..e471c6b 100644 --- a/bot.py +++ b/bot.py @@ -39,7 +39,7 @@ def updateVars(self): for k, v in self.oh.items(): self.oh[k] = OpenHoldem.getSymbol(k) print(f'{k}: {self.oh[k]}\n') - self.phr = (169.0 - self.oh['handrank169'])/169.0 + self.phr = (170.0 - self.oh['handrank169'])/169.0 self.inv = 1.0/self.oh["nplayersplaying"] print(f'1/nplayers: {self.inv}\n') if self.oh["betround"] == 1: @@ -102,5 +102,6 @@ def getDecision(self): decision = self.preFlopDecision() else: decision = self.postFlopDecision() + decision = round(decision/self.oh["bblind"]) print(f'decision: {decision}\n') return decision \ No newline at end of file diff --git a/python.ohf b/python.ohf index 04e0599..ad4352e 100644 --- a/python.ohf +++ b/python.ohf @@ -63,7 +63,7 @@ ##f$ini_function_on_my_turn## -isfinalanswer ? me_st_dec_f$dlldecision : 0 +0 ##f$ini_function_on_heartbeat## @@ -77,7 +77,6 @@ isfinalanswer ? me_st_dec_f$dlldecision : 0 ##f$debug## = userchair = AmountToCall -= dll$random ##list_random_crap## @@ -87,30 +86,18 @@ A6o KTo K8o K5o QJo Q8o Q3o JTo J5o T6o 92o 87o 85o 84o 62o 43o ##f$preflop## -WHEN (me_re_dec - currentbet - call > 0) RaiseTo me_re_dec FORCE -WHEN (me_re_dec - currentbet - call == 0) OR (call == balance AND me_re_dec > currentbet) Call FORCE -WHEN Others Fold FORCE +dll$decision ##f$flop## -WHEN (me_re_dec - currentbet - call > 0) RaiseTo me_re_dec FORCE -WHEN (me_re_dec - currentbet - call == 0) OR (call == balance AND me_re_dec > currentbet) Call FORCE -WHEN Others Fold FORCE +dll$decision ##f$turn## -WHEN (me_re_dec - currentbet - call > 0) RaiseTo me_re_dec FORCE -WHEN (me_re_dec - currentbet - call == 0) OR (call == balance AND me_re_dec > currentbet) Call FORCE -WHEN Others Fold FORCE +dll$decision ##f$river## -WHEN (me_re_dec - currentbet - call > 0) RaiseTo me_re_dec FORCE -WHEN (me_re_dec - currentbet - call == 0) OR (call == balance AND me_re_dec > currentbet) Call FORCE -WHEN Others Fold FORCE - - -##f$dlldecision## dll$decision From cdf905160ef90d89ce4ccb5dd7c7700608d752ee Mon Sep 17 00:00:00 2001 From: strikles Date: Tue, 17 Dec 2019 18:23:43 +0000 Subject: [PATCH 2/2] setting ohf to recommended settings and modifying bot.py accordingly to return a Call constant for call and a betsize otherwise --- bot.py | 30 +++++++++++++++--------------- python.ohf | 6 +++++- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/bot.py b/bot.py index e471c6b..28c0dcd 100644 --- a/bot.py +++ b/bot.py @@ -61,37 +61,38 @@ def preFlopDecision(self): print(f'phr: {self.phr}\n') if 0.95 < self.phr: if self.timesActed() == 0: - decision = self.oh["call"] + max(self.oh["pot"], 4*self.oh["bblind"]) + decision = (self.oh["currentbet"] + min(self.oh["balance"], self.oh["call"] + max(self.oh["pot"], 4.0*self.oh["bblind"]))) / self.oh["bblind"] else: - decision = self.oh["balance"] + decision = (self.oh["currentbet"] + self.oh["balance"]) / self.oh["bblind"] print('-> 0.95\n') - elif 0.85 < self.phr and self.oh["call"] <= 30*self.oh["bblind"]: + elif 0.85 < self.phr and self.oh["call"] <= 13.0*self.oh["bblind"]: if self.timesActed() == 0: - decision = self.oh["call"] + max(self.oh["pot"]/2, 4*self.oh["bblind"]) + decision = (self.oh["currentbet"] + min(self.oh["balance"], self.oh["call"] + max(self.oh["pot"]/2.0, 4.0*self.oh["bblind"]))) / self.oh["bblind"] else: - decision = self.oh["call"] + decision = OpenHoldem.getSymbol("Call") print('-> 0.85\n') - elif 0.70 < self.phr and self.oh["call"] <= 10*self.oh["bblind"]: + elif 0.70 < self.phr and self.oh["call"] <= 3.0*self.oh["bblind"]: if self.timesActed() == 0: - decision = self.oh["call"] + decision = OpenHoldem.getSymbol("Call") print('-> 0.70\n') - decision = self.oh["currentbet"] + min(self.oh["balance"], decision) return decision def postFlopDecision(self): decision = 0.0 - min_bet = max(2*self.oh["call"], self.oh["bblind"]) + min_bet = max(2.0*self.oh["call"], self.oh["bblind"]) if 0.40 < self.oh["prwin"] - self.inv: if self.timesActed() == 0: - decision = self.oh["call"] + max(min_bet, self.oh["pot"]) + decision = (self.oh["currentbet"] + min(self.oh["balance"], self.oh["call"] + max(min_bet, self.oh["pot"]))) / self.oh["bblind"] else: - decision = self.oh["balance"] + decision = (self.oh["currentbet"] + self.oh["balance"]) / self.oh["bblind"] + print('Big Raise') elif 0.1 < self.oh["prwin"] - self.inv and math.isclose(0, self.oh["call"], rel_tol=1e-6) and self.gotcaught == False: - decision = self.oh["call"] + max(min_bet, self.oh["pot"]/2) + decision = (self.oh["currentbet"] + min(self.oh["balance"], self.oh["call"] + max(min_bet, self.oh["pot"]/2.0))) / self.oh["bblind"] + print('small raise') self.ibluffed = True elif self.oh["call"] < self.callExpectedValue(): - decision = self.oh["call"] - decision = self.oh["currentbet"] + min(self.oh["balance"], decision) + decision = OpenHoldem.getSymbol("Call") + print('just calling') return decision def getDecision(self): @@ -102,6 +103,5 @@ def getDecision(self): decision = self.preFlopDecision() else: decision = self.postFlopDecision() - decision = round(decision/self.oh["bblind"]) print(f'decision: {decision}\n') return decision \ No newline at end of file diff --git a/python.ohf b/python.ohf index ad4352e..97accac 100644 --- a/python.ohf +++ b/python.ohf @@ -63,7 +63,7 @@ ##f$ini_function_on_my_turn## -0 +isfinalanswer ? me_st_dec_f$dlldecision : 0 ##f$ini_function_on_heartbeat## @@ -101,3 +101,7 @@ dll$decision dll$decision +##f$dlldecision## +dll$decision + +