!21 Cards bot Game

By rhasttaff on Aug 17, 2008

Hello!!

this is a cards Game BoT, you can play against other user or against the bot.
to load paste in Alt+r File/new
to start a game type in the chan !21

enjoy!

i made a few update.
i just have added option to play against the bot if no one join in the game to play against you.
and some colors "abit annoying -.-"

Jah Bless´´

;##############################################
;## !21 cards game ############################
;######################### by rhasttaff  ######
;##############################################
on *:text:!21:#: {
  if (%21jog != on) {
    set %21jog on
    set %21player-1 $nick
    msg $chan 9T7his Game Requires:4 2 7Players. 9S7omeone Needs To Type4 !21 9T7o Play Against You in: 30 seconds. 9E7lse I'll Play Against You >.<!
    .timer_21-onlyone 1 30 player-me $chan
    set %21para-jog-1 off
    halt
  }
  if (%21jog == on) && (!%21player-2) && ($nick != %21player-1) {
    .timer_21-onlyone off
    set %21player-2 $nick
    set %21game-starts ok
    .notice %21player-1 This is the 21 Cards game! Whomever gets their cards to equal the number: 21 wins the game!  
    .notice %21player-2 This is the 21 Cards game! Whomever gets their cards to equal the number: 21 wins the game! 
    msg $chan 9G7ame Started!! 9-14=[12 %21player-1 14]=9- 7& 9-14=[2 %21player-2 14]=9-
    msg $chan 9-14=[12 %21player-1 14]=9- 9Y7ou First! 7Type 4!card 9Y7ou Have: 60 secs to play
    set %21jogada-jog 1
    set %21para-jog-2 off
    .timer_end-21 1 62 encerra-21 $chan
  }
}
alias player-me {
  msg $1 okok %21player-1 $+ !! You and me! here! now!
  set %21player-2 $me
  set %21jogada-jog 1
  set %21para-jog-2 off
  msg $1 9G7ame Started!! 9-14=[12 %21player-1 14]=9- 9V7ersus 9-14=[2 %21player-2 14]=9-
  msg $1  9-14=[12 %21player-1 14]=9- 9Y7ou First! 7Type 4!card 9Y7ou Have: 60 secs to play
  .timer_end-21 1 62 encerra-21 $1
}
alias me-play {
  if (%21jogada-jog == 2)  && ($me == %21player-2) {
    set %carta-jog-2 $rand(1,13)
    if (!%21cards-value-2) {
      set %21cards-value-2 %carta-jog-2
      set %21cards-player-2 $pass-to-card(%carta-jog-2)
      set %21jogada-jog 1
      msg $1 !card
      calc-next-orstop %21cards-value-2 %21player-2 $1
    }
    else {
      set %21jogada-jog 1
      set %21cards-value-2 $calc(%21cards-value-2 + %carta-jog-2)
      set %21cards-player-2 %21cards-player-2 $pass-to-card(%carta-jog-2)
      var %21me-play = %21cards-value-2
      if (%21me-play isnum 15-18) {
        var %me-play = $rand(1,2)
        if (%me-play == 1) {
          msg $1 !card
          calc-next-orstop %21cards-value-2 %21player-2 $1
          .timer_end-21 1 62 encerra-21 $1
          halt
        }
        if (%me-play == 2) {
          set %21para-jog-2 on
          msg $1 !comp
          if (%21para-jog-1 !== on) {
            calc-next-orstop %21cards-value-2 %21player-2 $1
            .timer_end-21 1 62 encerra-21 $1
            halt
          }
          if (%21para-jog-1 == on) {
            who-winns-21 $1
          }
        }
        halt
      }
      if (%21me-play isnum 1-14) {
        msg $1 !card
        calc-next-orstop %21cards-value-2 %21player-2 $1
        .timer_end-21 1 62 encerra-21 $1
        halt
      }
      if (%21me-play isnum 19-20) {
        set %21para-jog-2 on
        msg $1 !comp
        if (%21para-jog-1 !== on) {
          calc-next-orstop %21cards-value-2 %21player-2 $1
          .timer_end-21 1 62 encerra-21 $1
        }
        if (%21para-jog-1 !== on) {
          calc-next-orstop %21cards-value-2 %21player-2 $1
          .timer_end-21 1 62 encerra-21 $1
          halt
        }
        if (%21para-jog-1 == on) {
          who-winns-21 $1
          halt
        }
        halt
      }
      if (%21me-play == 21) {
        msg $1 !card
        calc-next-orstop %21cards-value-2 %21player-2 $1
      }

      if (%21me-play isnum 22-1000) {
        calc-next-orstop %21cards-value-2 %21player-2 $1
        .timer_end-21 off
        halt
      }
    }
  }
}
on *:text:!card:#: {
  if (%21jogada-jog == 1) && ($nick == %21player-1) && (%21player-2 != $me) {
    set %carta-jog-1 $rand(1,13)
    if (!%21cards-value-1) {
      set %21cards-value-1 %carta-jog-1
      set %21cards-player-1 $pass-to-card(%carta-jog-1)
      set %21jogada-jog 2
      .notice $nick your cards: %21cards-player-1
      .notice $nick your total: %21cards-value-1
      calc-next-orstop %21cards-value-1 %21player-1 $chan
      .timer_end-21 1 62 encerra-21 $chan
      halt
    }
    else {
      set %21jogada-jog 2
      set %21cards-value-1 $calc(%21cards-value-1 + %carta-jog-1)
      set %21cards-player-1 %21cards-player-1 $pass-to-card(%carta-jog-1)
      .notice $nick your cards: %21cards-player-1
      .notice $nick your total: %21cards-value-1
      calc-next-orstop %21cards-value-1 %21player-1 $chan
      halt
    }
  }
  if (%21jogada-jog == 1) && ($nick == %21player-1) && (%21player-2 == $me) {
    set %carta-jog-1 $rand(1,13)
    if (!%21cards-value-1) {
      set %21cards-value-1 %carta-jog-1
      set %21cards-player-1 $pass-to-card(%carta-jog-1)
      set %21jogada-jog 2
      .notice $nick your cards: %21cards-player-1
      .notice $nick your total: %21cards-value-1
      calc-next-orstop %21cards-value-1 %21player-1 $chan
      .timer_end-21 1 62 encerra-21 $chan
      halt
    }
    else {
      set %21jogada-jog 2
      set %21cards-value-1 $calc(%21cards-value-1 + %carta-jog-1)
      set %21cards-player-1 %21cards-player-1 $pass-to-card(%carta-jog-1)
      .notice $nick your cards: %21cards-player-1
      .notice $nick your total: %21cards-value-1
      calc-next-orstop %21cards-value-1 %21player-1 $chan
      .timer_end-21 1 62 encerra-21 $chan
      halt
    }
  }
  if (%21jogada-jog == 2)  && ($nick == %21player-2) {
    set %carta-jog-2 $rand(1,13)
    if (!%21cards-value-2) {
      set %21cards-value-2 %carta-jog-2
      set %21cards-player-2 $pass-to-card(%carta-jog-2)
      set %21jogada-jog 1
      .notice $nick your cards: %21cards-player-2
      .notice $nick your total: %21cards-value-2
      calc-next-orstop %21cards-value-2 %21player-2 $chan
      .timer_end-21 1 62 /encerra-21 $chan
      halt
    }
    if (%21cards-value-2) {
      set %21jogada-jog 1
      set %21cards-value-2 $calc(%21cards-value-2 + %carta-jog-2)
      set %21cards-player-2 %21cards-player-2 $pass-to-card(%carta-jog-2)
      .notice $nick your cards: %21cards-player-2
      .notice $nick your total: %21cards-value-2
      calc-next-orstop %21cards-value-2 %21player-2 $chan
      .timer_end-21 1 62 encerra-21 $chan
      halt
    }
  }
}
alias encerra-21 {
  if (%21jog == on) {
    who-winns-21 $1
  }
  else {
    acaba-21
  }
}
alias calc-next-orstop {
  if (%21player-2 != $me) {
    if ($1 > 21) && ($2 == %21player-1)  { msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[12 $2 14]=9- 9E7xploded 9W7ith The Cards:  %21cards-player-1  9T7otaling:4 %21cards-value-1 |  .timer_end-21 off | msg $3 9,7 WINNS  9-14=[2 %21player-2 14]=9- 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2  | acaba-21 | halt }
    if ($1 == 21) && ($2 == %21player-1)  { msg $3 9,7WINNS   9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1 |  .timer_end-21 off | acaba-21 | halt }
    if ($1 < 21) && ($2 == %21player-1) {
      if (%21para-jog-2 !== on) { msg $3 9-14=[2 %21player-2 14]=9- 9Y7our Turn! 7Type: 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou Have: 60 secs  }
      if (%21para-jog-2 == on) { set %21jogada-jog 1 | msg $3 9-14=[12 %21player-1 14]=9- 9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs  |  .timer_end-21 1 62 encerra-21 $3 | halt }
    }
    if ($1 > 21) && ($2 == %21player-2) { msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[2 $2 14]=9- 9E7xploded 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2 | msg $3 9,7WINNS  9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1  |  .timer_end-21 off | acaba-21 | halt }
    if ($1 == 21) && ($2 == %21player-2) { msg $3 9,7WINNS  9-14=[2 %21player-2 14]=9- 9W7ith The Cards:  %21cards-player-2 9T7otaling:4 %21cards-value-2  |   .timer_end-21 off | acaba-21 | halt }
    if ($1 < 21) && ($2 == %21player-2) {
      if (%21para-jog-1 !== on) { msg $3 9-14=[12 %21player-1 14]=9- 9Y7our Turn! 7Type: 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou Have: 60 secs | halt }
      if (%21para-jog-1 == on)  { set %21jogada-jog 2 | msg $3  9-14=[2 %21player-2 14]=9- 9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs  |  .timer_end-21 1 62 /encerra-21 $3 | halt }
    }
  }
  if (%21player-2 == $me) {
    if ($1 > 21) && ($2 == %21player-1)  { msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[12 $2 14]=9- 9E7xploded 9W7ith The Cards:  %21cards-player-1  9T7otaling:4 %21cards-value-1 |  .timer_end-21 off | msg $3 9,7 WINNS   9-14=[2 %21player-2 14]=9- 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2  | acaba-21 | halt }
    if ($1 == 21) && ($2 == %21player-1)  { msg $3 9,7WINNS   9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1 |  .timer_end-21 off | acaba-21 | halt }
    if ($1 < 21) && ($2 == %21player-1) {
      if (%21para-jog-2 !== on) { msg $3 9M7y Turn! | me-play $3 }
      if (%21para-jog-2 == on) { set %21jogada-jog 1 | msg $3 9-14=[12 %21player-1 14]=9- 9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs  |  .timer_end-21 1 62 encerra-21 $3 | halt }
    }
    if ($1 > 21) && ($2 == %21player-2) { /msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[2 $2 14]=9- 9E7xploded 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2 | msg $3 9,7 WINNS  9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1  |  .timer_end-21 off | acaba-21 | halt }
    if ($1 == 21) && ($2 == %21player-2) { msg $3 9,7WINNS  9-14=[2 %21player-2 14]=9- 9W7ith The Cards:  %21cards-player-2 9T7otaling:4 %21cards-value-2  |   .timer_end-21 off | acaba-21 | halt }
    if ($1 < 21) && ($2 == %21player-2) {
      if (%21para-jog-1 !== on) { msg $3 9-14=[12 %21player-1 14]=9- 9Y7our Turn! 7Type: 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou Have: 60 secs | halt }
      if (%21para-jog-1 == on)  { set %21jogada-jog 2 | msg $3  9I 7Rule! | .timer_end-21  off | .timer_only-me-play 1 2 me-play $3 |  halt }
    }
  }
}
alias acaba-21 {
  set %21jog off
  unset %21player-1 %21player-2 %21cards-value-1 %21cards-player-1 %21cards-value-2 %21cards-player-2 %21game-starts
}
on *:text:!comp:#: {
  if (%21jog == on) && (%21player-2) {
    if ($var(%21cards-player*,0) > 1) {
      if (%21player-2 != $me) {
        if (%21jogada-jog == 1) {
          if ($nick == %21player-1) && (%21para-jog-2 !== on) { set %21para-jog-1 on | set %21jogada-jog 2 | msg $chan   9-14=[2 %21player-2 14]=9-  9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs |  .timer_end-21 1 62 encerra-21 $chan | halt }
          if ($nick == %21player-1) && (%21para-jog-2 == on) { who-winns-21 $chan |  .timer_end-21 off }
        }
        if (%21jogada-jog == 2) {
          if ($nick == %21player-2) && (%21para-jog-1 !== on) { set %21para-jog-2 on | set %21jogada-jog 1 | msg $chan   9-14=[12 %21player-1 14]=9- 9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs |  .timer_end-21 1 62 encerra-21 $chan  | halt }
          if ($nick == %21player-2) && (%21para-jog-1 == on) { who-winns-21 $chan |  .timer_end-21 off }
        }
      }
      if (%21player-2 == $me) {
        if (%21jogada-jog == 1) {
          if ($nick == %21player-1) && (%21para-jog-2 !== on) { set %21para-jog-1 on | set %21jogada-jog 2 | msg $chan   9I 7Rule! | .timer_end-21 off | .timer_only-me-play 1 2 me-play $chan | halt }
          if ($nick == %21player-1) && (%21para-jog-2 == on) { who-winns-21 $chan |  .timer_end-21 off }
        }
        if (%21jogada-jog == 2) {
          if ($nick == %21player-2) && (%21para-jog-1 !== on) { set %21para-jog-2 on | set %21jogada-jog 1 | msg $chan   9-14=[12 %21player-1 14]=9- 9Y7ou Rule! 7Type 4 !card  9T7o One More Card Or Type: 4 !comp  9T7o Compare The Cards And End The Game! 9Y7ou have: 60 secs |  .timer_end-21 1 62 encerra-21 $chan  | halt }
          if ($nick == %21player-2) && (%21para-jog-1 == on) { who-winns-21 $chan |  .timer_end-21 off }
        }
      }
    }
    else { msg $chan 9F7irst You Have To Type:4 !card }
  }
}
alias who-winns-21 {
  if ($var(%21cards-player*,0) > 1) {
    set %21total-jog-1 $calc(21 - %21cards-value-1)
    set %21total-jog-2 $calc(21 - %21cards-value-2)
    if (%21total-jog-1 < %21total-jog-2) {  .timer_end-21 off | msg $1 9,7WINNS  9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1 | msg $1 12,4LOOSES  9-14=[2 %21player-2 14]=9- 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2 | acaba-21 | halt }
    if (%21total-jog-1 > %21total-jog-2) {  .timer_end-21 off | msg $1 9,7WINNS   9-14=[2 %21player-2 14]=9- 9W7ith The Cards: %21cards-player-2 9T7otaling:4 %21cards-value-2  | msg $1 12,4LOOSES  9-14=[2 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1  | acaba-21 | halt }
    if (%21total-jog-1 == %21total-jog-2) && ($var(%cartas-jog*,0) = 2) {  .timer_end-21 off | msg $1 9T7his Game Have No Winner! 9T4ied 9G4ame | msg $1 7,5 TIED  9-14=[12 %21player-1 14]=9- 9W7ith The Cards: %21cards-player-1 9T7otaling:4 %21cards-value-1 | msg $1 7,5 TIED  9-14=[2 %21player-2 14]=9-  9W7ith The Cards: %21cards-player-2  9T7otaling:4 %21cards-value-2  | acaba-21 | halt } 
  }
  else { msg $1 9E7nD Of Round! 9T7his Game Have No Winner! | acaba-21 }
}
alias pass-to-card {
  set %21cor  $rand(1,2)
  if (%21cor == 1) { set %21cort 1 }
  if (%21cor == 2) { set %21cort 4 }
  if ($1 == 1) { return  $+ %21cort $+ ,0 $+ [A] }
  if ($1 == 2) { return  $+ %21cort $+ ,0 $+ [2] }
  if ($1 == 3) { return  $+ %21cort $+ ,0 $+ [3] }
  if ($1 == 4) { return  $+ %21cort $+ ,0 $+ [4] }
  if ($1 == 5) { return  $+ %21cort $+ ,0 $+ [5] }
  if ($1 == 6) { return  $+ %21cort $+ ,0 $+ [6] }
  if ($1 == 7) { return  $+ %21cort $+ ,0 $+ [7] }
  if ($1 == 8) { return  $+ %21cort $+ ,0 $+ [8] }
  if ($1 == 9) { return  $+ %21cort $+ ,0 $+ [9] }
  if ($1 == 10) { return  $+ %21cort $+ ,0 $+ [10] }
  if ($1 == 11) { return  $+ %21cort $+ ,0 $+ [J] }
  if ($1 == 12) { return  $+ %21cort $+ ,0 $+ [Q] }
  if ($1 == 13) { return  $+ %21cort $+ ,0 $+ [K] }
}

Comments

Sign in to comment.
dma   -  Nov 26, 2015

do you know the math is way off in this script? are you trying to say jaks are 11 and queens are 12 and kings are 13?? the game is thrown off .. by these #s i dont know what country your from but black jack (21) in the usa all pictured cards are worth 10 thanks for your time

 Respond  
Spoof   -  Dec 17, 2011

Funny how none of your scripts seem to be error free and don't work.
do you read the error line msg's or what.

 Respond  
MashhitDK   -  Oct 23, 2010

Just wanted to say thanks...

 Respond  
Hobo123   -  May 07, 2010

Found a problem:

J =/= 11, which is what your script thinks :P

 Respond  
rhasttaff   -  Oct 14, 2008

have u requested in the right area? in mIRC Snippet request?!
give me the link, maybe we can resolve that from there!

Jah Bless´´´

 Respond  
wizard38   -  Oct 14, 2008

well i try but nobody help me

 Respond  
rhasttaff   -  Oct 13, 2008

heya!!! try in the forum brother :)
i'm sure that someone goooood scripter from Hawkee.com will help you with this.

Jah Bless´´´

 Respond  
wizard38   -  Oct 13, 2008

well and a game with a player against de bot? a player chose a number and after 60 seconds a bot give a anwser.... i chose paper an you lose 50 points.
sommething like that

 Respond  
rhasttaff   -  Aug 26, 2008

Thanks Brother!!
in the next time if i have time and inspiration i will try add more players in the game.

Jah Bless´´

 Respond  
Zmodem   -  Aug 25, 2008

So far it looks good. :-) Keep it up!

 Respond  
rhasttaff   -  Aug 25, 2008

Heya!!
Thanks for the help Zmodem :)

and well deduction beau!

yeah:
Jogo = Game
Jogador = player

and this is not a Black Jack game. this is a value game where the 1° card from the deck is Ace so its have value 1 like the K(king) is the more high card from the deck so its have value 13

i dontknow if there is this game on your cowntry but here the game calls 21

i have tryed to corret the language follow the Zmodem model.
and changed some vars and aliases names to english
and added option to play against the bot.

Jah Bless´´´

 Respond  
beau   -  Aug 25, 2008

Zmodem, I think jogador is meant to be "player".
I think it's spelt jugador, though.. $fail(at anything besides English.,$me) == $true

 Respond  
EL   -  Aug 25, 2008

Rofl your a spazz man.A for effort tho.`-.-´

 Respond  
Zmodem   -  Aug 25, 2008

Shoot me now, but here is a quick, sort-of English re-write. This code is too messy, I didn't bother cleaning it up, but here it is with a more English pazazz!

;##############################################
;## !21 cards game ############################
;######################### by rhasttaff  ######
;##############################################
on *:text:!21:#: {
  if (%21jog !== on) {
    set %21jog on
    set %21jogador-1 $nick
    /msg $chan This Game Requires 2 Players. Someone needs to type !21 to play against you within 60 seconds.
    .timer_encerra-21 1 62 /encerra-21 $chan
    set %21para-jog-1 off
    halt
  }
  if (%21jog == on) && (!%21jogador-2) {
    /timer_21-um-so off
    set %21jogador-2 $nick
    /notice %21jogador-1 This is the 21 Cards game! Whomever gets their cards to equal the number: 21 wins the game! 
    /notice %21jogador-2 This is the 21 Cards game! Whomever gets their cards to equal the number: 21 wins the game!
    /msg $chan Game Started!! 9-14=[12 %21jogador-1 14]=9- 7& 9-14=[2 %21jogador-2 14]=9-
    /msg $chan Player: 9-14=[12 %21jogador-1 14]=9- it is now your turn! type 4!card $+ . You have 60 seconds to play...
    set %21jogada-jog 1
    set %21para-jog-2 off
    .timer_encerra-21 1 62 /encerra-21 $chan
  }
}
on *:text:!card:#: {
  if (%21jogada-jog == 1) && ($nick == %21jogador-1) {
    set %carta-jog-1 $rand(1,13)
    if (!%cartas-valor-jog-1) {
      set %cartas-valor-jog-1 %carta-jog-1
      set %cartas-jog-1 $passa-carta(%carta-jog-1)
      set %21jogada-jog 2
      /notice $nick Your cards: %cartas-jog-1
      /notice $nick Your total: %cartas-valor-jog-1
      /calcula-proxima-oupara %cartas-valor-jog-1 %21jogador-1 $chan
    }
    else {
      set %21jogada-jog 2
      set %cartas-valor-jog-1 $calc(%cartas-valor-jog-1 + %carta-jog-1)
      set %cartas-jog-1 %cartas-jog-1 $passa-carta(%carta-jog-1)
      /notice $nick Your cards: %cartas-jog-1
      /notice $nick Your total: %cartas-valor-jog-1
      /calcula-proxima-oupara %cartas-valor-jog-1 %21jogador-1 $chan
    }
  }
  if (%21jogada-jog == 2)  && ($nick == %21jogador-2) {
    set %carta-jog-2 $rand(1,13)
    if (!%cartas-valor-jog-2) {
      set %cartas-valor-jog-2 %carta-jog-2
      set %cartas-jog-2 $passa-carta(%carta-jog-2)
      set %21jogada-jog 1
      /notice $nick Your cards: %cartas-jog-2
      /notice $nick Your total: %cartas-valor-jog-2
      /calcula-proxima-oupara %cartas-valor-jog-2 %21jogador-2 $chan
    }
    else {
      set %21jogada-jog 1
      set %cartas-valor-jog-2 $calc(%cartas-valor-jog-2 + %carta-jog-2)
      set %cartas-jog-2 %cartas-jog-2 $passa-carta(%carta-jog-2)
      /notice $nick Your cards: %cartas-jog-2
      /notice $nick Your total: %cartas-valor-jog-2
      /calcula-proxima-oupara %cartas-valor-jog-2 %21jogador-2 $chan
    }
  }
}
alias encerra-21 {
  if (%21jog == on) {
    quem-ganha-21 $1
  }
  else {
    acaba-21
  }
}
alias calcula-proxima-oupara {
  if ($1 > 21) && ($2 == %21jogador-1)  { /msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[12 $2 14]=9- Explodes with the cards  %cartas-jog-1  Totaling:4 %cartas-valor-jog-1 |  /timer_encerra-21 off | /msg $3 Winner  9-14=[2 %21jogador-2 14]=9- with the Cards %cartas-jog-2 Totalizing:4 %cartas-valor-jog-2  | /acaba-21 | halt }
  if ($1 == 21) && ($2 == %21jogador-1)  { /msg $3 Winner: 9-14=[12 %21jogador-1 14]=9- with the cards %cartas-jog-1 Totaling:4 %cartas-valor-jog-1 |  /timer_encerra-21 off | /acaba-21 | halt }
  if ($1 < 21) && ($2 == %21jogador-1) {
    if (%21para-jog-2 !== on) { /msg $3 9-14=[2 %21jogador-2 14]=9- Your Turn! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds... }
    if (%21para-jog-2 == on) { set %21jogada-jog 1 | /msg $3 9-14=[12 %21jogador-1 14]=9- You rule! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds...  |  .timer_encerra-21 1 62 /encerra-21 $3 | halt }
  }
  if ($1 > 21) && ($2 == %21jogador-2) { /msg $3 12[4 BOOOOOOOOOOMMMM!!!!12] 9-14=[2 $2 14]=9- Explodes with the cards %cartas-jog-2 Totaling:4 %cartas-valor-jog-2 | /msg $3 Winner 9-14=[12 %21jogador-1 14]=9- with the Cards %cartas-jog-1 Totaling:4 %cartas-valor-jog-1  |  /timer_encerra-21 off | /acaba-21 | halt }
  if ($1 == 21) && ($2 == %21jogador-2) { /msg $3 Winner 9-14=[2 %21jogador-2 14]=9- with the cards  %cartas-jog-2 Totaling:4 %cartas-valor-jog-2  |   /timer_encerra-21 off | /acaba-21 | halt }
  if ($1 < 21) && ($2 == %21jogador-2) {
    if (%21para-jog-1 !== on) { /msg $3 9-14=[12 %21jogador-1 14]=9- Your Turn! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds... | halt }
    if (%21para-jog-1 == on)  { set %21jogada-jog 2 | /msg $3  9-14=[2 %21jogador-2 14]=9- You rule! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds...  |  .timer_encerra-21 1 62 /encerra-21 $3 | halt }
  }
}
alias acaba-21 {
  set %21jog off
  unset %21jogador-1 %21jogador-2 %cartas-valor-jog-1 %cartas-jog-1 %cartas-valor-jog-2 %cartas-jog-2
}
on *:text:!compare:#: {
  if (%21jogada-jog == 1) {
    if ($nick == %21jogador-1) && (%21para-jog-2 !== on) { /set %21para-jog-1 on | set %21jogada-jog 2 | /msg $chan   9-14=[2 %21jogador-2 14]=9-  You rule! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds... |  .timer_encerra-21 1 62 /encerra-21 $chan }
    if ($nick == %21jogador-1) && (%21para-jog-2 == on) { /quem-ganha-21 $chan |  /timer_encerra-21 off }
  }
  if (%21jogada-jog == 2) {
    if ($nick == %21jogador-2) && (%21para-jog-1 !== on) { /set %21para-jog-2 on | set %21jogada-jog 1 | /msg $chan   9-14=[12 %21jogador-1 14]=9- You rule! Type 4 !card  for one more card or type 4 !compare  To compare the cards and end the game! You have 60 seconds... |  .timer_encerra-21 1 62 /encerra-21 $chan }
    if ($nick == %21jogador-2) && (%21para-jog-1 == on) { /quem-ganha-21 $chan |  /timer_encerra-21 off }
  }
}
alias quem-ganha-21 {
  set %21total-jog-1 $calc(21 - %cartas-valor-jog-1)
  set %21total-jog-2 $calc(21 - %cartas-valor-jog-2)
  if (%21total-jog-1 < %21total-jog-2) {  /timer_encerra-21 off | /msg $1 Winner 9-14=[12 %21jogador-1 14]=9- with the Cards %cartas-jog-1 Totaling:4 %cartas-valor-jog-1 | /msg $1 Against the Cards: %cartas-jog-2 Of 9-14=[2 %21jogador-2 14]=9- Totaling:4 %cartas-valor-jog-2 | /acaba-21 | halt }
  if (%21total-jog-1 > %21total-jog-2) {  .timer_encerra-21 off | /msg $1 Winner  9-14=[2 %21jogador-2 14]=9- with the Cards %cartas-jog-2 Totaling:4 %cartas-valor-jog-2  | /msg $1 Against the Cards: %cartas-jog-1 Of 9-14=[2 %21jogador-1 14]=9- Totaling:4 %cartas-valor-jog-1  | /acaba-21 | halt }
  if (%21total-jog-1 == %21total-jog-2) {  .timer_encerra-21 off | /msg $1 This Game have no winner! | /acaba-21 | halt } 
}
alias passa-carta {
  set %21cor  $rand(1,2)
  if (%21cor == 1) { set %21cort 1 }
  if (%21cor == 2) { set %21cort 4 }
  if ($1 == 1) { return  $+ %21cort $+ ,0 $+ [A] }
  if ($1 == 2) { return  $+ %21cort $+ ,0 $+ [2] }
  if ($1 == 3) { return  $+ %21cort $+ ,0 $+ [3] }
  if ($1 == 4) { return  $+ %21cort $+ ,0 $+ [4] }
  if ($1 == 5) { return  $+ %21cort $+ ,0 $+ [5] }
  if ($1 == 6) { return  $+ %21cort $+ ,0 $+ [6] }
  if ($1 == 7) { return  $+ %21cort $+ ,0 $+ [7] }
  if ($1 == 8) { return  $+ %21cort $+ ,0 $+ [8] }
  if ($1 == 9) { return  $+ %21cort $+ ,0 $+ [9] }
  if ($1 == 10) { return  $+ %21cort $+ ,0 $+ [10] }
  if ($1 == 11) { return  $+ %21cort $+ ,0 $+ [J] }
  if ($1 == 12) { return  $+ %21cort $+ ,0 $+ [Q] }
  if ($1 == 13) { return  $+ %21cort $+ ,0 $+ [K] }
}

Why the Ace only equals 1 is beyond me; it makes as much sense as the J/Q/K = 11/12 & 13 respectively. It is mind-boggling pain! :-) This whole deal is crazy! If you were looking for a Black Jack alias, why didn't you make the Ace = 1 & 11 and the J/Q/K = 10? Writing the Ace to take both values inherently when needed is a trick in itself because how Black Jack works is if the Ace being 11 puts you over 21, the Ace is considered a 1 instead. However, it's vise-versa during fair-play within the 21 boundary. Ace is always 11, assuming it gets you at or around 21.

Whew, that was a mouthful. I hope I've been clear, I don't speak Spanish.

 Respond  
EL   -  Aug 25, 2008

Lol i jsut hope some one can do it everyone that knows me know my typing sux ;x

 Respond  
Zmodem   -  Aug 25, 2008

What he hell is jogador?

 Respond  
rhasttaff   -  Aug 25, 2008

good idea EL i need this kind of help :)

Jah Bless´´´

 Respond  
EL   -  Aug 25, 2008

Maybe some one should edit it in English so its grammatically accurate./me doesnt volunteer

 Respond  
irchainscriptz   -  Aug 22, 2008

yeah a nice game, well looking forward to see the update.

 Respond  
rhasttaff   -  Aug 22, 2008

i hope finish this on the next 3 days

Jah Bless´´´

 Respond  
Eugenio   -  Aug 21, 2008

When you have finished.....update ?

 Respond  
wizard38   -  Aug 19, 2008

many words in portuguese......

 Respond  
rhasttaff   -  Aug 19, 2008

Thanks Brothers for comment my post.
this game will be better when i add options for one player agains the bot and for more of 2 players. i will try do this!

thanks again!

enjoy ;)

 Respond  
Fuzion   -  Aug 18, 2008

nice game

 Respond  
wizard38   -  Aug 17, 2008

nice game , but i don't like games for two players, one player against de script

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.