Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-01-2009, 08:02 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
Poker Functions

Well, haven't released something for a long time, so I guess it's time again?

I did have a little problem using the original pokereval() function for my poker game, so I decided I had to make my own!

Anyways, here's some examples of usage:

PHP Code:
function onCreated() {
  
join("pokerfunctions");
  
  
temp.table = {
    
"spades_ace""spades_king""spades_jack",
    
"diamonds_2""hearts_7"
  
};
  
  
temp.player1 = {"spades_queen""spades_10"};
  
temp.player2 = {"spades_3""spades_7"};
  
  
temp.eval1 pokereval(tableplayer1); // royalflush,A
  
temp.eval2 pokereval(tableplayer2); // flush,"A,K,J,7,3"
  
  //Lets find the winner? Eh?
  
  
echo(printableWinnerOutput({eval1eval2})); // Winner is: Player 1 with a royalflush

PHP Code:
function onCreated() {
  
join("pokerfunctions");
  
  
temp.table = {
    
"spades_ace""diamonds_king""hearts_10""diamonds_3",
    
"spades_4"
  
};

  
temp.player1 = {"hearts_2""spades_7"};
  
temp.player2 = {"spades_jack""diamonds_queen"};
  
  
temp.eval1 pokereval(tableplayer1); // highcard,7
  
temp.eval2 pokereval(tableplayer2); // straight,A
  
  //Lets find the winner? Eh?

  
  
echo(printableWinnerOutput({eval1eval2})); // Winner is: Player 2 with a straight


( If you need help or a better description of one of the functions, just say so in a post below or by PMing me)

Script: pokerfunctions v1.0.txt


Changelog:

1.0: - Initial release
__________________

Last edited by Chompy; 01-01-2009 at 08:18 PM..
Reply With Quote
  #2  
Old 01-01-2009, 08:38 PM
Soala Soala is offline
Ideas on Fire
Soala's Avatar
Join Date: Jun 2007
Location: In my head
Posts: 3,208
Soala is a jewel in the roughSoala is a jewel in the rough
Looks neat to me =P
Reply With Quote
  #3  
Old 01-01-2009, 10:54 PM
Devenio Devenio is offline
Scripter
Devenio's Avatar
Join Date: Dec 2006
Posts: 28
Devenio is on a distinguished road
Yay 4 Chompy (Alex)!!!!!

Neat work keep it coming!!!
__________________

"Two things are infinite: the universe and human stupidity, and I'm not sure about the the universe.." -Einstein


Reply With Quote
  #4  
Old 01-01-2009, 10:59 PM
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
Very cool!
__________________
Reply With Quote
  #5  
Old 01-02-2009, 01:18 AM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
Impressive
__________________
Reply With Quote
  #6  
Old 01-02-2009, 03:16 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
There are in built poker functions...?

xD
Reply With Quote
  #7  
Old 01-02-2009, 03:36 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
nice.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
Reply

Tags
ace, eval, functions, 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 04:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.