Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:TEXT:!dd*:#real_g_irl: .signal sig!dd $Nick $chan $1-
- on *:TEXT:!roll:#real_g_irl: .signal sig!roll $Nick $chan $1-
- on *:SIGNAL:sig!dd:{
- var %nick = $1, %chan = $2
- tokenize 32 $3-
- if (%roll_int) {
- notice %Nick I'm sorry but there is already a game going on. Please wait until the current game is finished.
- }
- elseif ($0 != 4) {
- notice %Nick You must first place a bet before you begin a dice game.
- }
- elseif ($4. !isnum 1-) {
- notice %nick You have placed an invalid bet. Bets must be a whole number of atleast 1 (one).
- }
- elseif ($2 !ison %chan) || ($3 !ison %chan) {
- notice %nick In order to start a dicing game, 4 $$+ $v1 $+ must be in the channel. Please try again.
- }
- elseif ($2 == $3) {
- notice %nick I'm sorry but you must specify two different players.
- }
- elseif (%nick isreg %chan) {
- notice %nick In order to start a dicing game, a rank must start the game. Please have a voice or higher start the game for you.
- }
- else {
- set -eu300 %roll_int %nick
- set -eu300 %roll_P1 $nick(%chan,$nick(%chan,$2))
- set -eu300 %roll_P2 $nick(%chan,$nick(%chan,$3))
- set -eu300 %roll_bet $4
- set -eu300 %roll_turn 1
- set -eu300 %roll_p1tot
- msg %chan A dicing game between 4 $+ $2 $+ and 4 $+ $3 $+ has been started.
- msg %chan The wager is $4 $+ .
- msg %chan To begin rolling type 4 $+ !roll $+ to roll, starting with 4 $+ $2 $+ $+ . You may only roll once each.
- }
- }
- on *:SIGNAL:sig!roll:{
- var %nick = $1, %chan = $2
- tokenize 32 $3-
- if (%nick == %roll_P1) {
- if (%roll_turn == 1) {
- var %roll1 $r(1,6), %roll2 $r(1,6)
- set -eu300 %roll_p1tot $calc(%roll1 + %roll2)
- msg %chan %nick has rolled a %roll1 and a %roll2 $+ , adding up to a roll of %roll_p1tot $+ .
- inc %roll_turn
- }
- else {
- notice %Nick I'm sorry but it's not your turn.
- }
- }
- elseif (%nick == %roll_p2) {
- if (%roll_turn == 2) {
- var %roll1 = $r(1,6), %roll2 = $r(1,6), %p1tot = %roll_p1tot, %p2tot = $calc(%roll1 + %roll2)
- var %c = $iif(%p1tot > %p2tot,doubled won against,$iif($v1 < $v2,lost lost against,kept tied with))
- msg %chan %nick has rolled a %roll1 and a %roll2 $+ , adding up to a roll of %p2tot $+ .
- msg %chan %roll_p1 has $gettok(%c,2-,32) %nick $+ .
- msg %chan %roll_int has $gettok(%c,1,32) his/her bet of %roll_bet
- timer1 5 1 msg #real_g_irl The dicing game between 4 $+ %roll_P1 $+ and 4 $+ %roll_P2 $+ has ended. You may now play another game.
- unset %roll_*
- }
- else {
- notice %Nick I'm sorry but it's not your turn.
- }
- }
- else {
- notice %nick I'm sorry but no one has placed a bet on you.
- }
- }
- on *:INPUT:#: {
- if (!$ctrlenter) && (!$inpaste) {
- if ($1 == !dd) .signal sig!dd $me $chan $1-
- elseif ($1 == !roll) .signal sig!roll $me $chan $1-
- }
- }
Add Comment
Please, Sign In to add comment