Compare commits

...

3 Commits

Author SHA1 Message Date
fc55bd2830 check for bank before raise 2023-07-18 16:31:52 +02:00
69f925e0f6 change odds 2023-07-16 19:10:57 +02:00
2cec666f76 readme schmeadme 2023-07-15 07:00:02 +02:00
2 changed files with 37 additions and 19 deletions

View File

@ -1,5 +1,7 @@
# schmirc # schmirc
A poker bot for the hirc poker bot by nilscc: https://github.com/nilscc/hirc
## Installation & Usage ## Installation & Usage
npm i npm i

View File

@ -106,8 +106,8 @@ bot.on("message", async e => {
return e.reply("f"); return e.reply("f");
if(e.message === ".d" && !env.hand) if(e.message === ".d" && !env.hand)
return e.reply("d"); return e.reply("d");
if(e.message === ".env" && cfg.get('debug')) { if(e.message === ".env") {
e.reply(JSON.stringify(env)); return helper.debug(env, 5);
} }
if(e.user.nick !== cfg.get('pokerbot') || !env.hand) if(e.user.nick !== cfg.get('pokerbot') || !env.hand)
@ -173,8 +173,7 @@ bot.on("message", async e => {
if(env.callamount > env.bank) // not enough money lol if(env.callamount > env.bank) // not enough money lol
return e.reply(['huan!', 'f']); return e.reply(['huan!', 'f']);
if(env.odds <= 30) { if(env.odds <= 40) {
console.log('callphase', env);
if(helper.rand(20) === 1 && env.callamount < (helper.rand(2, 6) * 10)) { // bad hand, call anyway if(helper.rand(20) === 1 && env.callamount < (helper.rand(2, 6) * 10)) { // bad hand, call anyway
action = 'call'; action = 'call';
debug = `bad hand, call anyway (${env.odds}, callphase, 5%)`; debug = `bad hand, call anyway (${env.odds}, callphase, 5%)`;
@ -184,40 +183,57 @@ bot.on("message", async e => {
debug = `bad hand (${env.odds}, callphase, 95%)`; debug = `bad hand (${env.odds}, callphase, 95%)`;
} }
} }
else if(env.odds > 30 && env.odds <= 50) { // decent hand, raise else if(env.odds > 40 && env.odds <= 50) { // decent hand, raise
if(helper.rand(10) === 1) { // 10% if(helper.rand(10) === 1) { // 10%
action = 'raise ' + (env.callamount + helper.rand(5) * 10); const toRaise = env.callamount + helper.rand(5) * 10;
debug = `decent hand (${env.odds}, callphase, 20%)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `decent hand (${env.odds}, callphase, 10%)`;
}
} }
} }
else if(env.odds > 50 && env.odds <= 70) { // good hand lol else if(env.odds > 50 && env.odds <= 70) { // good hand lol
if(helper.rand(2) === 1) { // 50% if(helper.rand(3) === 1) { // 33%
action = 'raise ' + (env.callamount + helper.rand(6) * 10); const toRaise = env.callamount + helper.rand(6) * 10;
debug = `good hand lol (${env.odds}, callphase, 70%)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `good hand lol (${env.odds}, callphase, 33%)`;
}
} }
} }
else if(env.odds > 70) { // fuck them all else if(env.odds > 70) { // fuck them all
action = 'raise ' + (env.callamount + helper.rand(7) * 10); const toRaise = env.callamount + helper.rand(7) * 10;
debug = `fuck them all (${env.odds}, callphase)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `fuck them all (${env.odds}, callphase)`;
}
} }
} }
else { // checkphase else { // checkphase
console.log('checkphase', env);
if(env.odds > 55 && env.odds <= 70) { // decend hand, raise if(env.odds > 55 && env.odds <= 70) { // decend hand, raise
if(helper.rand(5) === 1) { // 20% if(helper.rand(5) === 1) { // 20%
action = 'raise ' + (env.callamount + helper.rand(5) * 10); const toRaise = env.callamount + helper.rand(5) * 10;
debug = `decent hand (${env.odds}, checkphase, 20%)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `decent hand (${env.odds}, checkphase, 20%)`;
}
} }
} }
else if(env.odds > 70 && env.odds <= 85) { // good hand lol else if(env.odds > 70 && env.odds <= 85) { // good hand lol
if(helper.rand(2) === 1) { // 50% if(helper.rand(2) === 1) { // 50%
action = 'r ' + (env.callamount + helper.rand(6) * 10); const toRaise = env.callamount + helper.rand(6) * 10;
debug = `good hand lol (${env.odds}, callphase, 50%)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `good hand lol (${env.odds}, callphase, 50%)`;
}
} }
} }
else if(env.odds > 85) { // fuck them all else if(env.odds > 85) { // fuck them all
action = 'raise ' + (env.callamount + helper.rand(7) * 10); const toRaise = env.callamount + helper.rand(7) * 10;
debug = `fuck them all (${env.odds}, callphase)`; if(toRaise > env.bank) {
action = 'raise ' + toRaise.toString();
debug = `fuck them all (${env.odds}, callphase)`;
}
} }
} }