Advertisement
Flip

Holdem

Aug 6th, 2014
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.99 KB | None | 0 0
  1. alias holdem {
  2.   if (!$1) { return }
  3.   var %x = $sorttok($_cn($_ns($1-)),32,nr), %d = $dupe(%x), %n = $_cn(%x).c, %a = $gettok(%n,1,32), %s = $sorttok($_cn($1-),32,nr)
  4.   if ($regex(%s,/\b(\d+?)(c|d|h|s)(?:.+?\2){4}/i)) && ($_straight(%d)) {
  5.     var %a = $v1, %c = $regml(2), %n = $num(%a,$calc(%a - 4)).42, %n = $regsubex($regsubex(%n,/(.+?)\*1$/,14*\1),/(\d+?)(?=\*|$)/g,\1 $+ %c)
  6.     if (* $+ %n $+ * iswm %s) { return $iif($prop == n,9. $+ %a,A $iif(%a == 14,Royal flush,Straight flush ( $+ $_cl($_cn(%a).c) high))) }
  7.   }
  8.   if ($regex(%x,/\b(\d+?)\s\1\s\1\s\1/)) { return $iif($prop == n,$+(8.,$zpad($regml(1),2),.,$remtok(%x,$regml(1),0,32)),4 of a kind ( $+ $_cl($_cn($regml(1)).c).s $+ )) }
  9.   if ($regex(%x,/(\b(\d+?)\s\2.+?\b(\d+?)\s\3\s\3|\b(\d+?)\s\4\s\4.+?\b(\d+?)\s\5)/)) {
  10.     var %a = $iif($count($regml(1),$regml(2)) == 3,$regml(2),$regml(3)), %b = $iif($count($regml(1),$regml(2)) == 2,$regml(2),$regml(3))
  11.     return $iif($prop == n,$+(7.,%a,.,%b),A Full house ( $+ $_cl($_cn(%a).c).s over $_cl($_cn(%b).c).s $+ ))
  12.   }
  13.   if ($regex(%s,/(\d+?)(c|d|h|s)(?:.+?\2){4}/i)) { return $iif($prop == n,6. $+ $regml(1),A Flush of $_sl($regml(2)).s ( $+ $_cl($_cn($regml(1)).c) high $+ ) ) }
  14.   if ($_straight(%d)) { %a = $v1 | return $iif($prop == n,5. $+ %a,A Straight ( $+ $_cl($_cn(%a).c) high $+ )) }
  15.   if ($regex(%x,/\b(\d+?)\s\1\s\1/)) { return $iif($prop == n,$+(4.,$zpad($regml(1),2),.,$zpad($gettok($remtok(%x,$regml(1),0,32),1,32),2)),A set of $_cl($_cn($regml(1)).c).s)) }
  16.   if ($regex(%x,/\b(\d+?)\s\1.+?\b(\d+?)\s\2/)) { return $iif($prop == n,$+(3.,$zpad($regml(1),2),.,$zpad($regml(2),2),.,$zpad($gettok($remtok($remtok(%x,$regml(2),0,32),$regml(1),0,32),1,32),2)),Two pair ( $+ $_cl($_cn($regml(1)).c).s and $_cl($_cn($regml(2)).c).s $+ )) }
  17.   if ($regex(%x,/\b(\d+?)\s\1/)) { return $iif($prop == n,$+(2.,$zpad($regml(1),2),.,$zpad($gettok($remtok(%x,$regml(1),0,32),1,32),2)),A pair of $_cl($_cn($regml(1)).c).s) }
  18.   return $iif($prop == n,1. $+ $zpad($gettok(%x,1,32),2),$_cl(%a) high)
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement