Script BlackJack
ago31
on *:text:!blackjack*:#: {
unset %cards
unset %bcards
unset %ctotal
unset %btotal
set %cards $rand(1,9) $rand(1,9)
set %ctotal $calc($left(%cards,1) + $right(%cards,1))
set %bcards $rand(1,9) $rand(1,9)
set %btotal $calc($left(%bcards,1) + $right(%bcards,2))
notice $nick [BLACK JACK] Le tue carte: %cards – Totale: %ctotal $+ . Per avere una carta digita !carta ~ Per fermarti digita !stopcarte
}
on *:text:!carta*:#matty`: {
set %tempcard $rand(1,9)
set %ctotal $calc(%ctotal + %tempcard)
set %cards %cards $+ $chr(32) $+ %tempcard
notice $nick [BLACK JACK] Le tue carte: %cards – Totale: %ctotal $+
if (%ctotal >= 22) { msg $chan [BLACK JACK] $nick mi dispiace per te ma.. Ho vinto! ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) | halt }
if (%ctotal == 21) { msg $chan [BLACK JACK] $nick hai fatto BlackJack!!!! ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) | halt }
set %btemp $rand(1,9)
set %btotal $calc(%btotal + %btemp)
set %bcards %bcards $+ $chr(32) $+ %btemp
if (%btotal >= 22) { msg $chan [BLACK JACK] $nick hai vinto! ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) | halt }
if (%btotal == 21) { msg $chan [BLACK JACK] Ho fatto BlackJack ed ho vinto. ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) | halt }
}
on *:text:!stopcarte*:#matty`: {
if (%btotal >= %ctotal) { msg $chan [BLACK JACK] $nick mi sono fermato e.. ho vinto! ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) }
if (%ctotal >= %btotal) { msg $chan [BLACK JACK] $nick ti sei fermato e.. hai vinto! ( $+ Il mio punteggio: %btotal – Punteggio di $nick $+ : %ctotal $+ ) }
}
Come usare il BlackJack:
Per iniziare digita !blackjack
Per prendere una carta: !carta
Per non prendere più carte: !stopcarte
——-
By http://hawkee.com Traduzione by Matty`