Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-16-2008, 01:12 AM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
pokereval()

Could this function (for example when "holdem" is the game type) be fixed so that when given 5 common cards and 3 dead cards, it will give 100%, 0% or 50%, no matter what iteration is given.

Here's some examples:

NPC Code:

Player 1: hearts_10,diamonds_queen
Player 2: spades_3,spades_10
Player 1: 40%
Player 2: 60%
Trashing one card and dealing the flop...
Cards in the table: clubs_king,hearts_8,clubs_9
Player 1: 66%
Player 2: 33%
Trashing one card and dealing the turn...
Cards in the table: clubs_king,hearts_8,clubs_9,hearts_3
Player 1: 36%
Player 2: 64%
Trashing one card and dealing the river...
Cards in the table: clubs_king,hearts_8,clubs_9,hearts_3,spades_4
Player 1: 25%
Player 2: 75%



In the above example, player 1 = winner with pair in 3 (should be 100%)



Next example..

NPC Code:

Player 1: diamonds_10,spades_7
Player 2: spades_8,hearts_10
Player 1: 60%
Player 2: 40%
Trashing one card and dealing the flop...
Cards in the table: diamonds_7,hearts_9,clubs_2
Player 1: 62%
Player 2: 37%
Trashing one card and dealing the turn...
Cards in the table: diamonds_7,hearts_9,clubs_2,clubs_queen
Player 1: 72%
Player 2: 28%
Trashing one card and dealing the river...
Cards in the table: diamonds_7,hearts_9,clubs_2,clubs_queen,clubs_ace
Player 1: 50%
Player 2: 50%



I have no idea why it shows it as 50/50 when it should show 100% to player 1 with a winning hand of pair in 7..

So, could the function be made to give 100% or 0% (and only 50% when it's a split) after the river card? (When 5 common cards and 3 dead cards are given as parameters)
__________________
Reply With Quote
  #2  
Old 11-16-2008, 04:44 AM
thatdwarf thatdwarf is offline
Former UN Dev Admin
Join Date: Nov 2005
Posts: 42
thatdwarf is on a distinguished road
I'm going to assume you have some kind of a conditional checking each hand and comparing them to one another after the river card?


If anything just do a straight assignment if you're just incrimenting the percentage as you go once a winning hand is determined
Reply With Quote
  #3  
Old 11-16-2008, 06:22 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by thatdwarf View Post
I'm going to assume you have some kind of a conditional checking each hand and comparing them to one another after the river card?


If anything just do a straight assignment if you're just incrimenting the percentage as you go once a winning hand is determined
pokereval() is a built-in function. Stefan loves poker.

Quote:
Script help for 'pokereval':
pokereval(str, obj, obj, obj, int) - returns object - returns an array of chance to win a poker game, parameters are the poker type (holdem, holdem8, omaha, omaha8, 7stud, 7stud8, 7studnsq, razz, lowball27), an array of each players cards ({{"as","ah"},{"kd","kc"}}), the common cards, the dead cards and number of iterations
__________________
Reply With Quote
  #4  
Old 11-16-2008, 09:26 PM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Yes, I'm talking about the in-built one (Thanks Chris for pointing it out).

So, Stefan, think it could be fixed?
__________________
Reply With Quote
  #5  
Old 11-18-2008, 11:23 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The function has been added for Adrenaline Poker. It's normally only used for calculating the chance that a bot is winning so that it can base it's decisions on it, it's currently not used though. I'm not sure if it can also be used to calculate which player is actually winning, but may be it can and the parameters are just not correctly given, so may be post an example of the parameters you are giving to the function (dead cards should be empty for holdem).
Reply With Quote
  #6  
Old 11-18-2008, 11:44 PM
Chompy Chompy is offline
»\(║_o)/»
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Graal Script Code:
function onCreated() {
  echo(
pokereval("holdem", {{"6d","qc"}, {"9c","7h"}}, {"3s","kc","10c","3d","8d"}, ""1));

Randomly goes between (1, 0) (0.5, 0.5) and (0.75, 0.25) - If i raise the iteration it will for example move up to alot of commas (0.8225,0.1775)

Was thinking of using the function for card games (poker of course ) and such and I needed a way to determine the winner of the pot
__________________
Reply With Quote
Reply

Tags
cards, eval, holdem, poker, pokereval

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:30 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.